nginx bind() to 0.0.0.0:**** failed (13: Permission denied)

nginx 启动失败,日志里面报错信息如下:

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:**** failed (13: Permission denied)

原因seLinux限制了http的端口

getenforce   这个命令可以查看当前是否开启了selinux 如果输出 disabled 或 permissive 那就是关闭了

如果输出 enforcing 那就是开启了 selinux

1、临时关闭selinux

setenforce 0    ##设置SELinux 成为permissive模式

setenforce 1    ##设置SELinux 成为enforcing模式

2、永久关闭selinux,

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

扫描二维码关注公众号,回复: 3717133 查看本文章

重启机器即可

猜你喜欢

转载自www.cnblogs.com/shengulong/p/9848070.html