Mailing List Archive

Apache looks for .htaccess
Can I suggest the following be added to access.conf-dist:

----
#This stops apache looking for .htaccess files in directories above
#your document root. Comment this out only if you want apache to
#look for /.htaccess, /usr/.htaccess, /usr/local/.htaccess etc.
<Directory />
AllowOverride None
</Directory>
----

For people with with documentroot below an automount point, the
performance penalty for checking for the .htaccess files is severe;
up to 1/2 second if you use NIS+.

David.

>Article 3098 (53 more) in comp.infosystems.www.servers.unix:
>From: Barry Cornelius <Barry.Cornelius@durham.ac.uk>
>Subject: Telling NCSA httpd not to look for .htaccess file
>Date: Thu, 10 Aug 1995 17:21:41 +0100
>
>We use Version 1.4 of the NCSA http server on Solaris 2.3 (soon to be
>Solaris 2.4). If the URL:
> http://www.dur.ac.uk/~username/
>is accessed, the ~username part is translated into:
> /home/machinename/groupname/username
>Whilst processing the URL, the server looks for the files:
> /.htaccess
> /home/.htaccess
> /home/machinename/.htaccess
> /home/machinename/groupname/.htaccess
> /home/machinename/groupname/username/.htaccess
>The attempt to access the entry /home/.htaccess triggers an error message
>from the automounter which looks like:
> Aug 10 14:32:22 hercules automountd[145]: server .htaccess not responding
>
>I want to be able to configure the server so as not to look in /home for
>the .htaccess file. We are using the distributed version of the
>access.conf file. It seems that if I add the lines:
> <Directory /home>
> AllowOverride None
> Options None
> </Directory>
>the problem goes away. BTW, I don't really understand these lines.
>Are these lines right? Will they have any effect that I'm not expecting?
>Do I need both the AllowOverride and the Options lines?
>
>If I make this change, then it would seem sensible to add similar lines
>for the directories /, /home/machinename and /home/machinename/groupname.
Re: Apache looks for .htaccess [ In reply to ]
>>>>> "David" == David Robinson <drtr@ast.cam.ac.uk> writes:

David> Can I suggest the following be added to access.conf-dist:
David> ----
David> #This stops apache looking for .htaccess files in directories above
David> #your document root. Comment this out only if you want apache to
David> #look for /.htaccess, /usr/.htaccess, /usr/local/.htaccess etc.
David> <Directory />
David> AllowOverride None
David> </Directory>
David> ----

Note that this will disable AllowOverride for the UserDir directories.

That is to say that the DocumentRoot <Directory> configs do not affect
the UserDir directories (unless, I suppose, DocumentRoot were a parent
of the users home directories... :).

ObInfo: 0.8.8 and 0.8.9.

-JimC
--
James H. Cloos, Jr. Snail: POBox 18122 Austin, TX 78760-8122 Usenix,SAGE
cloos@io.com URL: http://www.jhcloos.com/~cloos/ LPF
Re: Apache looks for .htaccess [ In reply to ]
>Date: Thu, 17 Aug 1995 05:33:18 -0500
>From: "James H. Cloos Jr." <cloos@io.com>
>
>David> Can I suggest the following be added to access.conf-dist:
>David> ----
>David> #This stops apache looking for .htaccess files in directories above
>David> #your document root. Comment this out only if you want apache to
>David> #look for /.htaccess, /usr/.htaccess, /usr/local/.htaccess etc.
>David> <Directory />
>David> AllowOverride None
>David> </Directory>
>David> ----
>
>Note that this will disable AllowOverride for the UserDir directories.
>
>That is to say that the DocumentRoot <Directory> configs do not affect
>the UserDir directories (unless, I suppose, DocumentRoot were a parent
>of the users home directories... :).

Well, if you are not setting the AllowOverride explicitly for your
UserDir, then the default should probably be None. As the default
AllowOverride was never documented, I don't think this is a problem.

David.