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
.htaccess
Create the password file
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
Leave A Reply
- 2 Replies
Replies
March 4th 2002 -
No shit. You didn't know that? :P
March 5th 2002 -
No I knew that... I just put a lot of code examples here for later. So if I ever need to reference how I did it, it's just a quick search away.