Apache password protected directory July 26, 2007
Posted by unixgeek in Linux Server Setup.trackback
1. cd /var/www/html/soft
2. vi .htaccess
AuthUserFile /var/www/html/soft/.htpasswd
AuthGroupFile /dev/null
AuthName “Company Private Directory“
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>
3. cd /var/www/html/soft
htpasswd -c .htpasswd support
4. vi /etc/httpd/conf/httpd.conf
Scroll down the file and make sure the AllowOverride option is set to All
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All