0

I'm try install and configure Mod_Security on Amazon EC2 Linux 64 bits, but one error happens

Syntax error on line 23 of /etc/httpd/conf.d/modsecurity.conf: ModSecurity: Found another rule with the same id

Need help to solve this, I tried to find in many search engines, but found nothing.

Can someone help me?

Tiago Souza
  • 41
  • 1
  • 5
  • 1
    Well, what's line 23 of that file, and have you checked for another line with the same ID? – ceejayoz Aug 31 '15 at 22:13
  • [link](http://s14.postimg.org/5hg8an5k1/Captura_de_Tela_2015_08_31_s_19_14_58.png) Print of screen with error. Do you have any idea about what can solve? – Tiago Souza Aug 31 '15 at 22:18
  • Somewhere in one of your config files there's another rule with ID `200000`, or you've double-included that `.conf` file. – ceejayoz Aug 31 '15 at 22:26
  • I removed the lines      Include conf.d / modsecurity.conf IfModule> and Apache returned to work. My new question is: the Include conf.d/*.conf get all .conf files, thus the Include conf.d/modsecurity.conf is included by default? – Tiago Souza Aug 31 '15 at 23:50
  • Yes, `Include conf.d/*.conf` would include it, so you're double-including it, thus the error. – ceejayoz Sep 01 '15 at 00:30
  • I followed this tutorial ( http://tutorial.centos.com.my/?p=69 ) and got success to install mod_security and mod_evasive. But php does not run, displays the code in the browser. Insert an index.php file in EC2 disk with the php code " Php phpinfo ();" but this is ignored and the EC2 displays the "Amazon Linux AMI Test Page" page. I did several tests but nothing works. Does anyone know a way to run php? – Tiago Souza Sep 01 '15 at 02:07

1 Answers1

1

You need to see if modsecurity is loaded twice or not. Go to your configuration file /etc/httpd/conf/httpd.conf and find "modsec". If you see two then comment one, restart apache.

For question number two:

<? Php phpinfo (); 

is this the correct one?

try

<?php
phpinfo();
?>
Prakash
  • 131
  • 6