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:

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:

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:

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

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

openssl s_client -connect
  • 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:

LoadModule ssl_module /usr/lib64/apache2-prefork/
  • 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:

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.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma