In this How-To, we will walk you through getting started with your Ubuntu 14.04 LTS with LEMP cloud server and verify everything is installed correctly.
LEMP is a software bundle that consists of four components. Linux (L) is the core platform which the other components run on. Nginx (E) is used to host web services. MySQL (M) is used for database management. PHP (P) is used for the back-end coding language.
A server with Ubuntu 14.04 LTS with LEMP. If you do not have a server already, you can spin up a reliable and trusted server from Atlantic.Net.
Getting Started with Ubuntu 14.04 – LEMP
First, we will want to sign into our cloud control panel here
Cloud control panel login page
Once logged in, we will see our list of servers. To add an Ubuntu 14.04 LTS with LEMP already installed, we would click on “Add Server”
Adding a Server
You will be sent to a page to fill out the following:
-Server Name: Name the server whatever you’d like, it’s a cosmetic choice that does not impact server functionality. It’s there to help you manage your servers.
-Location: Select which Atlantic.Net Cloud Platform you want your server hosted on. For best overall best performance, select the location closes to you.
1) In this tutorial, we chose USA-East-1.
Choosing your Server location
-Operating System you would want to choose which for this article will be “Ubuntu 14.04 LTS Server 64-bit – LEMP”
1) You would first click on “Applications”
Choosing your OS Type
2) Then click on “LEMP”
Choosing your OS Type
-Plan size of your choice. This will depend on what you will be using the server for. You are able to scale up the server at anytime but unable to scale down. You are able to view more detail for each plan here on our cloud server pricing page.
1) In this tutorial, we clicked on the “Small” plan size
Choosing your Plan size
-If you would like to enable backups for your server then you would check the box beside “Enable Backups”. Daily backups cost 20% of your server’s monthly price (minimum $1). Once enabled, you are able to restore your server to a previous date through the cloud control panel. You are able to enable/disable backups at any time as well.
After you have completed filling everything out, click on “Create Server”
Creating the server
You will then be sent to a page with the server details including the server credentials. You are also emailed the server credentials.
Newly provisioned Server details
Once your server is provisioned, you will need to SSH into your server. You can navigate to here if you are not sure how to SSH into your server.
Once you have logged into your server, you will see the provided LEMP Notes to help us verify everything.
NOTE: Make note of your current “root database password” as we will need it later to change it to a user-defined password for security reasons.
You will want to verify everything was installed correctly and is working. To check Nginx, go to http://<serveripaddress> , if it is installed, then you will see this default Nginx page.
Nginx Default Page
To verify MySQL is installed and working, run the following command
service mysql status
You will see this result if it is running
To make your MySQL more secure and to change the database root password from the provided one, run the following command:
You will first be prompted to enter the current root password for MySQL which was provided in the LEMP Notes when you first logged into your server.
Once you have entered the correct password, you will be asked if you want to change the root password, you would type “y” and then enter if you would like to change it. After changing your password, you will be prompted to answer a couple more questions which will make your MySQL secure by removing anonymous users, disallowing root login remotely, removing the test database and access to it (Ignore error as database does not exist) and then reloading the privilege tables. Once done, you are complete with MySQL!
To verify PHP is installed and working properly, we will create a basic PHP script. In this article, we will save it under the web root directory as test.php. In Ubuntu 14.04, the web root directory is located at /usr/share/nginx/html. We will create the file at that location by running the following command:
This will open an empty file, we want to input the following text.
Save and close the file.
We will now test if the server can generate the PHP script. You will want to go to your browser and enter the following URL:
If your server is able to translate the PHP script correctly, you will see something similar to the below picture.
PHP Information page
Once you have verified all components of the LEMP installation, you are able to begin configurations for your site!
Come back and check for updates, and spin up a reliable Cloud Server from Atlantic.Net.