Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6B0895B5 for ; Mon, 12 Dec 2011 19:39:59 +0000 (UTC) Received: (qmail 73006 invoked by uid 500); 12 Dec 2011 19:39:56 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 72940 invoked by uid 500); 12 Dec 2011 19:39:56 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 72932 invoked by uid 99); 12 Dec 2011 19:39:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 19:39:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of steve.j.swift@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 19:39:47 +0000 Received: by wgbds11 with SMTP id ds11so9669023wgb.12 for ; Mon, 12 Dec 2011 11:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=OS5cXh0KWMCpRYESHGDa1ajnIeQxEGXvHq5OrLXuJkc=; b=GlyWKND3w0frvHjaJwnp/KxcfsQAaTekVWSlIK2f1SZHMhj6EpsFi453nrHZchepk8 qmQkKOkF1wS8d/5gO5X5tnlBsbFFkr4T6vBTsOMoWyrWJ3fupEQBxf9T6s6FX4geTRdN rx3gJTpmrfVnAIJW22jFVTSwBGO/ZT+7EEuYQ= Received: by 10.227.204.70 with SMTP id fl6mr14782323wbb.18.1323718763146; Mon, 12 Dec 2011 11:39:23 -0800 (PST) MIME-Version: 1.0 Sender: steve.j.swift@gmail.com Received: by 10.216.70.81 with HTTP; Mon, 12 Dec 2011 11:39:02 -0800 (PST) In-Reply-To: References: From: Steve Swift Date: Mon, 12 Dec 2011 19:39:02 +0000 X-Google-Sender-Auth: BjECE75Co3e6JPEjwGZPhQBYGP0 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=000e0cdf9c08a8ef9504b3ea4a7f X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] using htaccess on all hosts to block addresses --000e0cdf9c08a8ef9504b3ea4a7f Content-Type: text/plain; charset=ISO-8859-1 Presumably, it not whether you use htaccess, but whether you have it enabled. Once it is enables, apache has to follow the directory tree, just in case an htaccess file has turned up. I wonder if apache takes advantage of hosts which notify it when new/changed files appear in a directory tree that "interests" it? For example, Windows Media Player knows about new albums that I've downloaded a few seconds after I add them to my music collection. This way, it could skip looking for htaccess files until it knows where they are. On 12 December 2011 17:55, Tom Evans wrote: > On Mon, Dec 12, 2011 at 5:42 PM, Steve Swift > wrote: > > I think you'll have to put it in the documentroot of all of your > > virtualhosts. Since it would be so much easier to do this in the Apache > > config, I'll assume that you cannot do this for some reason. > > > > Second best would be to create the file in one documentroot, then use > hard > > links to place it in all of the other documentroots. > > > > No, when Apache is instructed to read .htaccess files (from an > appropriate AllowOverride section), it will walk up the directory tree > until it reach a directory that has AllowOverride None, or it reaches > the root. > > Therefore, if you have /srv/http/site1/htdocs and > /srv/http/site2/htdocs, and you place a htaccess at > /srv/http/.htaccess, and /srv/http/siteN/htdocs is allowed to have a > htaccess file, then the following htaccess files will be attempted to > be loaded: > > /srv/http/siteN/htdocs/.htaccess > /srv/http/siteN/.htaccess > /srv/http/.htaccess > /srv/.htaccess > > '/' is normally marked 'AllowOverride None' in the base conf file, so > that wouldn't normally be checked. > > As should be obvious, this is part of the reason why you are > discouraged from using .htaccess, it vastly inflates the work that > apache must do to serve a request. More info in the docs: > > http://httpd.apache.org/docs/2.2/howto/htaccess.html > > Cheers > > Tom > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project. > See for more info. > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > " from the digest: users-digest-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > -- Steve Swift http://www.swiftys.org.uk --000e0cdf9c08a8ef9504b3ea4a7f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Presumably, it not whether you use htacce= ss, but whether you have it enabled. Once it is enables, apache has to foll= ow the directory tree, just in case an htaccess file has turned up.<= div>
I wonder if apache takes advantage of hosts which notify it = when new/changed files appear in a directory tree that "interests"= ; it? For example, Windows Media Player knows about new albums that I'v= e downloaded a few seconds after I add them to my music collection. This wa= y, it could skip looking for htaccess files until it knows where they are.<= br>
On 12 December 2011 17:55, Tom Evans = <tevans.uk= @googlemail.com> wrote:
On Mon, Dec 12, 2011 at 5:42 PM, Steve Swift <Swifty@swiftys.org.uk> wrote:
> I think you'll have to put it in the documentroot of all of your > virtualhosts. Since it would be so much easier to do this in the Apach= e
> config, I'll assume that you cannot do this for some reason.
>
> Second best would be to create the file in one documentroot, then use = hard
> links to place it in all of the other documentroots.
>

No, when Apache is instructed to read .htaccess files (from an
appropriate AllowOverride section), it will walk up the directory tree
until it reach a directory that has AllowOverride None, or it reaches
the root.

Therefore, if you have /srv/http/site1/htdocs and
/srv/http/site2/htdocs, and you place a htaccess at
/srv/http/.htaccess, and /srv/http/siteN/htdocs is allowed to have a
htaccess file, then the following htaccess files will be attempted to
be loaded:

/srv/http/siteN/htdocs/.htaccess
/srv/http/siteN/.htaccess
/srv/http/.htaccess
/srv/.htaccess

'/' is normally marked 'AllowOverride None' in the base con= f file, so
that wouldn't normally be checked.

As should be obvious, this is part of the reason why you are
discouraged from using .htaccess, it vastly inflates the work that
apache must do to serve a request. More info in the docs:

http://httpd.apache.org/docs/2.2/howto/htaccess.html

Cheers

Tom

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




--
Steve Swift<= br>http://www.swiftys.org.uk
--000e0cdf9c08a8ef9504b3ea4a7f--