atulroyal
By:
atulroyal

How to open PORT : 443

April 5, 2017 8.1k views
Apache Firewall Linux Commands Ubuntu 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
2 Answers
hansen April 5, 2017
Accepted Answer

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.

  • Problem solved !
    VirtualHost was wrongly configured. Now the port 443 is listing using this command :

    : 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 4269/apache2
    tcp6 0 0 :::22 :::* LISTEN 1626/sshd
    tcp6 0 0 :::443 :::* LISTEN 4269/apache2

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.

Have another answer? Share your knowledge.