centos6 apache2 无效命令 SSLEngine

centos6 apache2 无效命令 SSLEngine

运行: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

我已经使用安装了 mod_sslyum 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>

答案1

SSLEngine on除非加载了 ssl 模块本身,否则将无法工作。您应该看到一行类似于LoadModule ssl_module modules/mod_ssl.so某处的行。

在我的安装中,我有一个名为的文件/etc/httpd/conf.d/ssl.conf,它指定了此 LoadModule 指令。该文件是您所说的已安装的 mod_ssl 包的一部分。验证该文件是否存在,以及您的主 httpd.conf 文件(通常为 /etc/httpd/conf/httpd.con)Include conf.d/*.conf中是否有一行类似这样的内容,以便 /etc/httpd/conf.d 中的所有 .conf 文件也读入配置。

(哦,安装 openssh 包与在 Apache 中运行 SSL 有点无关)

相关内容