I'm trying to host a small node application on a digital ocean droplet running ubuntu 14.04. In local development the site works fine over https, however on the server the site doesn't get displayed and the server does not throw an error, the connection is just refused. I ran nmap localhost and port 443 was closed. How can I open it?
4 Answers
sudo ufw allow 443/tcpAnd have a read through the docs on Ubuntu UFW interface on iptables. This should open it for your web application.
Also make sure that your application is serving off the external IP as well as the internal. The app.js file there is usually a setting to specify a interface for it to run on. 0.0.0.0 should run it on both internal and external.
2On Ubuntu 18.04.1 LTS I was missing this command:
sudo a2enmod ssl
Among other things, this will actually enable the ssl module.
Hat tip to this thorough source for configuring SSL on Apache on Ubuntu:
Running sudo a2ensite default-ssl worked for me.
This is what worked for me. 1) Create and install 2 certificates to /etc/ssl/certs/server.crt and /etc/ssl/private/server.key:
2) Edit the file /etc/apache2/sites-available/default-ssl.conf to reference those certificates and execute a2ensite on that file: