LAMP on Fedora 23/22, CentOS/Red Hat (RHEL) 7.2/6.7/5.11

LAMP (Linux, Apache, MariaDB/MySQL, PHP) server is very powerful server setup behind any website or web based service. This guide is collection of Fedora/CentOS/Red Hat (RHEL), Apache, MariaDB/MySQL and PHP install guides.

Today the Internet is full of instructions, which promises a LAMP server installation with a “One-Liner”, and so forth. In fact, these “One-Liner” instructions assume that, Linux is already installed and installs just AMP (Apache, MariaDB/MySQL, PHP) pakages, without any configuration. AMP programs can be installed with one command easily, of course, but the correct configuration have to be done anyway, especially if the environment is going to production use.

This guide (more specifically this guide parts) try to explain in more detail LAMP (Linux, Apache, MariaDB/MySQL, PHP) server environment installation. This howto can be used to pre-installed Linux, and instructions can be used for various Fedora and Red Hat based Linux distros with YUM. This guide is also usable with setup where MariaDB/MySQL databases and Apache Web servers are on different server machines.

This guide includes three separated steps/guides

Note: Any step can be omitted if something does not want to install.

1. Install Linux (Fedora 23/22/21, CentOS 7.2/6.7/5.11, Red Hat 7.2/6.7/5.11)

Currently there are 6 different instructions for installing Linux (Fedora 23/22/21, CentOS 7.2/6.6/5.11 and Red Hat 6.7).

Install Fedora 23 Linux >>

Install Fedora 22 Linux >>

Install Fedora 21 Linux >>

Install CentOS 7.2 Linux >>

Install CentOS 6.7 Linux >>

Install CentOS 5.11 Linux >>

Install Red Hat (RHEL) 6 Linux >>

2. Install MariaDB 5.5/10.0/10.1 or MySQL 5.7

Install MariaDB 5.5/10.0/10.1 database server >>

— OR —

Install MySQL 5.7 database server >>

Note: Open MySQL port only when it’s really needed and otherwise use it only locally (localhost)

3. Install Apache (httpd) 2.4 with PHP 5.6

Install latest PHP 5.6 (currently 5.6.15) version.

Install Apache (httpd) web server with PHP support >>

PHP: APC Configuration and Usage Tips and Tricks >>

Enable Apache Userdir with SELinux on Fedora 20/19/18/17, CentOS 7.2/6.7/5.11, Red Hat (RHEL) 7.2/6.7/5.11 >>

Finally you are done. Not very hard, but at least the most important configurations and checks have been already completed.

Share this post


  1. Thanks, worked like a charm.
    Does anyone know of a good tutorial on what to do next? I am trying to learn DBs. I have it all installed so the question is “now what?”
    If anyone knows of a good tutorial that would be great

    • Hi Paul,

      Okay, you are trying to learn DBs, could you tell in more detail what you want to learn and do with databases?

      Do you want to learn pure SQL or do you want to learn database designing and theory how all things work?

  2. I followed the guide and installed LAMP on my Fedora machine. I prefer using MariaDB so I followed your guide at You are missing phpMyAdmin which I think is one of the best tools for database management at the moment. I installed it following the guide at and I think my LAMP installation is complete now. Thanks for your amazing tutorials.

    • Hi Leo,

      You’re welcome!

      And I actually have phpMyAdmin install guide too. I have to update it and test it with Fedora 21 and CentOS 7.


Submit a Comment

Your email address will not be published. Required fields are marked *