nginx: [emerg] getpwnam(“www”) failed

简介: 在配置nginx 时提示如下错误时:nginx: [emerg] getpwnam(“www”) failed解决方案一在nginx.conf中 把user nobody的注释去掉既可解决方案二错误的原因是没有创建www这个用户,应该在服务器系统中添加www用户组和用户www,如下命令:...

在配置nginx 时提示如下错误时:
nginx: [emerg] getpwnam(“www”) failed

解决方案一

在nginx.conf中 把user nobody的注释去掉既可

解决方案二

错误的原因是没有创建www这个用户,应该在服务器系统中添加www用户组和用户www,如下命令:

1
2
/usr/sbin/groupadd -f www
/usr/sbin/useradd -g www www

以上方法测试通过,启动后,在浏览器里输入IP,即可查看到:
Welcome to nginx!的欢迎界面

若转载请注明出处!若有疑问,请回复交流!
目录
相关文章
|
8月前
|
应用服务中间件 nginx
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
164 2
|
1天前
|
应用服务中间件 nginx Windows
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
|
1天前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
237 0
|
8月前
|
应用服务中间件 nginx
Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)
Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)
211 1
|
1天前
|
存储 应用服务中间件 nginx
【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
【1月更文挑战第13天】【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
|
1天前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
7月前
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
137 0
|
8月前
|
应用服务中间件 nginx
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
148 0
|
8月前
|
应用服务中间件 nginx
通过nginx访问连接websocket 错误 failed: Error during WebSocket handshake: Unexpected response code: 400
通过nginx访问连接websocket 错误 failed: Error during WebSocket handshake: Unexpected response code: 400
242 0
|
9月前
|
应用服务中间件 nginx
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
180 0

热门文章

最新文章