CentOS Open Port 80 and 443 in IPTables

On March 29, 2011, in Uncategorized, by Yervand Yezeryan

The default CentOS installation does not have port 80 and 443 open, which you need for HTTP and HTTPS. To open up those ports and start serving website, add the following two lines in /etc/sysconfig/iptables

# -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 443 -j ACCEPT
# -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Restart iptables with this command: # service iptables restart

 

 

4 Responses to CentOS Open Port 80 and 443 in IPTables

  1. timmy says:

    Nice!! Just what I wanted.

  2. Jaime Gago says:

    If you create the rule for http using building system-config-firewall it’s slightly different.

    This is what the rule looks like

    -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

  3. [...] port 80 is closed. I'm not running SL, but you may follow the instructions here to open the port in iptables. It's written for Centos, but it can apply to SL as it's compatible [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>