Question

How to open PORT : 443

Posted April 5, 2017 195.5k views
ApacheFirewallLinux CommandsUbuntu 16.04

I have checked that the port 443 is closed and is not listed on my droplet.

Here is the output when i run the command :

root@ubuntu-1gb-blr1-01:/# netstat -ntlp | grep LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4749/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1626/sshd
tcp6 0 0 :::80 :::* LISTEN 17100/apache2
tcp6 0 0 :::22 :::* LISTEN 1626/sshd

Please let me know how can I open 443 port So that my website works over https.

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
5 answers

Let’s list the services that are running:

sudo lsof -iTCP -sTCP:LISTEN -P

Do you see Apache on port 443 on the list? If yes, then it might be a firewall issue.
If no, then Apache isn’t listening on port 443, which probably is a wrongly configured VirtualHost, so let’s see the configuration for your sites.

Please let me know which Linux flavor, you are using.

In general you can use below command to open port 443 on any linux.

iptables -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT

service iptables save

service iptables restart

Hope it will help you.

I know this is quite old but i enabled it with ‘sudo ufw allow 443’.

Hello,

A solution is to use UFW in order to manage your iptables rules.

UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall. While iptables is a solid and flexible tool, it can be difficult for beginners to learn how to use it to properly configure a firewall. If you’re looking to get started securing your network, and you’re not sure which tool to use, UFW may be the right choice for you.

To enable UFW, use this command:

sudo ufw enable

You will receive a warning that says the command may disrupt existing SSH connections. We already set up a firewall rule that allows SSH connections, so it should be fine to continue. Respond to the prompt with y and hit ENTER.

The firewall is now active. Run the sudo ufw status verbose command to see the rules that are set. The rest of this tutorial covers how to use UFW in more detail, like allowing or denying different kinds of connections.

HTTPS on port 443, which is what encrypted web servers use, using

`sudo ufw allow https or sudo ufw allow 443

You can also check our full tutorial on how to setup a firewall with UFW on Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04

Hope that this helps!
Regards,
Alex

by Brian Boucheron
by Erika Heidi
UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall on Linux servers. In this guide, you'll learn how to set up a firewall with UFW on Ubuntu 18.04.

Hello,

In addition to what has already been mentioned, not that you would need to have an SSL certificate installed in order for Apache to also listen on port 443.

You could use Let’s Encrypt to get a free SSL certificate and certbot will also do the Vhost configuration for you automatically:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04

Regards,
Bobby

by Erika Heidi
Let's Encrypt is a Certificate Authority (CA) that facilitates obtaining and installing free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. Currently, the entire process of obtaining and installing a certificate is fully automated on both Apache and Nginx with the use of Certbot. In this guide, we'll use Certbot to obtain a free SSL certificate for Apache on Ubuntu 20.04, and make sure this certificate is set up to renew automatically.