Here is a simple working example :
 
If you publish your pages in the directory
/path/to/upper/directory/mtrgpages/
 
Then create a file in this directiry, called
.htaccess
(On my server, its mod is rwx-r--r--)
The contents is the following :
 
AuthUserFile /etc/htpasswd
AuthGroupFile /etc/htgroup
AuthName "Network monitoring"
AuthType Basic
 
<Limit GET POST PUT>
require group sysadm
</Limit>
 
 
Now, here is the file /etc/htpasswd
steve:/WLaTQWOlToCU
chris:FDezEZRfsds
 
And here is the file /etc/htgroup
sysadm: steve
 
 
Now, close your browser, reopen it and go to the mtrg pages : you're asked
for a password.
Type in steve as username and toto as password.
Normally, you can enter in the pages.
 
The password is crypted in the file htpasswd the same way as the unix
password (the one that you have in /etc/shadow), so you can copy the crypted
password you have in /etc/shadow and paste them in htpasswd if you want to
put a password in an easy way.
 
 
If you're not asked for a password, edit the Apache config file httpd.conf,
and add the lines
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
 
Kill and restart your apache server.
 
Regards
 
Mathieu

-----Original Message-----
From: Patrick Putteman [mailto:[EMAIL PROTECTED]]
Sent: 07 October 1999 19:12
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [expert] Password on entering a webpage using Apage Server


Hello All,
 
Got another question:
 
I use my linuxbox at the office for monitoring and accounting of the
bandwith/uptime of our servers, with automatic generation of HTML pages
(mrtg and netsaint are 2 of the apps I use). Of course, this info is kind of
confidential and therefor I would like to have to enter a password upon
entering the confidential parts of the server.
How do I configure Apache so that it asks a password upon browsing to
certain files/dirs? 
I had a look at the apache docs, but they're not entirely clear on this. 
 
Thx,
 
Patrick Putteman
Internet Support Manager
Net7 - Member of the Advalvas Group

Reply via email to