By default the port 80 for http connection is filtered on Redhat 7 as you can only access this port from the actual localhost and not from any other public host. To open a port 80 on RHEL 7 Linux we need to add an iptables rule. For this RHEL7 uses firewall-cmd. First add your port 80 rule with a following linux command:
[root@rhel7 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
Once you add the above firewall rule reload firewall service:
[root@rhel7 ~]# firewall-cmd --reload
And check whether the port was added to ipatables rules:
[root@rhel7 ~]# iptables-save | grep 80
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
Open http port 80 firewall rule on RHEL7 linux httpd
If you decide to block/remove http port 80 firewall rule you can again use the firewall-cmd command:
[root@rhel7 ~]# iptables-save | grep 80
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT
[root@rhel7 ~]# firewall-cmd --zone=public --remove-port=80/tcp --permanent
success
[root@rhel7 ~]# firewall-cmd --reload
success
[root@rhel7 ~]# iptables-save | grep 80
[root@rhel7 ~]# 
Block/Remove http port 80 firewall rule on RHEL7 linux httpd
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions