Kamis, 06 September 2018

How to fix Invalid command 'SSLEngine', perhaps misspelled or defined by a module Ubuntu

  Tidak ada komentar
Some day i got error when migrate web apps from centos to ubuntu and turn on the https 
root@cloud:/etc/apache2/sites-enabled# service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-09-06 18:21:53 WIB; 23s ago
  Process: 40474 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
  Process: 37522 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 40483 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 Main PID: 121796 (code=exited, status=0/SUCCESS)

Sep 06 18:21:53 kapal-cloud systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 06 18:21:53 kapal-cloud systemd[1]: Starting The Apache HTTP Server...
Sep 06 18:21:53 kapal-cloud apachectl[40483]: AH00526: Syntax error on line 49 of /etc/apache2/sites-enabled/cloud.conf
Sep 06 18:21:53 kapal-cloud apachectl[40483]: Invalid command 'SSLEngine', perhaps misspelled or defined by a module
Sep 06 18:21:53 kapal-cloud apachectl[40483]: Action 'start' failed.
Sep 06 18:21:53 kapal-cloud apachectl[40483]: The Apache error log may have more information.
Sep 06 18:21:53 kapal-cloud systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 06 18:21:53 kapal-cloud systemd[1]: Failed to start The Apache HTTP Server.
Sep 06 18:21:53 kapal-cloud systemd[1]: apache2.service: Unit entered failed state.
Sep 06 18:21:53 kapal-cloud systemd[1]: apache2.service: Failed with result 'exit-code'.
The error tell us that there is no or invalid command SSLEngine as shown on figure above


I looking for the answer on internet and i got the sollution that i have to running command a2enmod ssl first to turn on the SSLEngine and restart the apache2 service like shown bellow
root@cloud:/etc/apache2/sites-available# a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
  systemctl restart apache2
root@cloud:/etc/apache2/sites-available#
After i typing the command, i restart the apache2 service 
root@cloud:/etc/apache2/sites-available#
root@cloud:/etc/apache2/sites-available# systemctl restart apache2
Enter passphrase for SSL/TLS keys for cloud.wachid.web.id:443 (RSA): ******
root@cloud:/etc/apache2/sites-available#
Then i check the apache2 service, and amazing it running well now 
root@cloud:/etc/apache2/sites-available# systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-09-06 18:27:57 WIB; 6s ago
  Process: 40474 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
  Process: 37522 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 40565 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 40578 (apache2)
    Tasks: 1
   Memory: 3.7M
      CPU: 45ms
   CGroup: /system.slice/apache2.service
           └─40578 /usr/sbin/apache2 -k start

Sep 06 18:27:32 cloud systemd[1]: Starting The Apache HTTP Server...
Sep 06 18:27:53 cloud apachectl[40565]: AH00557: apache2: apr_sockaddr_info_get() failed for cloud
Sep 06 18:27:53 cloud apachectl[40565]: AH00558: apache2: Could not reliably determine the server's fully qualified ..
Sep 06 18:27:57 cloud systemd[1]: Started The Apache HTTP Server.

root@kapal-cloud:/etc/apache2/sites-available#


Tidak ada komentar :

Posting Komentar