CentOS 7 – If port is not open

Spread the love

If you have installed Apache and set up everything correctly on your new CentOS 7 server but still unable to access your website. It might be due to blocked ports caused by firewall. CentOS 7’s built-in firewall is set to block web traffic by default.

Check if port 80 and 443 are blocked

Install nmap
# yum install nmap

Run the Nmap scan
nmap -p 80,443 your-ip-address

If the ports are blocked, you will see the following result.

80/tcp closed http
443/tcp closed https

Configure firewalld to allow web traffic

# sudo firewall-cmd --add-service=http --permanent && sudo firewall-cmd --add-service=https --permanent
sudo systemctl restart firewalld

Leave a Reply

Back to Top