Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Running: CentOS6 x64

When I restart httpd, I get the following error. What am I missing?

[root@localhost ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: Syntax error on line 22 of /etc/httpd/conf.d/sites.conf:
Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

I have installed mod_ssl using yum install mod_ssl

Package 1:mod_ssl-2.2.15-15.el6.centos.x86_64 already installed and latest version

My sites.conf looks like this

<VirtualHost *:80>
#    ServerName shop.itmanx.com
    ServerAdmin webmaster@itmanx.com

    DocumentRoot /var/www/html/magento
    <Directory /var/www/html>
        Options -Indexes
        AllowOverride All
    </Directory>

    ErrorLog logs/shop-error.log
    CustomLog logs/shop-access.log
</VirtualHost>

<VirtualHost *:443>
    ServerName secure.itmanx.com
    ServerAdmin webmaster@itmanx.com

    SSLEngine on
    SSLCertificateFile /etc/httpd/ssl/secure.itmanx.com/server.crt
    SSLCertificateKeyFile /etc/httpd/ssl/secure.itmanx.com/server.key
    SSLCertificateChainFile /etc/httpd/ssl/secure.itmanx.com/chain.crt

    DocumentRoot /var/www/html/magento
    <Directory /var/www/html>
        Options -Indexes
        AllowOverride All
    </Directory>

    ErrorLog logs/shop-ssl-error.log
    CustomLog logs/shop-ssl-access.log    
</VirtualHost>
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

SSLEngine on won't work unless the ssl module itself is loaded. You should have a line that looks like LoadModule ssl_module modules/mod_ssl.so somewhere.

In my installation, I have a file called /etc/httpd/conf.d/ssl.conf that specifies this LoadModule directive. That file is part of the mod_ssl package that you said you installed. Verify that the file is there, and that your primary httpd.conf file (typically /etc/httpd/conf/httpd.con) has a line that says something like Include conf.d/*.conf in it, so that all .conf files in /etc/httpd/conf.d are also read into the configuration.

(Oh, installing the openssh package is sort of irrelevant to getting SSL running in Apache)

share|improve this answer
    
i added the loadmodule line in httpd.conf and now its working hurrah!!! thanks cjc –  Christian Feb 10 '12 at 15:13
    
that was a typo on ssh, meant to write ssl... have corrected :) –  Christian Feb 11 '12 at 17:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.