0

Whenever I try to start nginx I get the following output.

/etc/init.d/nginx start
Starting nginx: [emerg]: bind() to [::]:80 failed (98: Address already in use)
[emerg]: bind() to [::]:80 failed (98: Address already in use)
[emerg]: bind() to [::]:80 failed (98: Address already in use)
[emerg]: bind() to [::]:80 failed (98: Address already in use)
[emerg]: bind() to [::]:80 failed (98: Address already in use)
[emerg]: still could not bind()
nginx.

However, nothing is listening on port 80. I get nothing when I run lsof -i :80

I'm also running php-fpm which I thought might have something to do with it but as I said, lsof doesn't indicate that php-fpm is related.

Does anyone have any idea what to look for?

3
  • What does netstat -tanp show? What do you get if you telnet to port 80?
    – David
    Jul 11, 2011 at 3:13
  • Nothing for port 80 in netstat or telnet. Jul 11, 2011 at 3:23
  • Can you post your config?
    – David
    Jul 11, 2011 at 3:26

4 Answers 4

0

Try starting nginx manually at the command line and see if you have the same problem. Try it with a clean config file and slowly add your changes. Maybe it's as simple as a configuration issue.

0

Pretty obvious, but you never know: are you starting this as root or via sudo? Only root can bind to ports < 1024.

1
  • Trying to bind to a privileged port as a non-root user gives EACCES, not EADDRINUSE.
    – womble
    Jul 11, 2011 at 6:25
0

Turns out it was a problem with the config file. Kind-of disturbed that a config file problem reports as an unrelated inability to bind to a port.

1
  • 7
    What kind of a problem? Can you please post what options in your config file were causing such behaviour? Jul 11, 2011 at 9:13
-2

My guess is that Apache is taking it. I'm pretty sure that PHP cannot run without it. I'm not very confident with PHP config. Here's a link that I found that may help. http://www.howtoforge.com/nginx_php5_fast_cgi_xcache_ubuntu7.04

I hope that this helps a little.

1
  • -1 No, PHP does not require Apache and that link has nothing to do with PHP requiring Apache, or even using Apache...
    – Chris S
    Jul 12, 2011 at 12:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .