CentOS 7 – allowing port 80 & 443 httpd



firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent

and then…

firewall-cmd --reload


How to check the zones?

firewall-cmd --get-zones


If you can’t connect to the server/page…

or with curl…

hell:~ pjrfigueiredo$ curl https://www.domain.com
curl: (7) Failed to connect to www.domain.com port 443: Connection refused

Check if anything is listening to 443

sudo netstat -lnp | grep 443

If nothing show up… try to edit the domain httpd configuration file… and make it so, that httpd is listening to it… like for example

<VirtualHost *:80 *:443>




Leave a Reply

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