Linux下启动nginx服务时报错[emerg]: getpwnam(“nginx”) failed

[root@server1 ~]# /usr/local/nginx/sbin/nginx 
nginx: [emerg] getpwnam("nginx") failed

 

没有安装nginx用户导致的无法启动

[root@server1 ~]# useradd nginx
[root@server1 ~]# id nginx
uid=500(nginx) gid=500(nginx) groups=500(nginx)

 

[root@server1 ~]# /usr/local/nginx/sbin/nginx
[root@server1 nginx-1.14.0]# netstat -antulpe | grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      0          14907      3737/nginx    

你可能感兴趣的:(Linux下启动nginx服务时报错[emerg]: getpwnam(“nginx”) failed)