Where Does EasyEngine Define The Port For Nginx?


#1

I’m working on a server with ee/nginx and apache installed (long story). Right now, Apache is running fine on port 80. Nginx won’t start due to a conflict on port 80…

However, the port has been changed in /etc/nginx/sites-available/default to:-

listen 8000 default_server;
listen [::]:8000 default_server;

Yet starting Nginx still gives this error:-

[emerg] 4930#0: bind() to 0.0.0.0:80 failed (98: Address already in use)

I’ve grepped for any other reference to port 80 in /etc/nginx/ but found nothing. Does ee set port 80 anywhere else that I’m missing?

I’ve checked that there are no other nginx processes running. And the only thing running on port 80 is apache.


#2

This is still confusing sometimes, even for me.

Did you restart nginx after you made the port changes?

Also, did you check: /etc/nginx/sites-enabled/default ?

sites-available houses those sites which can be enabled. sites-enabled houses those sites which are enabled on the server.


#3

That’s kind of the problem :-). Nginx won’t start because Apache has port 80, and Nginx is still trying to get it.

The files in sites-enabled are ‘symbolic links’ to sites-available, so they are actually the same file. Unless someone removes that link - still in place in this case.


#4

For anyone following or seeing this later. Still no idea what the real problem was - but we just built a new server with a fresh ee install and migrated the sites over. Not ideal but ultimately quicker to resolve.

I’d be interested to know why nginx might still have been trying to bind to port 80 though.


#5