nginx.conf and nginx.pid users and permissions

我们两清 提交于 2019-12-04 09:21:48

I got the same error on my Centos 7 server today.

nginx.pid" failed (13: Permission denied)

For me, it turned out to be a problem with SELinux. I did the following to make it work again:

systemctl stop nginx
touch /var/run/nginx.pid
chcon -u system_u -t httpd_var_run_t nginx.pid
systemctl start nginx

running

ls -Z nginx.pid

should output

-rw-r--r--. root root system_u:object_r:httpd_var_run_t:s0 nginx.pid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!