htaccess 和htpasswd 未正确连接

发布于 2024-09-27 04:44:06 字数 1639 浏览 1 评论 0原文

每次我尝试去艺术学校主页 并输入正确的用户名/密码 我收到服务器错误。是的,这是家庭作业,是的,这是我第一次做与此类设置相关的任何事情,因此我们将不胜感激。我发现的所有各种说明都将其列为正确的方法,所以我有点卡住了。

.htpasswd 文件(/afs/asu.edu/users/r/l/p/rlpeck/pwd/.htpasswd):.htaccess

Alice:$apr1$sgDEa/..$FBtlSGHkbPHmlW80Sj2Sx1
Bob:$apr1$V8LLa/..$iX.YVKHoDfKyTKEMvuX.g/
Chris:$apr1$XuHOa/..$o6bf/JyA1otkH0jor4n5c/
Dave:$apr1$hpjQa/..$u3/D.f0xdN23Flg35qp9g.
Eve:$apr1$JIGSa/..$uTs55qYH1.gtDV7WZ0X7q0

文件(/afs/asu.edu/users/ r/l/p/rlpeck/www/CSE465a):

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /afs/asu.edu/users/r/l/p/rlpeck/pwd/.htpasswd
AuthGroupFile /dev/null
Require valid-user

服务器错误

当我运行 locate -r error.log 我得到的都是这些:

/opt/tivoli/tsm/client/ba/bin/dsmerror.log
/usr/share/doc/cups-1.2.4/de/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/es/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/help/ref-error_log.html
/usr/share/doc/cups-1.2.4/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/ja/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/pl/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/sv/images/button-view-error-log.gif
/var/log/cups/error_log
/var/log/cups/error_log.1
/var/log/cups/error_log.2

编辑:来自帮助台的响应:

如果您正在测试页面的安全性,那么您就通过了。我没有看到错误

Every time I try to go to Art School on Home Page and put it the correct username/password I get a server error. Yes this is homework, and yes it is my first time doing anything related to this type of setup so any help would be appreciated. All the various instructions that I found listed this as the correct way so I'm sort of stuck.

.htpasswd file(/afs/asu.edu/users/r/l/p/rlpeck/pwd/.htpasswd):

Alice:$apr1$sgDEa/..$FBtlSGHkbPHmlW80Sj2Sx1
Bob:$apr1$V8LLa/..$iX.YVKHoDfKyTKEMvuX.g/
Chris:$apr1$XuHOa/..$o6bf/JyA1otkH0jor4n5c/
Dave:$apr1$hpjQa/..$u3/D.f0xdN23Flg35qp9g.
Eve:$apr1$JIGSa/..$uTs55qYH1.gtDV7WZ0X7q0

.htaccess file(/afs/asu.edu/users/r/l/p/rlpeck/www/CSE465a):

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /afs/asu.edu/users/r/l/p/rlpeck/pwd/.htpasswd
AuthGroupFile /dev/null
Require valid-user

Server Error

When I do run locate -r error.log all I get are these:

/opt/tivoli/tsm/client/ba/bin/dsmerror.log
/usr/share/doc/cups-1.2.4/de/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/es/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/help/ref-error_log.html
/usr/share/doc/cups-1.2.4/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/ja/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/pl/images/button-view-error-log.gif
/usr/share/doc/cups-1.2.4/sv/images/button-view-error-log.gif
/var/log/cups/error_log
/var/log/cups/error_log.1
/var/log/cups/error_log.2

Edit: Response from help desk:

If you were testing the security of your page, you passed. I dont see an error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜血缘 2024-10-04 04:44:06
  • .htaccess 文件是否使用 UNIX 行结尾保存在服务器上?如果您将其保存在 Windows 计算机上,这可能是一个问题。如果您使用FTP,则可以以ASCII 模式传输。否则,请使用 Notepad++ 等优秀的文本编辑器 (http://notepad-plus-plus.org/ )并在“编辑”→“EOL 转换”→“UNIX 格式”下设置 UNIX 格式。

  • AuthUserFile 路径名是否正确?它应该是 Web 服务器计算机看到的路径名,这可能不是您看到的路径名。当您运行locate命令时,您可能登录到了与Web服务器不同的服务器; AFS 网络文件系统允许两台服务器查看您的文件,但不一定位于两台服务器上的同一路径。

  • 网络服务器是否有权限读取.htpasswd 文件?尝试将其放在与 .htaccess 文件相同的目录中,并相应地更新 .htaccess 中的路径名。当然,服务器是否会阻止某人以这种方式查看有效密码列表取决于服务器配置,因此您可能需要弄清楚需要使用哪些 AFS 命令来授予此类权限。

  • Is the .htaccess file being saved on the server using UNIX line endings? If you are saving it on a Windows computer, that is likely a problem. If you use FTP, you can transfer in ASCII mode. Otherwise, get a good text editor like Notepad++ (http://notepad-plus-plus.org/) and set UNIX format under Edit → EOL Conversion → UNIX Format.

  • Is the AuthUserFile pathname correct? It should be the pathname that the web server computer sees, which might not be the pathname you see. You were probably logged in to a different server than the web server when you ran the locate command; the AFS network filesystem allows both servers to see your files but not necessarily at the same path on both.

  • Does the web server have permission to read the .htpasswd file? Try putting it in the same directory as the .htaccess file and update the pathname in .htaccess accordingly. Of course, it depends on the server configuration whether or not the server will prevent someone from looking at the list of valid passwords that way, so you may need to figure out what AFS commands you need to use to grant such permission.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文