docker启动时出现open() “/usr/local/openresty/nginx/conf/nginx.conf“ failed (13: Permission denied)
运行一下命令启动dockerdocker start b2c发现启动失败, docker logs b2c看日志,发现下面错误:2020/07/03 16:03:06 [emerg] 1#1: open() "/usr/local/openresty/nginx/conf/nginx.conf" failed (13: Permission denied)可是看nginx.conf的权限, 所有人
·
运行一下命令启动docker
docker start b2c
发现启动失败, docker logs b2c看日志,发现下面错误:
2020/07/03 16:03:06 [emerg] 1#1: open() "/usr/local/openresty/nginx/conf/nginx.conf" failed (13: Permission denied)
可是看nginx.conf的权限, 所有人都有读权限啊:
[root@anti-03 config]# ls -l
total 20
-rw-rw-rw-. 1 root root 6450 Jul 3 15:59 nginx.conf
-rw-r--r--. 1 root root 4483 Nov 2 2019 nginx.conf.all_proxy
-rwxr-xr-x. 1 root root 266 Nov 2 2019 switch_conf.sh
一番百度,发现是enforce没有关闭导致的. 可以用下面命令临时关闭
setenforce 0
如果要永久关闭,可以
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
更多推荐
已为社区贡献1条内容
所有评论(0)