I have just installed Ubuntu Server 11.04 (Natty Narwhal) 64 bit.
Then installed nginx via:
sudo apt-get install nginx
I configured it properly and ran it with:
sudo service nginx start
At this point, everything is ok. The server was properly responding to requests.
Ran a sudo service nginx status
and got: nginx is running.
After a reboot, the server wasn't running.
Ran a sudo service nginx status
and got: could not access PID file for nginx.
The pid file:
-rw-r--r-- 1 root root 0 2011-07-01 10:34 /var/run/nginx.pid
Note: tried to make it run at boot with sudo update-rc.d nginx defaults
, but the links to the scripts were (correctly) already in place and no change was made.
What should I do to make it run at boot?
Solved.
For some strange reason, the directory of the logs wasn't mounted at the time that nginx tried to start (during the boot).
Changed the log files to another location and worked.