1

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.

ML--
  • 325
  • 1
  • 4
  • 11

1 Answers1

2

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.

ML--
  • 325
  • 1
  • 4
  • 11
  • @pauska, FYI, it takes 48 hours before you can mark your *own* answer. :) – Cyclops Jul 02 '11 at 13:54
  • @Cyclops: I know :) – pauska Jul 02 '11 at 19:09
  • @pauska, Yes, I tried that just after I published the answer. Will be done as soon as I am allowed to ;) – ML-- Jul 03 '11 at 05:48
  • I've got the same issue. I disabled logging in nginx.conf but that didn't help. How did you find out what was causing it? – Stijn Mar 28 '12 at 20:29
  • IIRC, I saw a message on syslog. You can try setting the log file to some location that you know that exists and where the nginx user can write to. – ML-- Apr 04 '12 at 23:36