LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-14-2007, 02:44 PM   #1
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Rep: Reputation: 35
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:

http://mysite.com/

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:

http://mysite.com/wiki/

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?
 
Old 11-14-2007, 03:37 PM   #2
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
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:
Code:
telnet mysite.com 80
You will see that you are connected and told about the Escape character. If you type, "GET /index.html" you will get your default page (or in your case the error about the 403 and not having the default error page either.

Now, telnet to some unused port:
Code:
telnet mysite.com 81
You should see something like, "telnet: connect to address 11.22.33.44: Connection refused

I'm guessing this is really what you want Apache to do.

HTH

Forrest

Last edited by forrestt; 11-14-2007 at 03:38 PM.
 
Old 11-14-2007, 10:03 PM   #3
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
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.

Paul
 
Old 11-15-2007, 08:48 AM   #4
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache error - Invalid Command 'AddType'... humbletech99 Linux - Networking 0 11-28-2005 08:22 AM
apache 2.0.52 : timeout specified has expired jeanpba Linux - Networking 1 02-15-2005 05:18 PM
PHP include() file paths in Apache virtual hosts tawalker Linux - Software 0 09-23-2004 02:16 PM
Timeout after 30s (apache+php+postgreSQL) J_Szucs Linux - Software 4 10-10-2003 01:30 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM


All times are GMT -5. The time now is 11:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration