How to install Web Server Apache in CENTOS 7

First, install apache paackage.

Server > yum install -y httpd httpd-manual

now, we need to configure the server admin.

Server > vi /etc/httpd/conf/httpd.conf

change below item,

ServerAdmin webmaster@example.com

now, lets create a default page. the default directory is in /var/www/html

Server > cd /var/www/html
Server > touch index.html
Server > echo "Hello World!" > index.html

now, start your apache service

Server > sudo systemctl enable httpd
Server > sudo systemctl start httpd

allow http service in firewall

Server > firewall-cmd --permanet --add-service=httpd
Serevr > firewall-cmd --reload

Enjoy your web server!

Comments