How To Install LEMP on Ubuntu 15.10

r00t November 9, 2015

LEMP-linux

In this tutorial we will show you how to install and configuration of LEMP on your Ubuntu 15.10 server. For those of you who didn’t know, A LEMP software stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Nginx web server (which replaces the Apache component of a LAMP stack). The site data is stored in a MySQL database (using MariaDB), and dynamic content is processed by PHP.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation LEMP (Linux, Nginx, MariaDB and PHP) on Ubuntu 15.10 server.

Install LEMP on Ubuntu 15.10

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Note: If another web server like Apache2 was installed in your system, remove it first to avoid conflicts. To uninstall Apache, run the following commands:

Step 2. Installing Nginx on Ubuntu 15.10

We will be installing Nginx with apt-get, which is the default package manager for ubuntu:

Start Nginx service using the following command:

You can verify that Nginx is really running by opening your favorite web browser and entering the URL http://your-server’s-address, if it is installed, then you will see this:

Nginx Default Page

The default web page for NGINX on Ubuntu 15.10

Step 3 Configure Nginx web server.

To get Nginx to work with PHP correctly, we need to make changes to the Nginx configuration file. This guide we will be using a simple Nginx config file:

Copy the following into your text editor:

Once you have finished editing the file restart Nginx with:

Step 4. Installing MySQL on Ubuntu 15.10.

To install MySQL in Ubuntu 15.10 run the following command:

Once complete, you can verify MySQL is installed by running the below command:

By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL:

Configure it like this:

To log into MySQL, use the following command (note that it’s the same command you would use to log into a MySQL database):

Step 5. Installing and Configuring PHP on Ubuntu 15.10.

Install PHP on the Ubuntu 15.10 with the following command to begin the install:

Your server should restart Nginx automatically after the installation of both MySQL and PHP. If it doesn’t, execute this command:

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

Copy the following into your text editor:

Try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.

install-lemp-on-ubuntu-15.10

PHP info page on Ubuntu 15.10

Congratulation’s! You have successfully installed LEMP stack. Thanks for using this tutorial for installing LAMP (Linux, Nginx, MySQL and PHP) in Ubuntu 15.10 system. For additional help or useful information, we recommend you to check the official Nginx, MySQL and PHP web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!
Share on Google+0Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit0Pin on Pinterest100
The Tags:

Leave a Comment