CentOS Nginx error: could not open error log file: open() “/usr/share/nginx/logs/error… denied


Check status of service nginx:

systemctl status nginx.service

and we see error:

could not open error log file: open() "/usr/share/nginx/logs/error... denied

How to fix this error:

Method 1: disable SELinux

edit file /etc/selinux/config

Change line:

SELINUX=enforcing

to

SELINUX=disabled

Reboot

Method 2: CentOS Nginx PHP-fpm: how to fix error: connect() to 127.0.0.1:9000 failed (13: Permission denied) while connecting to upstream

Leave a Reply