How to Install Apache on CentOS/Rhel 7.x

How to Install Apache on fresh CentOS/Rhel 7.x

Install Apache

#yum update all
#yum -y install httpd

Configure Apache to Start on Boot

#systemctl start httpd
#systemctl enable httpd
#systemctl status httpd

Configure Apache to Stop on Boot

#systemctl stop httpd
#systemctl disable httpd

Allow Apache Through the Firewall

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

Now direct your browser to http://192.168.0.100 and you will see the Apache welcome page.

After hosting a simple html page then the default test page will get disabled

#echo 'ServerName 192.168.43.2' >> /etc/httpd/conf/httpd.conf
#echo "APACHE on CentOS/RHEL7.X" > /var/www/html/index.html
#systemctl restart httpd

Leave a Reply

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