500 internal server error on visiting encrypted path
I use .htaccess to encrypt “www.actinia.me/test”
the .htaccess file is:
AuthUserFile /home/.htpasswd
AuthName “ceshiyonghu”
AuthType Basic
Require user ceshiyonghu
but when I visited the url, I got a 500 internal server error. I checked the error log (/var/log/apache2/error.log) and find the “AuthUserFile not allowed here” record.
To solve this, I added this:
<Directory /var/www/test/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo Indexes Authconfig
</Directory>
to apache config file (/etc/apache2/apache2.conf),
and executed:
sudo a2enmod rewrite
sudo service apache2 restart
Now I can visit my test folder!