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!
Comments
Submitted by andreychek on Fri, 10/16/2015 - 08:43 Comment #1
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
Submitted by philippeluickx on Fri, 10/16/2015 - 09:01 Comment #2
It's a clean install and I disabled apache as per documentation. No apache processes are running either.
The netstat command gives nothing back.
Submitted by philippeluickx on Fri, 10/16/2015 - 09:42 Comment #3
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?
Submitted by andreychek on Fri, 10/16/2015 - 09:44 Comment #4
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?
Submitted by philippeluickx on Fri, 10/16/2015 - 09:48 Comment #5
Oh just some specific nginx configuration, which I simply need to tackle next. No worries there!