【问题标题】:sudo service httpd restart gives an error or ssl.confsudo service httpd restart 给出错误或 ssl.conf
【发布时间】:2016-12-06 07:51:43
【问题描述】:

我想重启 httpd aws ec2 linux。我在终端中编写以下命令。

  sudo service httpd restart 

但它给了我以下错误。

Starting httpd: AH00526: Syntax error on line 18 of /etc/httpd/conf.d/ssl.conf:
Invalid command 'SSLPassPhraseDialog', perhaps misspelled or defined by a module not included in the server configuration
                                                       [FAILED]




Starting httpd: AH00526: Syntax error on line 23 of /etc/httpd/conf.d/ssl.conf:
Invalid command 'SSLSessionCache', perhaps misspelled or defined by a module not included in the server configuration
                                                       [FAILED]

如果我评论该行,那么它会在下面显示错误。

Starting httpd: AH00526: Syntax error on line 24 of /etc/httpd/conf.d/ssl.conf:
Invalid command 'SSLSessionCacheTimeout', perhaps misspelled or defined by a module not included in the server configuration
                                                           [FAILED]

我不认为每次我都必须评论这些行。 目前,我不需要 ssl.conf。 因此,当我要重新启动 httpd 时,我不想调用它。 我该怎么做?

谢谢

【问题讨论】:

  • 你是怎么评论出来的?在第 24 行开头使用#
  • @ThanhNguyenVan:- 是的,我在第 24 行的开头使用了 #
  • 第二个错误日志和第一个错误日志一样,#前面SSLSessionCacheTimeout行注释掉了吗
  • @ThanhNguyenVan:更新
  • 如果您可以显示 /etc/http/httpd.conf 会有所帮助 - 通常如果您不需要 ssl.conf,请将其重命名为 ssl.backup

标签: amazon-web-services amazon-ec2 httpd.conf


【解决方案1】:

在我的 Centos 7 系统中,安装 mod_sslpython2-certbot-apache 软件包解决了这个问题

sudo yum install epel-release

sudo yum install mod_ssl python2-certbot-apache

【讨论】:

    【解决方案2】:

    当提供某些指令的模块未加载时,Apache 配置检查将抱怨不“了解”它们,正如您在收到的错误中看到的那样。

    您没有加载 mod_ssl,这就是 HTTPD 给您这些配置错误的原因。加载 mod_ssl 或确保不存在 mod_ssl 指令(取消注释、删除、不包含 ssl.conf,选择权在您手中)。

    【讨论】:

      【解决方案3】:

      重新安装httpd和php。 可能是你的配置坏了。 我希望它有效。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-06-17
        • 2016-04-02
        • 2015-06-22
        • 2014-12-20
        • 1970-01-01
        • 2013-08-09
        • 2018-02-18
        相关资源
        最近更新 更多