Apache - I want a timeout for invalid paths
I've got Apache set up and running. Everything is fine. However, I want Apache to timeout, rather than returning error 403 (or any other error) if the request is for the root path or any other invalid path.
So ... if this is requested:
then I want Apache to ignore the request (timeout), rather than sending an error message that would confirm apache is running at that location. (there is nothing at the root path).
However, if any other valid path is requested, such as:
then I want apache to respond normally.
I have tried changing ErrorDocument in httpd.conf to some path that does not exist, but Apache still responds with an error message.
Why do I want to do this? I want the server to be invisible unless you know a valid path.
Can this be done?
What you are asking is possible, although I don't remember the details off the top of my head. I can try to find out, but it still won't make your server invisible. A connection is established to the server before any page request is processed. If the connection is made then you aren't invisible. To prove this, try to telnet to port 80 on your server:
Now, telnet to some unused port:
I'm guessing this is really what you want Apache to do.
Ok, I see what you are saying. Obviously, a connection must be established before any page request can happen. So, I guess I'm really wanting to ignore requests that would normally return a 403.
Actually, if I cannot figure out how to do this, I might just go with an empty custom 403 page. Not exactly what I want, but not too bad.
This isn't exactly what I wanted, but it will be ok for now.
In httpd.conf, you can specify custom error docs with "ErrorDocument". Or you can simply specify the actual message you want in double quotes. So, I have added this to my httpd.conf:
ErrorDocument 403 " "
It would not accept an empty string (""), so I put one space character between the quotes and that works.
Now instead of the standard 403 message which identifies I am running apache and gives others details of the server, the user gets a blank page. If you view the source, you see nothing (or one space character if you look carefully).
I am still interested if anyone knows a way to do my original timeout plan instead of 403.
|All times are GMT -5. The time now is 07:18 AM.|