Andy Hickey
Andy Hickey

Reputation: 1

Add apache mod_evasive in ebextensions script -causes 502

I am trying to add mod_evasive to a new elastic beanstalk instance on deployment. I have other configuration type ebextensions scripts that are working fine. Here is zratelimit.config:

packages:
  yum:
    epel-release: []
    mod_evasive: []
files:
  /etc/httpd/conf.d/mod_evasive.conf:
    mode: "000644"
    owner: root
    group: root
    encoding: plain
    content: |
      DOSEnabled true
      DOSHashTableSize 1000
      DOSPageCount 10
      DOSPageInterval 1
      DOSSiteCount 50
      DOSSiteInterval 5
      DOSBlockingPeriod 20
      DOSHTTPStatus 429

I tried to follow the guidance here at https://phoenixnap.com/kb/apache-mod-evasive

The application gives 502 when I try to access it. Any ideas what I'm doing wrong?

I added the script to the ebextensions folder. It is clearly running but failing, because when i remove this config file from my ebextensions folder, the application works (without the required apache module)

I previously had a restart instruction at the end of the config file:

container_commands:
  01restartservice:
    command: systemctl restart httpd.service

I removed this, but still the script causes the server to crash (502)

Upvotes: 0

Views: 37

Answers (0)

Related Questions