16

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?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Wilfred
  • 389

4 Answers4

28
sudo ufw allow 443/tcp

And 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.

https://help.ubuntu.com/community/UFW

LinuxBill
  • 2,067
  • 2
    When I run sudo ufw status verbose it says inactive. Should I sudo ufw enable? Because it's inactive it isn't the thing that's closing the port then right? – Wilfred Jul 20 '14 at 14:38
  • allow 443/tcp also lets AWS command-line tools work. Thanks! https://requester.mturk.com/developer/tools/clt – Camille Goudeseune Jul 20 '17 at 16:55
5

On 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: https://www.maketecheasier.com/apache-server-ssl-support/

1

Running sudo a2ensite default-ssl worked for me.

d a i s y
  • 5,511
andyknas
  • 111
0

This is what worked for me. 1) Create and install 2 certificates to /etc/ssl/certs/server.crt and /etc/ssl/private/server.key: https://help.ubuntu.com/14.04/serverguide/certificates-and-security.html

2) Edit the file /etc/apache2/sites-available/default-ssl.conf to reference those certificates and execute a2ensite on that file: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04