【问题标题】:Installing mod_security on EC2在 EC2 上安装 mod_security
【发布时间】:2014-08-04 08:53:00
【问题描述】:

我正在尝试使用 yum install mod_security 安装 mod_security,但出现此错误

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest                                                                           | 2.1 kB     00:00
amzn-updates/latest                                                                        | 2.3 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package mod_security.x86_64 0:2.7.3-3.23.amzn1 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_security-2.7.3-3.23.amzn1.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.27-1.2.amzn1 will be installed
--> Processing Dependency: httpd-tools = 2.2.27-1.2.amzn1 for package: httpd-2.2.27-1.2.amzn1.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.2.27-1.2.amzn1 will be installed
--> Processing Conflict: httpd24-2.4.9-1.55.amzn1.x86_64 conflicts httpd < 2.4.9
--> Processing Conflict: httpd24-tools-2.4.9-1.55.amzn1.x86_64 conflicts httpd-tools < 2.4.9
--> Finished Dependency Resolution
Error: httpd24 conflicts with httpd-2.2.27-1.2.amzn1.x86_64
Error: httpd24-tools conflicts with httpd-tools-2.2.27-1.2.amzn1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我已经删除了 httpd24-tools-2.4.9-1.55.amzn1.x86_64 和 httpd24-2.4.9-1.55.amzn1.x86_64

【问题讨论】:

  • 假设这个 Amazon Linux。什么版本的 Amazon Linux?
  • @Rico Amazon Linux AMI x86_64 PV EBS
  • 试试yum install mod24_security.x86_64

标签: php amazon-ec2 mod-security


【解决方案1】:
sudo yum install mod24_security.x86_64

然后

sudo service httpd restart

【讨论】:

    【解决方案2】:

    遇到同样的错误。

    使用以下命令删除 apache 和工具版本 24 和 27。

    yum remove httpd httpd-tools
    

    然后能够成功安装,没有任何版本冲突 Check once.

    【讨论】:

    • 如果我删除那些包php56 php56-devel php56-jsonc-devel 也会被删除...解决方法是什么?尝试再次安装它们会带来冲突
    • 我改为yum install mod24_security.x86_64
    【解决方案3】:

    你可以运行命令:

    # yum install mod_security
    

    mod_security 配置文件:

    1) /etc/httpd/conf.d/mod_security.conf - mod_security Apache 模块的主要配置文件。

    2) /etc/httpd/modsecurity.d/ - mod_security Apache 的所有其他配置文件。

    3) /etc/httpd/modsecurity.d/modsecurity_crs_10_config.conf - 此文件中包含的配置应在部署前根据您的特定要求进行定制。

    4) /var/log/httpd/modsec_debug.log - 使用调试消息来调试 mod_security 规则和其他问题。

    5) /var/log/httpd/modsec_audit.log - 所有触发 ModSecurity 事件(如检测到)或服务器错误的请求都被记录(“RelevantOnly”)被记录到这个文件中。

    有关更多信息,请查看这篇关于如何在 CentoOS 上进行设置的文章: http://www.cyberciti.biz/faq/rhel-fedora-centos-httpd-mod_security-configuration/

    【讨论】:

      猜你喜欢
      • 2016-06-07
      • 2014-10-20
      • 2015-02-10
      • 1970-01-01
      • 1970-01-01
      • 2013-09-14
      • 2012-01-02
      • 2017-11-05
      • 1970-01-01
      相关资源
      最近更新 更多