在EC2上安装mod_security

时间:2014-06-13 18:05:00

标签: php amazon-ec2 mod-security

我正在尝试使用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

3 个答案:

答案 0 :(得分:5)

sudo yum install mod24_security.x86_64

然后

sudo service httpd restart

答案 1 :(得分:3)

得到了同样的错误。

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

yum remove httpd httpd-tools

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

答案 2 :(得分:1)

您可以运行命令:

# 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事件(检测到的)或serer错误的所有请求(&#34; RelevantOnly&#34;)将记录到此文件中。< / p>

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