Nowadays SSL are a must for any website. But when you try to install the certificate, you may encounter the Invalid Command SSLEngine error. More specifically, it will surface when you create virtual host record for port 443. That’s when Apache wouldn’t start as intended and yield the following error message:

Code:
Invalid Command ‘SSLEngine’, perhaps misspelled or defined by a module not included in the server configuration
Action ‘start’ failed.
The Apache error log may have more information
Why the Error Occurs?

Basically, there are two reasons behind the Invalid Command SSLEngine error. These are:
  • When Apache starts, it will read the configurations files. That’s when it’ll come across the SSLEngine, which it treats as an unknown directive. The directive exists because you must have installed or enabled mod_ssl module in the configuration. If you’re unaware, SSLEngine is responsible for creating and serving SSL connections.
  • The second reason is if you have configurations at /etc/httpd/conf or /etc/httpd/conf.d which you are not aware of, you may get the error.
How to Fix the Problem?

There are three ways you can fix this issue. These are:
  • Install mod_ssl
In a few cases when installing the Apache, users may have forgotten to either install or enable the mod_ssl in the configuration. So installing or enabling will fix this issue.

If you’ve already installed it, run the below command to enable it:

Code:
sudo yum install mod_ssl
For users on Apache 2.4, the module will be named mod24_ssl.

If you’re on a Debian-based distro, executing the following command will enable the module:

Code:
sudo a2enmod ssl
Now restart the Apache service using the following command:

Code:
sudo apachectl restart
Once the server starts, check the installation by running this command:

Code:
openssl s_client -connect yourdomain.com:443
  • Load the SSL Module
Another common issue is when there’s no SSL module in the server. So you have to load the LoadModule directive in the Apache configuration files.

Execute this command for that purpose:

Code:
LoadModule ssl_module /usr/lib64/apache2-prefork/mod_ssl.so
  • Delete the unnecessary configurations in the configuration file
As already mentioned if you had included certain configurations in the past and have forgotten about it, that’d lead to this error. So you need to remove them.

So go ahead and execute this command:

Code:
grep SSL /etc/httpd/{conf,conf.d} -r
Or else, you can just install the SSL module.

These three solutions should fix the Invalid Command SSLEngine issue. For further assistance, get in touch with the hosting support team.
Author
kumkumsharma
Views
14,112
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top