Nginx fails to restart after enabling SSL Support; Site goes down
Nginx fails to restart after enabling SSL Support; Site goes down
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
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
Re: Nginx fails to restart after enabling SSL Support; Site goes down
You can try to look who uses port like this:
Code: Select all
netstat -tulpn | grep :80
Re: Nginx fails to restart after enabling SSL Support; Site goes down
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
Re: Nginx fails to restart after enabling SSL Support; Site goes down
Sorry, wrong port
Code: Select all
netstat -tulpn | grep :443
Re: Nginx fails to restart after enabling SSL Support; Site goes down
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
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
Re: Nginx fails to restart after enabling SSL Support; Site goes down
Why your apache use 443 port? It's unusual.
Show us output:
Show us output:
Code: Select all
find /etc/apache2/ -type f | xargs grep 443
Re: Nginx fails to restart after enabling SSL Support; Site goes down
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>
Re: Nginx fails to restart after enabling SSL Support; Site goes down
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>
You can try change those to 8443 and check with restarts.
Re: Nginx fails to restart after enabling SSL Support; Site goes down
Error: apache2 restart failed
Re: Nginx fails to restart after enabling SSL Support; Site goes down
Any apache2 errors in logs?