Question
.htaccess on LAMP 14.04?
Trying to lock down www/html/ using .htaccess on a LAMP 14.04 deployment, and having a tough time. Documentation is all over the place without a clear answer.
Tried updating 000-default.conf
Tried updating .htaccess to point to .htpasswd
Did lots of restarts of apache2
Nothing worked.
Suggestions?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I don’t know if you still need this but…
I had problems with this as well. First make sure you have a new droplet with the LAMP template.
The solution:
/var/www/html
directorychmod -R 777 /var/www/html
cat /var/www/html/.htaccess
sudo a2enmod rewrite
sudo service apache2 restart
You should also:
<Directory /var/www/>...</directory>
in/etc/apache2/apache2.conf
AllowOverride None
toAllowOverride ALL
sudo service apache2 restart
Thank you. It worked for me :)