.htaccess/.htpasswd 500 Internal Server Error

后端 未结 6 1063
暗喜
暗喜 2020-12-13 17:14

I\'m working on blocking a folder with .htaccess, which I\'ve never used before, and I\'m having some trouble. Here\'s what I have

.htaccess (located in the folder I

6条回答
  •  伪装坚强ぢ
    2020-12-13 17:47

    Had the same problem, it had to do with access! Have you given ownership of the password file to www-data user through

    chown www-data /var/www/.htpasswd
    chmod 640 /var/www/.htpasswd
    

    ? It's best to keep the password, for obvious reasons, to keep the password somewhere outside the /var/www/ directory, let's say /home/MYSERVER/ in such a case you also need to give ownership of this parent directory to the user www-data.

提交回复
热议问题