Is it possible to install Apache mod_security Amaz

2019-09-03 11:40发布

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条回答
太酷不给撩
2楼-- · 2019-09-03 12:21

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.

查看更多
登录 后发表回答