nginx.conf and nginx.pid users and permissions

前端 未结 2 1956
萌比男神i
萌比男神i 2021-02-14 17:06

I\'m embarking on watching my NGINX error.log files at level: warn... probably a silly idea and will cause me to crash my server as I work out any bugs happening, but hey, we\'r

2条回答
  •  隐瞒了意图╮
    2021-02-14 17:20

    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 /var/run/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

提交回复
热议问题