403 Forbidden after installing Mod_security


I installed Mod_security on Ubuntu 12.04 x32 following this tutorial:

and now I receive 403 Forbidden error on every page/folder on my website: You don’t have permission to access / on this server You don’t have permission to access /phpmyadmin on this server

I created /etc/modsecurity/modsecurity_custom_rules.conf and I could probably add custom rule for every specific case i.e. <Directory “/var/www/somefolder”> <IfModule security2_module> SecRuleEngine Off </IfModule> </Directory>

but is there a simpler way to add more general rules?

Also is it normal after installing Mod_security to get blocked completely or I did something wrong during the installation?

Thanks in advance

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

check the status of SELinux <br> <br># vi /etc/selinux/config
<br># SELINUX=disabled -> SELINUX=enforcing <br>save & exit <br># setenforce 0 <br> <br>It will be fine! <br>

you get? Good … I had this problem installing zpanel with apache2 … and I only comment on the <directory> … / etc/apache2/apache2.conf, al the virtual host worked nicely <br> <br>OS: Ubuntu 12 LTS

apache2/error.log is full with this crap: <br> <br>ModSecurity: Access denied with code 403 (phase 1). Match of “streq %{SESSION.IP_HASH}” against “TX:ip_hash”$