This tutorial will show how to setup a basing LAMP environment on RHEL7. This guide is logically split into three parts:
  • Installation of Apache Webserver
  • Installation of PHP support
  • Installation of MariaDB database
Each section will guide you step by step and will also provide simple tests to test each above step.
The default database MySQL was on replaced by MariaDB fork. It uses same php-mysql module to talk to MariaDB database from php script.

Installation of Apache Webserver

First we need to install Apache webserver. The package and service is called httpd:
[root@rhel7 ~]# yum install httpd
Start httpd service:
[root@rhel7 ~]# service httpd start
Redirecting to /bin/systemctl start  httpd.service
Enable firewall to allow http port 80 access:
[root@rhel7 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@rhel7 ~]# firewall-cmd --reload

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 Linux Career 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 for http connection is filtered on Redhat 7 as you can only access this port from the actual localhost and not from any other public host. To open a port 80 on RHEL 7 Linux we need to add an iptables rule. For this RHEL7 uses firewall-cmd. First add your port 80 rule with a following linux command:
[root@rhel7 ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent

Operating System

Red Hat Enterprise Linux Server release 7.0 (Maipo)


The error:
httpd: apr_sockaddr_info_get() failed for rhel7
apears when starting apache webserver daemon httpd. It can be seen when executing httpd service status command:

Chrome browser is not a part of standard Redhat repositories and therefore its installation needs to be performed using external package provided by Google Inc. First download chrome browser package:
[rhel7@rhel7 ~]$ wget

The Systemd system management daemon was designed to replace current init system inherited from UNIX System V operating systems such Linux and thus making current init system obsolete. It this tutorial we will discuss some systemd basics such as how to start or stop service and see service status using systemctl command. Let's start with little bit of information about our systemd version. Use the below systemctl command to determine systemd version:
[root@rhel7 ~]# systemctl --version
systemd 208

The default settings for the GRUB2 timeout menu selection during the system boot is 5 seconds. To change this value open /etc/default/grub grub default config file. The content of the file looks similar the the one shown below:
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX=" crashkernel=auto  \ vconsole.font=latarcyrheb-sun16 vconsole.keymap=us rhgb quiet"

I would like to know how to check gnome desktop manager version on my Redhat 7 Linux server/desktop?

In this short tutorial we will show you how to install VirtualBox Guest Additions on RHEL 7 gnome desktop. To start simply boot to virtual RHEL 7 system. First we will install all prerequisites. To do that open terminal and enter following linux commands:
[root@rhel7 ~]# yum groupinstall 'Development Tools'
as well as we will need kernel development package:
[root@rhel7 ~]# yum install kernel-devel

The default Graphical User Interface for Redhat Enterprise Linux 7 server is Gnome. If from some reason you have decided to install KDE Desktop or to switch from a RHEL7's default GUI gnome to KDE this short tutorial will provide you with easy to follow steps.

Installation of KDE desktop manager on RHEL 7

Here we assume that you currently do not have any desktop manager installed on your system. To install KDE desktop manager on RHEL 7 execute below command:
[root@rhel7 ~]# yum groupinstall 'X Window System' 'KDE'

In order to login to RHEL7 Linux server we first need to exchange public keys between server and client machine. To do that we can use ssh-copy-id command.
$ ssh-copy-id user@rhel-server
The authenticity of host 'rhel-server (rhel-server)' can't be established.
ECDSA key fingerprint is 21:4d:71:f6:ef:1f:c1:f7:a9:d9:81:4d:9d:34:4d:a9.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
user@rhel-server's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'user@rhel-server'"
and check to make sure that only the key(s) you wanted were added.

Installation grouplist is a ready to install collection of software packages and its dependencies to fit a given purpose. To list common groupinstall collection we can run yum grouplist command:

The conventional way used to change runlevel using /etc/inittab has become obsolete with Redhat Enterprise Linux version 7. As a result any Linux system using systemd system management daemon now relies on systemctl command to change runlevel or to be more precise to change the target. As a result any edits of /etc/inittab file will not take effect on RHEL 7. The term runlevel still exists on RHEL 7 and we cat check current runlevel using runlevel command:
[root@rhel7 ~]# runlevel 
N 3

If you have performend a RHEL 7 Linux Server installation and did not include Graphical User Interface (GUI) you can do it later directly from command line using yum command and selecting an appropriate installation group. To list all available installation groups on Redhat 7 Linux use:
[root@rhel7 ~]# yum group list
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Available environment groups:
   Minimal Install
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management

Depending on your Rendhat 7 installation you may end up with a default hostname localhost.localdomain. This hostname will be shown on various services your new server will offer as well a it will be show on your command prompt such us:
[root@localhost ~]#
To change your hostname simply edit vi /etc/hostname file and inlcude name of your host.

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.

You may also be interested in: