Protect Apache Alias with htaccess
Post # 115 permalink Topic #115 by mreschke on 2008-10-21 22:33:45 (viewed 912 times)

How to password protect a apache alias

Apache Alias Config[-][- -][++]

Code Snippet
Alias /seagate750/ "/mnt/seagate750/"
<Directory "/mnt/seagate750">
  AllowOverride All
  Options Indexes MultiViews
  Allow from all
</Directory>

Note, must goto http://server/seagate750/ (Must have that last /)

htaccess[-][- -][++]

make /mnt/seagate750/.htaccess

Code Snippet
AuthType Basic
AuthName "Password"
AuthUserFile /mnt/seagate750/.htpasswd
require valid-user

htpasswd[-][- -][++]

make /mnt/seagate750/.htpasswd

Code Snippet
mreschke:blahblahblah

replace that with the correct password, you can find a apache password generator online, just enter mreschke as the user

permissions[-][- -][++]

Make sure the .ht* files have correct permissions for your apache user. (rwx for user)