This guide will show a basic installation of the apache webserver on Redhat 7 Linux (RHEL7). The service and installation package is called as httpd. First we need to install a base apache package httpd:
[root@rhel7 ~]# yum install httpd
Now we can start httpd service:
[root@rhel7 ~]# service httpd start
Redirecting to /bin/systemctl start  httpd.service
Check the status of httpd service:
[root@rhel7 ~]# service httpd status
Redirecting to /bin/systemctl status  httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since Thu 2014-09-04 17:20:17 WST; 17s ago
 Main PID: 2234 (httpd)

If you get a following errors:
Sep 04 17:20:12 rhel7 httpd[2234]: AH00557: httpd: apr_sockaddr_info_get() failed for rhel7
Sep 04 17:20:12 rhel7 httpd[2234]: AH00558: httpd: Could not reliably determine 
the server's fully qualified domain name, using Set the 'Server...his message
You can fix it by a following linux command:

Subscribe to RSS and NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.

[root@rhel7 ~]# echo 'ServerName' >> /etc/httpd/conf/httpd.conf
[root@rhel7 ~]# service httpd restart

By default the port 80 is blocked so we need to change firewall rules to enable http port:
[root@rhel7 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@rhel7 ~]# firewall-cmd --reload
At the moment you should be able to see a default Apache website when pointing your browser to your server's hostname or IP address eg.
default apache test page on Redhat 7 Linux

At this point we can create some simple page. Once done this will also disable the above RHEL7 apache test page from apearing:
[root@rhel7 ~]# echo "APACHE on RHEL7" > /var/www/html/index.html
[root@rhel7 ~]#
Reaload your browser to see your new page:
new apache page on Redhat 7 Linux

If all went well all what needs to be done to make sure that apache webserver starts after reboot. This can be achieved by the following linux command:
[root@rhel7 ~]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/'
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
Get extra help by visiting our LINUX FORUM or simply use comments below.

Comments and Discussions
Linux Forum