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.
Asked
Active
Viewed 1.3e+01k times
6 Answers
117
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!

Dung
- 19,199
- 9
- 59
- 54
-
Hi, I am facing same issue in windows OS. These commands are not working in my case. So, could you please help me how to fix this issue in windows OS.. – srihitha Aug 07 '22 at 05:26
-
Still showing the same error :( – trueToastedCode Nov 29 '22 at 13:10
25
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)

ofundefined
- 2,692
- 2
- 18
- 35
22
sudo a2enmod ssl
and restart the apache service that will do the trick

Manoj Rammoorthy
- 1,384
- 16
- 16
5
sudo yum install mod_ssl
sudo a2enmod ssl
sudo apachectl restart

Jeremy Caney
- 7,102
- 69
- 48
- 77

PHIRUN
- 51
- 1
- 1
5
- 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
- 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
- Restart apache using the following command
sudo apachectl restart
Hopefully that solves the error.

Tinashe
- 1,052
- 12
- 20
2
Try following Solution:
- Open the file httpd.conf at "your apache folder"/conf
- Find the following line using CTRL+f in your text editor: #LoadModule ssl_module modules/mod_ssl.so
- Remove the #(uncomment the line)
- Save and restart your apache

srihitha
- 371
- 2
- 14