LAMP How-To

This document walks you through the installation of Fedora/CentOS/RHEL LAMP server. There are many variations to the LAMP web stack but for the purposes of this how-to, we would simply refer to LAMP as Linux, Apache, MySQL and PHP.

How do we go about it? Assuming that we already have a working Fedora/CentOS/RHEL machine, we just issue the following commands on a root shell/terminal:

# yum -y install httpd mysql mysql-server php php-mysql
# service httpd start
# service mysqld start
# chkconfig httpd on
# chkconfig mysqld on

The first line installs all the needed software for Apache httpd, MySQL and PHP, including their dependencies. The second and third lines starts the httpd and mysqld services while the fourth and fifth lines ensures that httpd and mysqld starts during machine boot-up.

To check if the server works, issue

# echo "" > /var/www/html/index.php

on a root shell/terminal then open a browser and point it to http://localhost or whatever IP your LAMP server has.