httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjm <...@porter.acadaff.appstate.edu>
Subject Re: [users@httpd] Nesting the Files section in httpd.conf
Date Tue, 13 May 2003 13:58:48 GMT
Here is where I thought it was possible to nest the Files section inside the 
directory section.  The missing leading slash was a dumb mistake, thanks for 
pointing it out!

"...Note that <Files> can be nested inside <Directory> sections to restrict the

portion of the filesystem they apply to."

	-- http://httpd.apache.org/docs-2.0/mod/core.html#files

I am now using this:

<Directory /var/www/html/sitename/maint/users/>
     AllowOverride AuthConfig
</Directory>

<Files /var/www/html/sitename/maint/users/protected.file>
     AuthType Basic
     AuthName "Protected File"
     AuthUserFile /path/to/.htpasswd
     Require user user_name
</Files>

and it doesn't work either.

Any suggestions?


William Wilson wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tuesday 13 May 2003 14:16, sjm wrote:
> 
>>I am looking for an example of the correct way to nest a Files section
>>inside a Directory section in the httpd.conf file.  I have searched through
>>the apache site and google and can't find one.  Here are the (I think)
>>relative sections of my httpd.conf (just in case I am using the Files
>>section properly and have something else messed up):
> 
> 
> 
> 
> OK, your mistake appears to be trying to nest incompatible block directives. 
> Don't nest the 'files' directive inside a 'directory' directive, simply 
> include it in your server config section. You'll probably need a leading 
> slash on your opening <Files (your path here)> directive.
> 
> To avoid this type of mistake in future you could read the apache 1.3 manual 
> (assuming you use 1.3; the 2.0 manual is available on line too) at 
> http://httpd.apache.org/docs . The entry 
> http://httpd.apache.org/docs/mod/core.html#files is particularly pertinent. 
> You'll see it contains a section 'context'. This tells you where you can use 
> a particular directive and will help you to avoid the <Files > mistake above.
> 
> 
> Hope this helps.
> 
> 
> 
> Will
> 
>  
> - -- 
> Will Wilson					
> 
> Applied Generics Ltd
> Pentlands Science Park
> Bush Loan, Penicuik
> Scotland, EH26 OPZ
> 
> william.wilson@appliedgenerics.com		
> Tel: +44 870 240 3694				
> Fax: +44 870 706 5818				
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE+wPT+NAhBZq2mRiYRAtcjAJ9ImN8sAKcs/EOB0gKm6CBTyCFFOACdEcPB
> pzGWxX1wV3cS1ETr4Vgonv0=
> =koYV
> -----END PGP SIGNATURE-----
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
/*-----------------------------*\
|                               |
|    Steve McKinney             |
|    ARDI - Web Programmer      |
|    sjm@porter.appstate.edu    |
|    (828) 262-6553             |
|                               |
\*-----------------------------*/


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message