Apache User Restrictions

Just had to restrict a directory with a username and password on one of the Apache servers we run. A couple config changes and a quick command and you're done. Here's the quick and dirty version.

httpd.conf
AccessFileName .htaccess

<Directory "/www/htdocs/">
	AllowOverride AuthConfig
</Directory>

.htaccess
AuthName "Server Access"
AuthType Basic
AuthUserFile /www/htdocs/htpasswd.users
require valid-user

Create the password file
htpasswd -m /www/htdocs/htpasswd.users user
All content licensed under the Creative Commons License