D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] htaccess - very basic question



On Wed, Dec 12, 2001 at 10:13:26AM +0000, Paul Hewson wrote:

> Hope no-one minds, but I wondered if there was a quick answer to the 
> following:
> 
> (Politely) where do I put:
> 
> AuthName "My access authfile"
> AuthType Basic
> AuthUserFile /www/username.uklinux.net/.htusers
> 
> require valid-user
> 
> if I want to semi-secure part of a website?
> 
> I have a .htaccess giving user name / password combinations.

I presume you mean .htusers here.

You really do have to have that password file outside the web site, so
it can't be downloaded. I'm not sure how that thing works, but it
looks like you've got it in there.

But anyway ... here's one I prepared earlier:

www
www/index.html
www/jobs
www/jobs/index.html
www/jobs/why.html
www/services
www/services/index.html
www/services/agent
www/images
www/images/logo.png
www/images/icons.gif
www/images/icons.gif/previous_motif_gr.gif
www/images/icons.gif/up_motif_gr.gif
www/images/icons.gif/next_motif_gr.gif
www/admin
www/admin/index.html
www/admin/.htaccess
www/staff
www/staff/.htaccess
www/staff/index.html
www/about
www/about/index.html
www/about/people.html
www/about/contacts.html
www/about/duncan.html
www/about/nicholas.html
www/about/frank.html
www/news.html
www/robots.txt


Both /staff and /admin are secure. This partcular site uses cgi-bin, so
I have to put the .htaccess files in the subdirectories there too.

www/staff/.htaccess

AuthUserFile /home/paraso/etc/htpasswd
AuthGroupFile /home/paraso/etc/htgroup
AuthName Parasol
AuthType Basic

require valid-user
require group staff



www/admin/.htaccess

AuthUserFile /home/paraso/etc/htpasswd
AuthGroupFile /home/paraso/etc/htgroup
AuthName Admin
AuthType Basic

require valid-user
require group admin

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly