LEMP-logo-smallLEMP (Linux, Nginx, MySQL, PHP) server is extremely powerful setup behind any website or web based service. This guide is collection of Fedora/CentOS/Red Hat (RHEL), Nginx, MariaDB/MySQL and PHP (PHP-FPM) install guides.

This guide (more specifically this guide parts) try to explain in more detail LEMP (Linux, Nginx, MariaDB/MySQL, PHP (PHP-FPM)) 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, Nginx servers and even PHP-FPM are on different server machines. So you could have different servers to process MariaDB/MySQL queries, Web Server requests and PHP requests.

This guide includes three separated steps/guides

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

1. Install Linux (Fedora 26/25/24, CentOS 7.3/6.9, Red Hat 7.3/6.9)

Currently there are four different instructions for installing Linux (Fedora 26, CentOS 7.3/6.9 and Red Hat 6.9).

Install Fedora 26 Server Linux >>

Install CentOS 7.3 Linux >>

Install CentOS 6.9 Linux >>

Install Red Hat (RHEL) 6 Linux >>

2. Install MariaDB 10.2/10.1/10.3 or MySQL 5.7/8.0

Install MariaDB 10.2/10.1/10.3 database server >>

— OR —

Install MySQL 5.7/8.0 Community database server >>

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

3. Install Nginx with PHP (PHP-FPM) 7.1

This Nginx and PHP (PHP-FPM) part use Remi Repository and install latest PHP (PHP-FPM) 7.1 (currently 7.1.7) version.

Install Nginx web server with PHP (PHP-FPM) support >>

Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks >>

PHP: APC Configuration and Usage Tips and Tricks >>

Finally you are done, most important configurations and checks have been completed and you are ready to run your site(s) on LEMP (Linux, Nginx, MariaDB/MySQL, PHP) environment.