Hero Image

Install Apache HTTP Server on RHEL 9

Install Apache HTTP Server on RHEL 9

Step 1 – Install Apache

subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install -y httpd mod_ssl

Step 2 – Start and enable the service

systemctl enable --now httpd

Step 3 – Open firewall ports

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Step 4 – Verify

curl -I http://localhost

The main configuration file is /etc/httpd/conf/httpd.conf and virtual-host definitions belong in /etc/httpd/conf.d/.

Apache version

apachectl -v