gpt4 book ai didi

apache - 使用 .htaccess 和 .htpasswd 密码保护网站 - 错误 - "Could not open password file:"

转载 作者:行者123 更新时间:2023-12-05 01:46:20 27 4
gpt4 key购买 nike

我们通过 Charter 的虚拟主机拥有 Plesk 站点构建器。用它来创建一个简单的开发网站。

我正在尝试使用 .htaccess/.htpasswd 密码保护网站。

无论我做什么,我都会不断收到此错误:

[Wed Apr 06 09:02:57 2016] [error] [client 66.169.84.65] (2)No such file or directory: Could not open password file: /.htpasswd
[Wed Apr 06 09:02:57 2016] [error] [client 66.169.84.65] access to / failed, reason: verification of user id 'heather' not configured
[Wed Apr 06 09:03:52 2016] [error] [client 66.169.84.65] (2)No such file or directory: Could not open password file: /etc/httpd/.htpasswd
[Wed Apr 06 09:03:52 2016] [error] [client 66.169.84.65] access to / failed, reason: verification of user id 'admin' not configured
[Wed Apr 06 09:03:56 2016] [error] [client 66.169.84.65] (2)No such file or directory: Could not open password file: /etc/httpd/.htpasswd
[Wed Apr 06 09:03:56 2016] [error] [client 66.169.84.65] access to / failed, reason: verification of user id 'heather' not configured
[Wed Apr 06 09:05:11 2016] [error] [client 66.169.84.65] (2)No such file or directory: Could not open password file: /etc/httpd/HTTP/.htpasswd
[Wed Apr 06 09:05:11 2016] [error] [client 66.169.84.65] access to / failed, reason: verification of user id 'admin' not configured
[Wed Apr 06 09:05:15 2016] [error] [client 66.169.84.65] (2)No such file or directory: Could not open password file: /etc/httpd/HTTP/.htpasswd
[Wed Apr 06 09:05:15 2016] [error] [client 66.169.84.65] access to / failed, reason: verification of user id 'heather' not configured

我对 Parallels Plesk 不是很熟悉 - 获得他们的支持就像拔牙一样。

  • 我已经检查并仔细检查了 .htpasswd 文件的路径;似乎是对的。
  • 我已经移动了它和 .htaccess 文件,看看我是否只是没有放在正确的地方

我不确定是什么问题。我收到了身份验证框(我注意到它没有我的“请登录”消息......

enter image description here

这里是 .htaccess 文件的代码:

#
# AUTHENTICATION
#
### BASIC PASSWORD PROTECTION
AuthUserFile /etc/httpd/HTTP/.htpasswd
AuthName "Please Login"
AuthType basic

<Limit GET POST>
Require valid-user
</Limit>

非常感谢任何帮助或引导正确的方向。提前致谢!!

最佳答案

只需通过命令生成/etc/httpd/HTTP/.htpasswd文件:

# htpasswd /etc/httpd/HTTP/.htpasswd UserNameYouWant

它要求您输入密码并使用用户 UserNameYouWant 生成密码文件

关于apache - 使用 .htaccess 和 .htpasswd 密码保护网站 - 错误 - "Could not open password file:",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36452339/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com