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?

2
  • 1
    Is your web server configured for HTTPS?
    – kraxor
    Jul 20, 2014 at 8:56
  • Sometimes sudo ufw allow out 443/tcp is necessary to allow outgoing connections from installed apps.
    – Kzqai
    Mar 23, 2015 at 23:40

4 Answers 4

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

2
  • 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, 2014 at 14:38
  • allow 443/tcp also lets AWS command-line tools work. Thanks! requester.mturk.com/developer/tools/clt Jul 20, 2017 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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .