Re: [users@httpd] Add header when access is denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joshua Slive wrote:
>On 11/17/05, Phil Endecott wrote:

>> Hi Joshua, thanks for the reply.  Yes, when I comment-out my
>> ErrorDocument directives I get what I had expected:

>> My ErrorDocuments are the standard ones from the Debian package.  Is
>> there anything I can do to fix this?  Presumably it's a case of
>> appending rather than setting the Vary header somewhere.  If not
>> I'll just stick with the default messages.

> How is your Header directive scoped?  Does it work if you apply the
> directive specifically to the error documents directory?

Thanks Joshua, I think I have something that works now.

My ErrorDocuments are declared in the global configuration, while my Header directive was in the main <Directory> section for one virtual host. I've copied the Header line into the <Directory> section for the /error pages and now it seems to work:

 1 HTTP/1.1 403 Forbidden
 2 Date: Sat, 19 Nov 2005 12:46:34 GMT
 3 Server: Apache/2.0
 4 Vary: accept-language,accept-charset,X-moz
 5 Accept-Ranges: bytes
 6 Connection: close
 7 Content-Type: text/html; charset=iso-8859-1
 8 Content-Language: en
 9 Expires: Sat, 19 Nov 2005 12:46:34 GMT
12:46:34 ERROR 403: Forbidden.

I think this is acceptable, though it would be more correct to add the extra token to Vary: only when the error has come from the one virtual host. The only way I can think of doing this is to replicate all of the ErrorDoc stuff (and copy/symlink the actual error pages?) for each virtual host.

Perhaps the more important issue is that the "always" option to the Header directive could be better named/documented.

BTW, this is an attempt to defeat the "FasterFox" mozilla extension which scans pages as you load them and starts fetching all linked-to pages in the background. One of my sites got a mention on Digg earlier in the week, with two consequences. First, every FasterFox-using Digg viewer downloaded my site's front page, whether or not they actually clicked on it, and those who did click on it downloaded essentially the entire site rather than just the one page they would look at. My guess is that this inflated the resources used by a factor of 5 to 10, and combined with some other issues took the site down for several hours. Anyone with a site that might get linked to unexpectedly from a popular blog/news site should consider doing something like this. Of course it has the disadvantage of also blocking more legitimate uses of prefetching, such as Google.

Cheers,
--Phil.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux