开发者

Why Is Apache Giving 403?

I am getting 403 Errors from Apache when I send too many, 12, synchronous HTTP Posts via a desktop app I am building in XCode / Objective-C. The 12 POST requests are just a few kb each and go out instantly one after the other and the Apache Error Log shows...

client denied by server configuration: /the-path/the-file.php

Apache 2.0 PHP 5 and I have this same setup working fine on my local machine. The error is coming from a VPS with my host, which runs very fast and smooth and has plenty of resources. To debug I threw a sleep(1); function (stalls script execution by 1 second) into the php file and that fixed it. This makes me think that I am breaking some limit for too many requests for a single IP in a certain amount of time. I have googled and combed PHP ini and Apache configs, but I cannot find what that directive/setting might be.

I should mention that the although it varies the first 4 or 5 POSTS usually w开发者_C百科ork then it starts returning the 403 error intermittently after that. Just really acting like its bogging down.

Any ideas?


The error tells you everything: Most likely your VPS has flood control on their web server, which kicks in at 4 or 5 quickly-sequential hits. This has nothing to do with PHP itself, but ratherly completely to do with Apache. In other words, your home setup is not the same as the VPS's setup.


Try to off or configure mod_evasive. It is a module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. (Here you can read more about it). Use the command to off mod_evasive:

a2dismod mod-evasive
service apache2 restart
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜