首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >apache2无效命令“SSLEngine”

apache2无效命令“SSLEngine”
EN

Unix & Linux用户
提问于 2012-02-10 14:25:56
回答 6查看 351.8K关注 0票数 146

当我重新启动httpd时,会得到以下错误。我遗漏了什么?

代码语言:javascript
复制
[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_ssl安装了yum install mod_ssl openssh

代码语言:javascript
复制
Package 1:mod_ssl-2.2.15-15.el6.centos.x86_64 already installed and latest version
Package openssh-5.3p1-70.el6_2.2.x86_64 already installed and latest version

我的sites.conf看起来像这样

代码语言:javascript
复制
<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>
EN

回答 6

Unix & Linux用户

回答已采纳

发布于 2012-02-10 15:11:49

可能您没有加载ssl模块。在文件中应该有一个LoadModule指令。

类似于:

代码语言:javascript
复制
LoadModule ssl_module /usr/lib64/apache2-prefork/mod_ssl.so

通常,(在任何发行版上)都有一个名为(类似于) loadmodule.conf的文件,在该文件中,您应该在服务器启动时为加载到Apache中的每个模块找到一个LoadModule指令。

票数 66
EN

Unix & Linux用户

发布于 2015-02-18 00:02:37

在许多系统上(Ubuntu,Suse,Debian,.)运行以下命令以启用Apache的SSL mod:

代码语言:javascript
复制
sudo a2enmod ssl

2 a2enmod手册页

票数 178
EN

Unix & Linux用户

发布于 2017-04-09 09:24:16

在CentOS 7上,安装"mod_ssl“包并重新启动apache服务器对我起了作用:

代码语言:javascript
复制
yum install mod_ssl
systemctl restart httpd
票数 31
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/31378

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档