运行:CentOS6 x64
当我重新启动httpd,我得到以下错误。 我错过了什么?
[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
我已经使用yum install mod_ssl
Package 1:mod_ssl-2.2.15-15.el6.centos.x86_64 already installed and latest version
我的sites.conf看起来像这样
<VirtualHost *:80> # ServerName shop.itmanx.com ServerAdmin [email protected] 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 [email protected] 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>
SSLEngine on将不会工作,除非ssl模块本身被加载。 你应该有一个类似LoadModule ssl_module modules/mod_ssl.so的行。
在我的安装中,我有一个名为/etc/httpd/conf.d/ssl.conf的文件,它指定了这个LoadModule指令。 该文件是您所说的安装的mod_ssl软件包的一部分。 validation文件是否在那里,并且你的主要的httpd.conf文件(通常是/etc/httpd/conf/httpd.con)有一行说明Include conf.d/*.conf这样的内容,这样就完成了。 /etc/httpd/conf.d中的conf文件也读入configuration中。
(哦,安装openssh软件包与在Apache中运行SSL无关)