Is it possible to install Apache mod_security Amazon Elastic Beanstalk

若如初见. 提交于 2019-12-25 01:43:56

问题


I have 4 ec2 instances (running Amazon Linux AMI) and i'am using elastic beanstalk to deploy my Java app to Tomcat.

I would like to know if it was possible to install the apache mod_security using the .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: I would like to install mod_security to have a protection against simple DOS attack Thank you!


回答1:


Yes it is possible. At the simplest you can create a file in .ebextensions called 10_mod_security.config

and inside contain

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

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)

Hope this helps.



来源:https://stackoverflow.com/questions/27569366/is-it-possible-to-install-apache-mod-security-amazon-elastic-beanstalk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!