Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Try netstat -anp and look who listen 80 port. Else do ps -aux | grep http and kill all http process, after that start nginx. –  Cucumber Jul 1 '11 at 16:59
    
@Cucumber thanks, but there's nothing on 80 and there's no other web server. –  ML-- Jul 1 '11 at 17:17

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Please mark this as the accepted answer –  pauska Jul 2 '11 at 13:33
    
@pauska, FYI, it takes 48 hours before you can mark your own answer. :) –  Cyclops Jul 2 '11 at 13:54
    
@Cyclops: I know :) –  pauska Jul 2 '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 3 '11 at 5: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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.