【发布时间】:2011-05-18 01:25:03
【问题描述】:
在 DreamHost 共享主机上,我正在设置 htpasswd,但 Apache 没有读取文件的权限。我如何授予它权限?我想更改 .htpasswd 文件的所有者或组,而不是给它不安全的权限。我不认为我可以访问httpd.conf 文件,所以我无法使用此方法来find what user Apache runs as。另外,运行top 或ps aux 只显示我正在运行的进程,但不显示apache 进程。
根据cat /etc/passwd 和cat /etc/group 的输出,我猜是www-data。
好吧,我按照Password-protecting directories on Dreamhost 的说明进行操作。它生成了一个包含.htpasswd 文件的目录,该文件的组为dhapache,权限为440。它还在我的组下放了一个.htaccess 文件。出于某种原因,当我尝试chgrp dhapache test_file.txt 时,我得到chgrp: changing group of 'test_file.txt': Operation not permitted。所以,我只是将 DreamHost 生成的 .htpasswd 文件移到了我想要的位置,并编辑了它生成的 .htaccess 文件,尽管它有警告。
【问题讨论】:
-
是的,通常是“www-data:www-data”
标签: apache .htaccess permissions dreamhost .htpasswd