Linux apache用户不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5356167/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 03:19:25  来源:igfitidea点击:

apache user does not exist

linuxapache

提问by tecman

I'm trying to run the command, chown -R apache:apache xyz But I'm getting error, chown: apache:apache': invalid user

我正在尝试运行命令 chown -R apache:apache xyz 但出现错误,chown: apache:apache': invalid user

Then I tried for the user www-data, but with same results.

然后我尝试了用户 www-data,但结果相同。

Then I tried to check who owns the apache process by running, ps -Af |grep httpd. I get the following,

然后我尝试通过运行来检查谁拥有 apache 进程,ps -Af |grep httpd. 我得到以下信息,

root     29577     1  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29754 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29756 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29757 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29758 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29759 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
nobody   29760 29577  0 18:00 ?        00:00:00 /opt/lampp/bin/httpd -k start -DSSL -DPHP5
root     29785 29358  0 18:04 pts/0    00:00:00 grep httpd

So, where is the apache user?

那么,apache用户在哪里?

Thanks.

谢谢。

采纳答案by MTilsted

Your apache runs as the user called "nobody" (Yes nobody is a username).

您的 apache 以名为“nobody”的用户身份运行(是的 nobody 是用户名)。

I have newer seen a linux where the apache user were called apache but you can configure the name in the apache config. Which linux version are you using?

我最近看到一个 linux,其中 apache 用户被称为 apache,但您可以在 apache 配置中配置名称。您使用的是哪个 linux 版本?

回答by huntsfromshadow

Not all linux servers use apache and group apache. It looks like the server is running the process as nobody.

并非所有 linux 服务器都使用 apache 和 group apache。看起来服务器正在以无人身份运行该进程。

Are you root on the server? If so you can look in the /etc/groups file to see what groups are defined.

你是服务器上的root吗?如果是这样,您可以查看 /etc/groups 文件以查看定义了哪些组。

回答by MNeimeier

look in the configuration for apache - httpd.conf. The following lines should give you the needed informations.

查看 apache 的配置 - httpd.conf。以下几行应该为您提供所需的信息。

For the user do:

为用户做:

find / -name httpd.conf | xargs grep -i "^user"

and for the group do:

并为小组做:

find / -name httpd.conf | xargs grep -i "^group" 

-Martin

-马丁

回答by Alex

I've got the same problem when triyng to make the chroot with only some libraries. When I tried to su the same message was happened:

我在尝试仅使用一些库制作 chroot 时遇到了同样的问题。当我尝试 su 时,发生了相同的消息:

su: user xxxxxdoes not exist

Seems not all libraries was copied to the chroot subdirectory, so you can try to copy all if you've prepared the chroot dir

似乎并不是所有的库都被复制到了 chroot 子目录,所以如果你已经准备好了 chroot 目录,你可以尝试复制所有

cp --parent -avR /usr/lib64 /CHROOT_DIR
cp --parent -avR /usr/lib /CHROOT_DIR
ln -s /CHROOT_DIR/usr/lib64 /CHROOT_DIR/lib64
ln -s /CHROOT_DIR/usr/lib64 /CHROOT_DIR/lib64

回答by Paranoid

the user called "www-data" in apache2

用户在 apache2 中称为“www-data”