gpt4 book ai didi

apache - 如何确定Apache以什么用户和组身份运行?

转载 作者:行者123 更新时间:2023-12-04 13:29:24 25 4
gpt4 key购买 nike

在DreamHost共享主机上,我正在设置htpasswd,但是Apache没有读取该文件的权限。我如何授予它许可?我想更改.htpasswd文件的所有者或组,而不是给予它不安全的权限。我认为我无权访问httpd.conf文件,因此无法将此方法用于find what user Apache runs as。另外,运行topps aux仅显示我正在运行的进程,但不显示apache进程。

根据cat /etc/passwdcat /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文件,尽管有警告。

最佳答案

实际上,您不需要访问httpd.conf:

ps aux | grep apache2
groups apache_user

应该产生你想要的

关于apache - 如何确定Apache以什么用户和组身份运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4317156/

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