public html 外的 htpasswd 无法访问

htpasswd outsite the public html not accessible

在我使用的网络服务器上,我有多个站点(子域)。其中一些有一个管理文件夹,用于快速编辑每个站点。在管理文件夹中,我放置了一个 .htaccess 文件,限制对其的访问。

我在 public_html 文件夹外放置了一个 htpasswd 文件(因为这是我阅读的内容,我应该这样做),每个密码文件都在一个新目录中。

到目前为止我的 folder/file 结构:

/server/public_html/domain.com
/server/public_html/domain.com/admin/.htaccess
/server/domain_password/.htpasswd

admin 文件夹中 .htaccess 文件的内容:

#Block_External_Access
AuthType Basic
AuthName 'My Protected Area'
AuthUserFile /server/domain_password/.htpasswd
Require valid-user

问题是,在这种情况下,我遇到了一个严重的 500 服务器错误。看起来它毕竟无法读取密码文件。如果我将我的 htpasswd 移到域文件夹或管理文件夹,并相应地更新 htaccess 文件,它就可以工作了。

是否有任何设置禁止我的预期行为,或者我遗漏了其他东西?

显然,因为文件夹的创建是自动的,所以它给了文件夹 600 的权限。这是一个错误的决定。 :D