是否可以安装Apache mod_security Amazon Elastic Beanstalk [英] Is it possible to install Apache mod_security Amazon Elastic Beanstalk
问题描述
我有4个ec2实例(运行Amazon Linux AMI),并且我正在使用弹性beantalk将我的Java应用程序部署到Tomcat.
I have 4 ec2 instances (running Amazon Linux AMI) and i'am using elastic beanstalk to deploy my Java app to Tomcat.
我想知道是否可以使用.ebextensions安装apache mod_security吗?
I would like to know if it was possible to install the apache mod_security using the .ebextensions ?
ps:我必须手动安装,我知道如何安装mod_security和配置rulse.因为我对ebextensions并不十分熟悉,所以我想先知道这是否可能吗?
ps: I know how to install mod_security and configure the rulse if I have to do it by hand. As I'm not really familiar with ebextensions I would like to know first if is this would be possible?
ps2:我想安装mod_security来防御简单的DOS攻击 谢谢!
ps2: I would like to install mod_security to have a protection against simple DOS attack Thank you!
推荐答案
是可以的.最简单的方法是在.ebextensions中创建一个名为10_mod_security.config
Yes it is possible. At the simplest you can create a file in .ebextensions called 10_mod_security.config
并包含
packages:
yum:
mod_security: []
如果您希望创建一个额外的配置文件,则可以在同一文件中进行创建,例如;
if you wish to create an extra config file you can do so in the same file, like;
files:
"/etc/httpd/conf.d/mod_security.conf":
mode: "000644"
owner: root
group: root
content: |
insert your apache config here
encoding: plain
将通过yum安装软件包,然后在适当的目录中创建一个配置文件(尽管我相信yum会自动为您创建文件,但您必须对此进行一些测试)
that will install the package via yum, and then create a config file in the appropriate directory (although I believe yum creates the file for you automatically, you'd have to do some testing with this)
希望这会有所帮助.
这篇关于是否可以安装Apache mod_security Amazon Elastic Beanstalk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!