Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Problem solved: After looking at the logs the ModSecurity was using a regex that picked up on some text on the site, changed the text slightly and everything now works. Thanks for the help.

Hi,

I have Apache(2.2.17) and PHP(5.2.14) running on Linux and I am getting a 403 forbidden error when trying to access a specific php page.

I have two pages, form1.php which passes info to form2.php When I press submit on form1.php I get the 403 error, but if I tried to load form2.php directly by it's URL then it loads fine.

Both pages used to work fine until last week. I know for a fact that the code in the php files hasn't changed(I have re-uploaded to make sure), and am fairly sure that the server software hasn't been changed. All the other php pages on the server have continued working as normal, even the ones in the same directory.

All files in question have permissions set as 644, -rw-r--r-- There are no errors in the Apache logs.

Can anyone suggest anything? This is becoming increasingly frustrating.

Thanks

share|improve this question
What OS are you using? Linux is just a kernel, an OS is something like Debian, Ubuntu or CentOS. How did you install Apache? From source or packages? – Lekensteyn Dec 19 '10 at 14:33
Sorry, should have mentioned. Our sites are hosted by an external company so I don't know which version. – James Dec 19 '10 at 18:15

closed as too localized by Stefan Lasiewski, mgorven, mdpc, Khaled, Hennes Feb 28 at 22:17

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

Suggestion: check your error logs. The location of these logs depends on the system. Try /var/log/apache/error_log and /usr/local/apache2/logs/error_log.

Your server has possibly restricted the methods that can be used to access the page. Search in your Apache configuration files for <Limit GET>, and modify it to <Limit GET POST>. That will enable Apache to handle forms submitted with the POST method.

share|improve this answer

There are no errors in the Apache logs.

A 403 should normally show in the error log, the Apache documentation gives an example.

Have you set LogLevel?

Have you configured separate logs for a vhost?

share|improve this answer
Hi, I got the full logs from our hosting company and it seems that there is a problem with ModSecurity. I have asked for details on the specific rule I am breaking. – James Dec 19 '10 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.