Install LEMP Server (Nginx, PHP, MariaDB & phpMyAdmin) on Fedora 22, 23 & 24

LEMP stack stands for Linux, Nginx, MySQL, MariaDB, MongoDB, PHP, Perl, Python & phpMyAdmin. LEMP is bunch of open source software which is developed by different organization.

NGINX stands for engine-x is a free, open-source, high-performance HTTP server and reverse proxy, as well as an mail (IMAP/POP3) proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. Currently 146 million websites use NGINX to deliver super-fast web experiences. The big companies like (WordPress, facebook, GitHub & cloudflare, etc..) using nginx.

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. For more details about PHP-FPM.

Assume that you have already installed Fedora on your system. If no, refer the below article to install latest version of Fedora 24.

1) Update your system upto date

Use the below command to keep your system upto date.

[Update your system to latest package]
$ sudo dnf update

2) Remove Existing LAMP stack

If you are planning to install NGINX, I advise you to remove your existing LEMP stack completely to avoid conflicts. Use the below single command to remove everything.

[Remove LAMP Stack]
$ sudo dnf remove httpd* php php-* mariadb* phpmyadmin
$ sudo dnf autoremove
$ sudo dnf clean all

[Remove Apache Configuration files]
$ whereis httpd
$ sudo rm -Rf /etc/httpd

[Remove MySQL Configuration files]
$ sudo rm -Rf /var/lib/mysql/

Then recheck once, if anything still available. Using below commands.

$ rpm -q httpd
$ rpm -q php
$ rpm -q mariadb
$ rpm -q phpmyadmin

3) Install Nginx

By default you will get Nginx latest version on Fedora systems, so just fire the below command to install Nginx on Fedora. The default Nginx web root directory is /usr/share/nginx/html

[Install Nginx]
$ sudo dnf install nginx

[Start Nginx]
$ sudo systemctl start nginx

[Enable Nginx on Boot]
$ sudo systemctl enable nginx

Open your web browser and navigate to http://localhost/ or http://your-server-ip-address/ or http://127.0.0.1/
install-lemp-on-fedora-24-workstation-1

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

Leave a Reply

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