only update firewall is installed/running

This commit is contained in:
Trevor Batley 2024-02-29 11:49:16 +11:00
parent 328f47f457
commit 21097826d4

View File

@ -301,10 +301,12 @@ cat > /etc/httpd/conf.modules.d/ssl.conf <<- EOF
LoadModule ssl_module lib/httpd/modules/mod_ssl.so LoadModule ssl_module lib/httpd/modules/mod_ssl.so
EOF EOF
if firewall-cmd --state >/dev/null 2>&1; then
# allow httpd access through firewall # allow httpd access through firewall
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https firewall-cmd --permanent --add-service=https
firewall-cmd --reload firewall-cmd --reload
fi
# enable and start the httpd service # enable and start the httpd service
systemctl enable --now httpd systemctl enable --now httpd