Nick Foote Nick Foote - 19 days ago 4x
Apache Configuration Question

How to install mod_ssl for Apache httpd?


So I installed Apache httpd a while ago and have recently come back to it to try setup SSL and get it serving several different tomcat servers.

At the moment I have two completely separate tomcat instances serving up to slightly different versions (one for dev and one for demo say) my web app to two different ports; and

I've successfully (back in Jan) used mod_jk to get httpd to serve those same tomcat instances to and (8090 cos I've got another app running on 8080 via Jetty at this stage) using the following code in httpd.conf;

LoadModule jk_module modules/
JkWorkersFile conf/
JkLogFile logs/mod_jk.log
JkLogLevel debug

<VirtualHost *:8090>
JkMount /devd* tomcatDev
JkMount /demo* tomcatDemo

What I'm not trying to do is enable SSL

I've added the following to httpd.conf

Listen 443
<VirtualHost _default_:443>
JkMount /dev* tomcatDev
JkMount /demo* tomcatDemo
SSLEngine on
SSLCertificateFile "/opt/httpd/conf/localhost.crt"
SSLCertificateKeyFile "/opt/httpd/conf/keystore.key"

But when I try to restart Apache with "apachectl restart" (yes after shutting down that other app I mentioned so it doesn't toy with https connections) I continuously get the error;

"Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration. httpd not running, trying to start"

I've looked in the httpd/modules dir and indeed there is no mod_ssl, only and httpd.exp.

I've tried using yum to install mod_ssl, it says its already installed. Indeed I can locate in /usr/lib/httpd/modules but this is NOT the path to where I've installed httpd which is /opt/httpd and in fact /usr/lib/httpd contains nothing but the modules dir.

Can anyone tell me how to install mod_ssl properly for my installed location of httpd so I can get past this error:


Are any other LoadModule commands referencing modules in the /usr/lib/httpd/modules folder? If so, you should be fine just adding LoadModule ssl_module /usr/lib/httpd/modules/ to your conf file.

Otherwise, you'll want to copy the file to whatever directory the other modules are being loaded from and reference it there.