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

I tried to run a "nginx -c /etc/nginx/nginx.conf" but I got:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[Exit 1]

Then I run a

 fuser -k 80/tcp ; service nginx restart.

I tried again with "nginx -c /etc/nginx/nginx.conf" but still the same error "[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)"

Why is this happening?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

This is not how you reload nginx.
What you are trying is starting nginx again, -c just specifies the configuration file it should use.
Use service nginx reload or /etc/init.d/nginx reload to reload it.

share|improve this answer
    
Ops I thought it was the command to reload the config "silently" –  MultiformeIngegno Dec 30 '12 at 20:57
    
I'd look into signals for config reload, they're rather typical. –  gparent Dec 30 '12 at 21:08
1  
SIGHUP is the silent reload signal for NGINX (on the master process). but using 'reload' attribute to the init.d script is easier for most. –  CloudWeavers Dec 30 '12 at 21:32
    
Does reload imply worker process to change id? –  MultiformeIngegno Dec 30 '12 at 23:52
1  
Depends on the actual init script, but usually it is also just sending SIGHUP. For more information on what happens, see here: nginx.org/en/docs/control.html –  faker Dec 31 '12 at 0:05

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.