Install LEMP (Linux, Nginx, MySQL And PHP) Stack On Linux

Exported on 28-Sep-2021 13:06:16

Install LEMP (Linux, Nginx, MySQL and PHP) On Linux Servers

This Blueprint Install LEMP Stack Components On Linux Systems Mentioned Below

LEMP is a variation of the ubiquitous LAMP stack used for developing and deploying web applications. While LAMP uses Apache as WebServer, its alternative Nginx is used with LEMP stack. LEMP stack consists of the following technologies.

Linux : The Linux® kernel is the main component of a Linux operating system (OS) and is the core interface between a computer's hardware and its processes. Linux provides the base for LEMP stack components, and makes installing the desired applications easy. Most common used Linux distributions are Ubuntu and Debian. Other available Linux distributions are CentOS, RedHat, OpenSuse, and Fedora etc.

Nginx : Nginx is an open source reverse proxy server. It is used to enable HTTP, HTTPS, SMTP, POP3, and IMAP protocols over a network. Nginx can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. It is main alternative and competitor to Apache Web Server. NGINX Plus is an application delivery platform built on NGINX, an open-source web server and reverse proxy for high-traffic sites.

PHP : PHP is a general-purpose and server-side scripting language that is especially suited for web development. PHP originally stood for Personal Home Page. It was later changed to Hypertext Preprocessor. PHP runs on all major operating systems including Windows, Linux and macOS. PHP supports a wide range of databases, like MySQL, PostgreSQL, MS SQL, db2, Oracle Database, and MongoDB. LEMP stack utilises MYSQL as the database with PHP.

MySQL : MYSQL is a Relational Database Management System, it is available as a open-source software under the terms of General Public License. MySQL is backed and maintained by Oracle. MySQL runs on all major operating systems and is easy to setup and uses Structured Query Language (SQL

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.
  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.
Supported Operating Systems:
  • Arch
  • Debian
  • Linux mint
  • Raspbian

Parameters

Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser
server_credential Linux OS Credential server_credential
server_host Linux / Unix Server server_host

1 - Download Installation Script

This step uses a community supported open-source installation script from : https://github.com/thamaraiselvam/LEMP-Installer

Begin by downloading the installer with git.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Clone LEMP installer script
git clone https://github.com/thamaraiselvam/LEMP-Installer.git

2 - Launch Lemp Installer

Once the download has finished, this will launch the installation of LEMP stack software components.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Change directory
cd LEMP-Installer

# Launch installer
sudo bash lemp.sh

3 - Restart Nginx

Installation has complete, this will restart Nginx server so the configurations take effect.

Fresh LEMP stack installation is ready, visit your_ip/info.php to verify the installation.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Restart nginx server
sudo service nginx restart