Apache: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

74,020

Solution 1

It turned out I did enabled ssl module but i had to do it again and it works, here is the command:

sudo a2enmod ssl

Now restart apache like so service apache2 restart

no more error, FIXED!

Solution 2

sudo a2enmod ssl 

and restart the apache service that will do the trick

Solution 3

Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

Simply:

This error likely happens on apache if your "virtual host" is trying to use SSL but you did not install SSL module on your apache.

Case 1: For Centos (linux distro), run:

yum install mod_ssl openssh

Case 2: For Ubuntu or Debian (linux distros), run:

sudo a2enmod ssl 

And it should install and configure everything (a new file *-ssl.conf should appear in your conf.modules.d folder)

Solution 4

  1. When you edit the site configuration file, you have to test the configuration before enabling the site just to ensure its Syntax is correct. Use the command below to test the configuration.
apache2ctl configtest

or

sudo apache2ctl configtest

So if the syntax is correct you get a response similar to the one below enter image description here

  1. If you get the SSLEngine: Invalid command error then run the following command and go back to step one, solve all Syntax errors until it says Syntax OK.
sudo a2enmod ssl
  1. Restart apache using the following command
sudo apachectl restart

Hopefully that solves the error.

Solution 5

sudo yum install mod_ssl
sudo a2enmod ssl
sudo apachectl restart
Share:
74,020
Dung
Author by

Dung

Senior Progarmmer (multiple programming languages).

Updated on July 09, 2022

Comments

  • Dung
    Dung almost 2 years

    When configure apache2 virtual hosts for ssl/https connection, after adding configuration and enable the configuration with this command " a2ensite pm.university.com.conf " i got this error "Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration". I will answer my own question.

  • SdSaati
    SdSaati over 2 years
    Thanks a lot! it worked for me