| Tips: Running a Webserver |
|---|
Apache
Apache is the most popular software for serving web pages. It is
distributed under an open source license.
protecting a web directory
If you want to protect a directory on a webserver by making it necessary
to provide a password to access it, you need to do the following:
Create .htaccess in the directory you want to protect and
include this information:
AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthName [something to identify this directory]
AuthType Basic
<Limit GET>
require valid-user
</Limit>
Then create the file .htpasswd. This should not be in the actual directory.
htpasswd -c /path/to/.htpasswd [username]
This will prompt you for a password.
To add users, simply remove the '-c' option
[ return to main tips page ]
|