I edited this file:

/etc/nginx/sites-enabled/default

to listen 4444; - https://dpaste.de/nrUy9/

but still is on port 80. What can I do? Port 80 is used by apache.

My error:

root@user /etc/nginx/sites-enabled # service nginx restart
Restarting nginx: 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()
nginx.
up vote 0 down vote accepted

remove the IPv6 bind block (something along the lines of ::1:80

  • Thanks. Could you explain where exactly? – user2426362 Jul 3 '13 at 13:52
  • 1
    cd /etc/nginx && grep -R listen * will show you where – thanasisk Jul 3 '13 at 14:12
  • Thanks, now my sites work good on domain.com:33333 (port). How to change it to work without :33333 – user2426362 Jul 3 '13 at 14:23
  • Can you rephrase the question please? – thanasisk Jul 3 '13 at 14:23
  • I changed default port in nginx (from 80 to 33333). Now all my websites running on nginx work good only If I run in browser domain.com:33333. If I run domain.com did not work. How to fix it? – user2426362 Jul 3 '13 at 14:26

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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