Erkin Kholmatov
Erkin Kholmatov

Reputation: 31

How to install mod_evasive in Amazon Linux ami

  1. Is Amazon planning to add mov_evasive to its latest AMI?
  2. How would I need to install mod_evasive on Amazon Linux? There are quite a few tutorials available on the web, but I have found no recent tutorial addressing Amazon Linux.
  3. Are there any recommendations from Amazon on how to secure a EC2 instance against DDoS attacks? I really would appreciate if Amazon could provide some sort of guidance on how to protect EC2 instances running Apache and WordPress by using open source firewalls and Apache modules like mod_security and mod_evasive.

I try install:

sudo yum --enablerepo=epel install mod_evasive

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                                                | 2.1 kB     00:00     
amzn-updates                                             | 2.5 kB     00:00     
1034 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package mod_evasive.x86_64 0:1.10.1-10.el6 will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: mod_evasive-1.10.1-10.el6.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.34-1.16.amzn1 will be installed
--> Processing Dependency: httpd-tools = 2.2.34-1.16.amzn1 for package: httpd-2.2.34-1.16.amzn1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.34-1.16.amzn1.x86_64
--> Running transaction check
---> Package apr-util-ldap.x86_64 0:1.5.4-6.18.amzn1 will be installed
---> Package httpd-tools.x86_64 0:2.2.34-1.16.amzn1 will be installed
--> Processing Conflict: httpd24-2.4.27-3.75.amzn1.x86_64 conflicts httpd < 2.4.27
--> Processing Conflict: httpd24-tools-2.4.27-3.75.amzn1.x86_64 conflicts httpd-tools < 2.4.27
--> Finished Dependency Resolution
Error: httpd24-tools conflicts with httpd-tools-2.2.34-1.16.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.34-1.16.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

rpm -qa 'httpd*'
httpd24-tools-2.4.27-3.75.amzn1.x86_64
httpd24-2.4.27-3.75.amzn1.x86_64

How fix this problem on Amazon ami linux?

Upvotes: 3

Views: 4107

Answers (3)

Jeremy
Jeremy

Reputation: 311

Thanks for the follow-up, Erkin; that is very helpful!

Two additional tips:

  1. To use apxs you will need to install httpd24-devel as noted in https://stackoverflow.com/a/37528944/1776044.
  2. This helpful comment suggests a modification to the test script for mod_evasive (test.pl) in case it returns all HTTP 400s:

    line 13: print $SOCKET "GET /?$_ HTTP/1.0\r\nHost: 127.0.0.1\r\n\r\n";

Upvotes: 0

Erkin Kholmatov
Erkin Kholmatov

Reputation: 31

I fix this problem from this url https://github.com/shivaas/mod_evasive

  1. Download this file https://raw.githubusercontent.com/shivaas/mod_evasive/master/mod_evasive24.c in to your server
  2. Run $APACHE_ROOT/bin/apxs -i -a -c mod_evasive24.c
  3. The module will be built and installed into $APACHE_ROOT/modules, and loaded into your httpd.conf
  4. Restart Apache

Maybe before Install mod_evasive24 need install some softs: httpd24-dev, libtool, python-devel

Upvotes: 0

mygeea
mygeea

Reputation: 466

If you are running Apache 2.4 try yum install mod24_ssl.x86_64

Upvotes: 3

Related Questions