Nginx on virtualmin server not working

Hey!

I am trying to set up a VPS with virtualmin and nginx. The problem I have is that everything runs fine, until I create a virtual server in virtualmin with the nginx options enabled.

The steps I take are simple: 1. Install webmin 2. Install virtualmin 3. Install nginx

https://www.digitalocean.com/community/tutorials/how-to-install-webmin-w... https://www.digitalocean.com/community/tutorials/how-to-install-and-util... https://www.virtualmin.com/documentation/web/nginx

Until here everything goes fine. Nginx runs, the website returns the standard screen.

However, when I create the virtual server with these options: Enable Nginx SSL website? Enable Nginx website?

Then suddenly nginx is not running anymore. I can not get it started (neither on webmin or virtualmin or terminal). I do get these messages in the error.log:

2015/10/16 14:16:34 [emerg] 31898#0: bind() to [::]:80 failed (98: Address already in use) 2015/10/16 14:16:34 [emerg] 31898#0: bind() to [::]:80 failed (98: Address already in use) 2015/10/16 14:16:34 [emerg] 31898#0: bind() to [::]:80 failed (98: Address already in use) 2015/10/16 14:16:34 [emerg] 31898#0: bind() to [::]:80 failed (98: Address already in use) 2015/10/16 14:16:34 [emerg] 31898#0: bind() to [::]:80 failed (98: Address already in use) 2015/10/16 14:16:34 [emerg] 31898#0: still could not bind()

Googling this shows basically that the port 80 is already in use. Could it be there is a conflict between nginx running on webmin and the one in the virtual server?

Things kind of work by creating a virtual server without the nginx options and configure on webmin. However, this should work, right?

Thanks!

Status: 
Active

Comments

Howdy -- is this on a new installation, or do you have existing Apache websites?

If Apache is still running, that could be causing the problem you're seeing.

What is the output of this command:

netstat -anlp | grep :80

It's a clean install and I disabled apache as per documentation. No apache processes are running either.

The netstat command gives nothing back.

So I think I found the culprit... I had a localhost virtual host still as a default, next to my own newly created host. This was in the webmin interface, so not visible in virtualmin.

After deleting this, I got at least to the next error message (it's absurd how happy we can see a new error message pop up after a while!).

At least the nginx server is running now...

Should we keep this open as I feel this is a very confusing default with no pointers?

Well, it's odd that you'd see that error from having an existing domain in there -- I wouldn't have expected that problem. But I am glad you figured it out! We'll look deeper into that.

What error do you see now, out of curiosity?

Oh just some specific nginx configuration, which I simply need to tackle next. No worries there!