How to Open Port 80 and 443 for Incoming Traffic on a Linux Server

I was recently installing and configuring a new server. After installing CentOS I installed Apache. But server IP was not opening default Apache page. I was getting ping reply from my computer to server IP. So, I quickly figured out that Port 80 and Port 224 on server are blocked for incoming web traffic.

we need to open port 80 (http port) and port 443 (SSL / https port) for web traffic. So, here is how you can open port 80 and 443 on your server.

Login to your server as root via SSH and run following commands:

iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

Done!!!

Our Top Rated Host

Related Posts