ber*_*436 31 linux nginx web-server
我将nginx.conf示例复制到我的 ubuntu 12.04 盒子上(我不知道将其他 conf 文件放在哪里。我是 nginx noob)。当我尝试启动 nginx 时,出现以下错误:
abe-lens-laptop@abe:/etc$ sudo service nginx start
Starting nginx: nginx: [emerg] getpwnam("www") failed in /etc/nginx/nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)
这个错误是什么意思?我该如何解决?我找到了这篇文章,但我的用户已经设置为 www www(如果您在链接文件中看到)如何更改 NGINX 用户?
小智 11
您的另一个选择(如果您不想创建新用户)是将 nginx.conf 中的用户字段替换为:
user nobody;
Run Code Online (Sandbox Code Playgroud)
创建www
用户。在 Ubuntu 上,这应该使用以下命令和标志来完成:
sudo adduser --system --no-create-home --shell /bin/false --group --disabled-login www
Run Code Online (Sandbox Code Playgroud)