SnipIT No 6: Allow HTTP through CentOS firewall

SnipIT is a series of short blogs containing useful information in an easily digestible format.
With a fresh install of CentOS, the firewall prevents http and https traffic.
To test that it is the firewall preventing access to the web server disable the firewall:

sudo systemctl stop firewalld

Then try browsing to the servers IP address for a remote machine.
Re-enable the firewall:

sudo systemclt start firewalld

To enable traffic we need to add two exceptions:

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https

Then we restart the firwall:

firewall-cmd –reload

Browsing to the server from a remote web browser should now show the Apache “test” page.


Posted

in

by

Comments

Leave a Reply

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