创建www用户
复制代码 代码如下:
[root@localhost nginx-1.9.7]# useradd -s /sbin/nologin -M www
查看nginx进程 PID已经更改
复制代码 代码如下:
[root@localhost sbin]# ps -ef |grep nginx
root 3814 1 0 16:23 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 3815 3814 0 16:23 ? 00:00:00 nginx: worker process
nobody 3816 3814 0 16:23 ? 00:00:00 nginx: worker process
修改nginx.conf配置文件,更改用户和用户组为www用户,保存退出,重启nginx服务;
复制代码 代码如下:
[root@localhost conf]# ps -ef |grep nginx
root 3814 1 0 16:23 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www 4200 3814 0 16:48 ? 00:00:00 nginx: worker process
www 4201 3814 0 16:48 ? 00:00:00 nginx: worker process
Nginx1.8.0版本平滑升级新版本1.9.7就给大家介绍到这里,希望对大家有所帮助!