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!的欢迎界面

若转载请注明出处!若有疑问,请回复交流!
目录
相关文章
|
10月前
|
应用服务中间件 网络安全 nginx
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
1575 0
|
应用服务中间件 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 ...
340 2
|
7月前
|
存储 应用服务中间件 nginx
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
这篇文章详细介绍了Linux虚拟机磁盘空间不足时的扩容流程,从外部配置到具体扩容操作,再到验证扩容效果的步骤。同时,也探讨了Docker容器磁盘空间耗尽的问题,并提供了解决方案,包括删除无用镜像和容器,以及如何重新配置Docker的存储位置。文章还涵盖了一些意外情况的处理方法,比如误删容器后的恢复策略,并最终展示了使用Docker安装nginx并成功访问的详细过程。
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
|
应用服务中间件 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)
513 1
|
10月前
|
应用服务中间件 nginx Windows
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
359 0
|
10月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
1849 0
|
10月前
|
存储 应用服务中间件 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)
|
10月前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
10月前
|
应用服务中间件 nginx
Nginx启动时提示nginx: [emerg] still could not bind()
Nginx启动时提示nginx: [emerg] still could not bind()
775 0
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
438 0