Prevent Apache from answering invalid requests

Posted by nickdnk on Stack Overflow See other posts from Stack Overflow or by nickdnk
Published on 2014-06-10T17:48:46Z Indexed on 2014/06/10 21:25 UTC
Read the original article Hit count: 146

Filed under:
|

I have an Apache web-server that acts as a web front-end for iPhone and iPad applications that communicate by POST and JSON only.

Is there any way to prevent Apache from answering requests that are invalid? I can see my error log is filled with attempts to open files such as /admin.php /index.php etc - files that don't exist on my server.

I believe this is possible with IIS, but can you do the same thing with Apache?

Basically I want the request to appear timed out unless you post exactly the right content to the right file - or at least if you do not request an existing file. This would make the server appear non-existing to everyone but my iPhone users as all communication is SSL and directories are not really guess-able.

I did disable the ServerTokens and all that, but I still get File not found etc. when I access the server requesting a random file, which is what these bots do constantly.

© Stack Overflow or respective owner

Related posts about apache

Related posts about security