Skip to content

SnipIT No 6: Allow HTTP through CentOS firewall

19/08/2016

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.

Advertisements

From → Unix/Linux

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: