I am on a shared host with rights to inherit the nginx root installation and overriding it's config file (note: I do NOT want to compile my own nginx in my home directory).
I wrote a start/reload/stop script which works perfectly however I keep getting the error below
the startup script
#!/bin/bash
# Set this to your nginx configuration file and PID
CONFIG=~/nginx/nginx.conf
PIDFILE=~/nginx/nginx.pid
# Do not change anything below unless you know what you do
DAEMON=/usr/local/nginx/sbin/nginx
NAME="nginx"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
OPTS="-c $CONFIG"
...
My config:
worker_processes 4;
error_log /home/myusername/nginx/error.log;
pid /home/myusername/nginx/nginx.pid;
events {
worker_connections 8192;
multi_accept on;
use epoll;
}
http {
error_log /home/myusername/nginx/error.log;
access_log /home/myusername/nginx/access.log;
server_names_hash_max_size 8192;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
underscores_in_headers on;
...
The error:
Reloading nginx configuration: [alert]: could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
nginx.
So it seems it's not reading my error and acces log locations correctly, how do I solve this, thanks!