forbidden vs not found with tilde

This is a discussion on forbidden vs not found with tilde within the Linux Web Servers forums, part of the Web Server and Related Forums category; I have very little influence over the people who run the Apache server I use. It always gives 403 (forbidden) ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-11-2008
Peter Scott
 
Posts: n/a
Default forbidden vs not found with tilde

I have very little influence over the people who run the Apache server
I use. It always gives 403 (forbidden) when it fails to access a URL
with a tilde. That is, it never gives 404 (not found) for directories
that do not exist. Clearly this avoids giving anything away to
crackers. However, it also means it takes ages for the google.bot to
drop dead pages automatically.

Is this the default behaviour, or has the web master set it up? Can it
be changed if I work on the web master?

TIA,
Peter
  #2 (permalink)  
Old 02-12-2008
Andreas Prilop
 
Posts: n/a
Default Re: forbidden vs not found with tilde

On Mon, 11 Feb 2008, Peter Scott wrote:

> I have very little influence over the people who run the Apache server
> I use.


First you need to find out whether you can use Apache's .htaccess
files for directives. Create a file named
.htaccess
in your www directory and write some garbage into it.
If you get an "Internal server error", then we can proceed further.
If you do not get such an error, speak to the server administrator.

--
Solipsists of all countries - unite!
  #3 (permalink)  
Old 02-13-2008
Peter Scott
 
Posts: n/a
Default Re: forbidden vs not found with tilde

Thanks Andreas,

> First you need to find out whether you can use Apache's .htaccess
> files for directives. Create a file named
> .htaccess
> in your www directory and write some garbage into it.
> If you get an "Internal server error", then we can proceed further.
> If you do not get such an error, speak to the server administrator.


I can do that and I am already using it as a work-round, generating
404 errors for the removed pages.

I'd still like to know if there is a better way.

Peter
  #4 (permalink)  
Old 02-13-2008
Andreas Prilop
 
Posts: n/a
Default Re: forbidden vs not found with tilde

On Wed, 13 Feb 2008, Peter Scott wrote:

> I can do that and I am already using it as a work-round, generating
> 404 errors for the removed pages.


Fine then.

> I'd still like to know if there is a better way.


Sorry, but I don't understand what your problem is. Could you
please explain in more detail what you want to achieve?
[ Use the address http://www.example.com/ as sample. ]

--
Solipsists of all countries - unite!
  #5 (permalink)  
Old 02-13-2008
phantom
 
Posts: n/a
Default Re: forbidden vs not found with tilde

"Peter Scott" <p.scott@shu.ac.uk> wrote in message
news:e08dba0f-0f87-471c-9318-28ac435d1de9@e6g2000prf.googlegroups.com...
>I have very little influence over the people who run the Apache server
> I use. It always gives 403 (forbidden) when it fails to access a URL
> with a tilde. That is, it never gives 404 (not found) for directories
> that do not exist. Clearly this avoids giving anything away to
> crackers. However, it also means it takes ages for the google.bot to
> drop dead pages automatically.
>
> Is this the default behaviour, or has the web master set it up? Can it
> be changed if I work on the web master?
>


It does appear to give things away to crackers, at least I'm seeing the
behaviour 403 for an existing user (or 200 if they have a web page in place)
and 404 for non-existing users. I'll assume this is what you are seeing...

So this would mean that the users specified after the tilde exist on the
server -
One thing that can be done is to explicitly disable the users that do not
have pages, with two lines like this:

UserDir public_html
UserDir disabled user1 user2

(the first line should already exist, so just add the second one underneath)
another would be to remove the users from the server (unless they still need
to be there for some other reason)
You could also use rewrite rules like these:

RewriteRule ^/~user1(/.*|)$ xxx [G,L]

RewriteRule ^/~user2(/.*|)$ xxx [G,L]

although these will produce '410 gone' rather than 404.


  #6 (permalink)  
Old 02-15-2008
Peter Scott
 
Posts: n/a
Default Re: forbidden vs not found with tilde

I have solved the problem! It is nothing to do with the Apache
configuration.

I want:

www.example.com/~fred/nonesuch

to give 404 (not found) if nonesuch does not exist. I want:

www.example.com/~fred/dir/nonesuch

to give 404 if dir or nonesuch does not exist.

It turns out they both give 403 (forbidden) when the lowest level
directory is unreadable. That is, when fred/public_html and
fred/public_html/dir are rwx--x--x. Making those directories readable
(rwxr-xr-x) makes Apache return 404 (not found).

Thinking about it, this is actually the optimum behaviour by Apache;
it
only reveals to the world as much as the owner of fred/public_html has
already given away by his or her choice of permissions.
 


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0