启动nginx报错,提示没有权限,但是又不知道root密码的时候,可以sudo授权执行启动。
报错信息如下:
[***@web-node ~]$ ./nginx -t
nginx: the configuration file /usr/local/src/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: configuration file /usr/local/src/nginx/conf/nginx.conf test failed
[***@web-node ~]$ ./sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
启动方式如下:
[bdjkredis@bdjk sbin]$ sudo ./nginx
[bdjkredis@bdjk sbin]$ sudo ./nginx -t
nginx: the configuration file /usr/local/src/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/src/nginx/conf/nginx.conf test is successful
备注:
1、我的nginx启动文件在/usr/local/src/nginx/sbin
2、nginx -t 查看配置文件是否正确