RHCE Work With Apache HTTPD Web Service – Dev Ops Lanka
Today most of web servers are Apache HTTPD .Apache HTTPD comes with everything you want to work with as modules.default port for http is port 80/TCP and for https 443/TCP.For use https you need to install mod_ssl module.For RHCE exam as best practice.im teaching you a tip.Ok Lets get start.
Installing Apache HTTPD on Redhat Linux 7
you can install httpd using
1 sudo yum install httpd -y
if you are planing to use https then you need to install mod_ssl also
1 sudo yum install mod_ssl
for the best practice i would teach you a easy step
1 sudo yum grouplist
copy Basic Web Server
1 yum groupinstall "Basic Web Server" -y
This will install the all the packages that you needed
Now apache httpd is installed.Now we are going to enable apache httpd to start on system start.
1 systemctl enable httpd
Now We start apache httpd
1 systemctl start httpd
now everything is perfect.we should get the apache default page
but if you are getting this page.
Because we did not allow httpd through firewall to do this
1 firewall-cmd --permanent --add-service=http
Now reload the firewall
1 firewall-cmd --reload
Then it will allow to apache httpd and show the test page
Now we create simple web page to display
Apache HTTPD default document toot is /var/www/html.now i’m creating sample file index.htm inside that folder.saying Hello Sameera Welcome !
1 nano /var/www/html/index.html
Hello Sameera Welcome !
now lets navigate to server0.example.com using web browser
See its working