Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not Acceptable! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security

I'm new to moodle environment and I'm having this error:

Not Acceptable!

An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

I haven't done anything, I'm just viewing the registered users in my website:
http://www.joyfementira.com/dnsc/it14lms
I've noticed that my profile picture is not properly loaded so I clicked on it (picture's position), and after that the error came out.

What probably caused this error and how would I fix it?

like image 327
Mark Jhon Oxillo Avatar asked Jan 22 '15 14:01

Mark Jhon Oxillo


People also ask

What does an appropriate representation of the requested resource could not be found on this server mean?

“An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.” That means you have tried some wrong passwords or tried to reach some url's which server detected you as attacker. And now your browser have disabled your access.

What is ModSecurity error?

It simply states that you do not have permission to access / on the server. Depending on the exact link where you get the error, the path may vary. ModSecurity works in the background, and every page request is being checked against various rules to filter out those requests which seem malicious.


3 Answers

I was experiencing same issue with my WP site shared-hosted in HostMonster. I resolved simply by accessing to the server via SSH and added the following lines on the .htaccess file :

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>
like image 165
cryptolucio Avatar answered Oct 21 '22 14:10

cryptolucio


Just to add to the answers. If this happens while you are trying to login to a WordPress website admin and you are using any type of VPN on your machine, you'd have to turn it off to solve the problem.

If you turn off your VPN, you'd be able to login without experiencing the issue.

like image 42
Sleek Geek Avatar answered Oct 21 '22 13:10

Sleek Geek


Apache has a mod_security tool that tries to block SQL injections by url. This rule is also blocking some real urls. The solution is:

  • access WHM in your dedicated server
  • search for mod_security tools
  • check if it's blocking some urls
  • click in the rule id
  • click in deploy and Restart Apache

if you don't have access to WHM in your server. Pass this issue to your server administrator.


This is the rule that was blocking my urls

SecRule REQUEST_HEADERS|XML:/*|!REQUEST_HEADERS:Referer "\b(\d+) ?= ?\1\b|\'\"[\'\"] ?= ?[\'\"]\2\b" \ "phase:2,capture,t:none,t:urlDecodeUni,t:htmlEntityDecode,t:replaceComments,t:compressWhiteSpace,t:lowercase,ctl:auditLogParts=+E,log,auditlog,msg:'SQL Injection Attack',id:'959901',tag:'WEB_ATTACK/SQL_INJECTION',logdata:'%{TX.0}',severity:'2'"

like image 5
Marcelo Avatar answered Oct 21 '22 13:10

Marcelo