apache config for pw protected web pages.

Dan Coutu coutu at snowy-owl.com
Fri Oct 10 20:37:46 EDT 2003


> Hello all,
> 
> Problem: Trying to get the contents of a specific location (e.g.
> www.domain.com/semiprivate) to be password protected. I have set the
> .htpassword file in the "semiprivate" directory.
> I have added the following:
> <Directory /var/www/html/domain/semiprivate>
> 	AllowOverride Options
> </Directory>
> 
> Now I am confused and have some mixed information. Should I..
> 
> a. go to the .htaccess file in the /var/www/html/domain/semiprivate and add
> the following:
> 
> AuthType Basic
> AuthName "My secret pages"
> AuthUserFile /path/to/directory/.htpassword
> require valid-user
> order deny,allow
> allow from all
> 
> if so, where? Just drop em in any ole place?
> 
> --OR--
> 
> b. Edit the apache directives for the virtual host and add previous among
> ServerAlias, DomainRoot and the like.
> 

It depends on how you like to maintain your systems. You could go either
way. If you like having your settings close to your files then put it
in the .htpasswd file. If you like your settings all in one place then
put it in the httpd.conf.

Dan




More information about the gnhlug-discuss mailing list