本文摘自:https://blog.csdn.net/RunSnail2018/article/details/81185138
系统启动Nginx后,报 [emerg] bind() to 0.0.0.0:XXXX failed (13: Permission denied)错误的处理方式,分为两种:
[emerg] bind() to 0.0.0.0:1883 failed (13: Permission denied)
原因是1024以下端口启动时需要root权限,所以sudo nginx即可。
[emerg] bind() to 0.0.0.0:8380 failed (13: Permission denied)
这种情况,需要如下操作:
首先,查看http允许访问的端口:
semanage port -l | grep http_port_t
http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000
其次,将要启动的端口加入到如上端口列表中
semanage port -a -t http_port_t -p tcp 1883
如此即可解决如上问题。
yum -y install policycoreutils-python.x86_64
然后停止nginx服务
systemctl stop nginx
指定配置文件
nginx -c /etc/nginx/nginx.conf
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:Nginx 启动报 [emerg] bind() to 0.0.0.0:XXXX failed (13: Permission denied)错误处理