文章目录
一、解决启动nginx报[warn] 5052#0: the “user” directive makes sense only if the master process runs with super-user privileges, ignored in /opt/modules/nginx/conf/nginx.conf:1问题
[warn] 5052#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /opt/modules/nginx/conf/nginx.conf:1
二、解决方法
方法一:
1.进入nginx下的sbin目录下使用管理员权限启动
执行命令:sudo ./nginx
方法二:
1.进入nginx下的sbin目录下
2.执行下面以下命令
执行命令:chown root.root nginx
执行命令:chmod 755 nginx
执行命令:chmod u+s nginx
3.重启nginx即可
方法三:
1.进入nginx下的sbin目录下
2.执行下面以下命令
执行命令:chown root.www nginx
执行命令:chmod 750 nginx
执行命令:chmod u+s nginx
3.重启nginx即可
总结
提示:建议使用第二或者第三种方法,第一种是临时使用解决能启动nginx。当服务器重启后,nginx服务不会自启,没有达到满意的效果。