简体   繁体   English

在Amazon Elastic Beanstalk(Apache,EC2)上安装Mod_security

[英]install Mod_security on Amazon Elastic Beanstalk (Apache, EC2)

I get dependency issues when I try to install mode_security on Elastic Beanstalk. 尝试在Elastic Beanstalk上安装mode_security时遇到依赖关系问题。

It's pretty simple to recreate it: 重新创建它非常简单:

- launch a new PHP environment: -启动新的PHP环境:

  1. get on the elastic beanstalk console and create a new environment (you can register for free) 进入弹性beanstalk控制台并创建一个新环境(您可以免费注册)
  2. choose 'web server', then 'PHP', then 'load balancing' 选择“ Web服务器”,然后选择“ PHP”,然后选择“负载平衡”
  3. in 'Application Version' click Next, 'Environment Information' set name and Next 在“应用程序版本”中,单击“下一步”,“环境信息”设置名称,然后单击“下一步”。
  4. in 'Additional Resources','Configuration Details',etc let default then next and launch your environment 在“其他资源”,“配置详细信息”等中,默认设置为下一步,然后启动您的环境

- SSH into your instance: -通过SSH进入您的实例:

If you have the elastic beanstalk cli 如果您有弹性的豆茎cli

  1. cd your folder cd您的文件夹
  2. eb use [your env name] eb use [您的环境名称]
  3. eb ssh (you may be asked some confirmations) eb ssh(可能会要求您进行一些确认)
  4. try to install mod_security: yum install mod_security 尝试安装mod_security: yum install mod_security

Now you should have: 现在您应该具有:

Error: httpd24 conflicts with httpd-2.2.31-1.7.amzn1.x86_64
Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.7.amzn1.x86_64

在此处输入图片说明

Thank you for helping! 感谢您的帮助! If you have any questions, I'm here! 如果您有任何疑问,我在这里!


I saw on stackoverflow a solution was to remove them yum remove httpd httpd-tools and install mod_security, but that brings other dependency issues... 我在stackoverflow上看到一个解决方案是删除它们yum remove httpd httpd-tools并安装mod_security,但这带来了其他依赖关系问题...

When you are logged in to your instance (eb or ssh), use this to install the relevant packages: 登录到实例(eb或ssh)后,请使用以下命令安装相关软件包:

sudo yum install httpd24-devel.x86_64
sudo yum install mod24_security.x86_64

Don't forget to restart apache 不要忘记重启apache

sudo /etc/init.d/httpd restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM