Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Nginx fails to restart after enabling SSL Support; Site goes down

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
14 posts
  • 1
  • 2
  • Next
h2p
Posts: 12
Joined: Sat Dec 17, 2016 3:39 pm

Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by h2p » Sat Dec 17, 2016 3:52 pm

After Enabling SSL Support and entering required keys, and then hitting Save, the settings get saved but the site goes down and nginx fails to restart.

Nginx error log gives the following:

CODE: SELECT ALL
2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:29 [emerg] 8687#8687: still could not bind()
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: bind() to 104.131.90.2:443 failed (98: Address already in use)
2016/11/02 18:59:54 [emerg] 8922#8922: still could not bind()


BUT if I reboot the server, Nginx starts up and I can access the site with both 'http' and with 'https' but I get 500 Internal Server on the page and 502 Bad Gateway in browser console. This error goes away if I disable the SSL support from VestaCP panel and reboot the server.

For your consideration:

nginx version: nginx/1.10.2
vesta - core package Version:0.9.8 (amd64) Release:16
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by skurudo » Tue Mar 14, 2017 2:38 pm

You can try to look who uses port like this:

Code: Select all

netstat -tulpn | grep :80
Top

h2p
Posts: 12
Joined: Sat Dec 17, 2016 3:39 pm

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by h2p » Thu Mar 16, 2017 8:47 pm

Code: Select all

tcp        0      0 x.x.x.x:8080     0.0.0.0:*               LISTEN      -
tcp        0      0 x.x.x.x:8080          0.0.0.0:*               LISTEN      -
tcp        0      0 x.x.x.x:80       0.0.0.0:*               LISTEN      -
tcp        0      0 x.x.x.x:80            0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      1730/nginx: worker
tcp        0      0 127.0.0.1:8084          0.0.0.0:*               LISTEN     
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by skurudo » Fri Mar 17, 2017 6:47 am

Sorry, wrong port

Code: Select all

netstat -tulpn | grep :443
Top

h2p
Posts: 12
Joined: Sat Dec 17, 2016 3:39 pm

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by h2p » Sun Mar 19, 2017 7:36 pm

tcp 0 0 127.0.0.1:443 0.0.0.0:* LISTEN 1855/apache2
tcp 0 0 10.17.x.x:443 0.0.0.0:* LISTEN 1855/apache2
tcp 0 0 104.131.38.xxx:443 0.0.0.0:* LISTEN 1855/apache2
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by skurudo » Mon Mar 20, 2017 3:40 pm

Why your apache use 443 port? It's unusual.

Show us output:

Code: Select all

find /etc/apache2/ -type f | xargs grep 443
Top

h2p
Posts: 12
Joined: Sat Dec 17, 2016 3:39 pm

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by h2p » Mon Mar 20, 2017 5:08 pm

Code: Select all

/etc/apache2/conf.d/10.17.x.x.conf:Listen 10.17.x.x:8443
/etc/apache2/conf.d/104.131.38.xxx.conf:Listen 104.131.38.xxx:8443
/etc/apache2/ports.conf:Listen 104.131.38.xxx:443
/etc/apache2/ports.conf:Listen 10.17.x.x:443
/etc/apache2/ports.conf:Listen 127.0.0.1:443
/etc/apache2/sites-available/000-default-le-ssl.conf:<VirtualHost *:443>
/etc/apache2/sites-available/default-ssl.conf:  <VirtualHost _default_:443>
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by skurudo » Mon Mar 20, 2017 5:26 pm

Code: Select all

/etc/apache2/ports.conf:Listen 104.131.38.xxx:443
/etc/apache2/ports.conf:Listen 10.17.x.x:443
/etc/apache2/ports.conf:Listen 127.0.0.1:443
/etc/apache2/sites-available/000-default-le-ssl.conf:<VirtualHost *:443>
/etc/apache2/sites-available/default-ssl.conf:  <VirtualHost _default_:443>
Here is your little monsters ;-)
You can try change those to 8443 and check with restarts.
Top

h2p
Posts: 12
Joined: Sat Dec 17, 2016 3:39 pm

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by h2p » Mon Mar 20, 2017 8:31 pm

Error: apache2 restart failed
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Nginx fails to restart after enabling SSL Support; Site goes down
  • Quote

Post by skurudo » Tue Mar 21, 2017 2:11 pm

Any apache2 errors in logs?
Top


Post Reply
  • Print view

14 posts
  • 1
  • 2
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password