The Fastest Nginx LEMP Server Configuration and Set-Up

The following tutorial will allow you to run an optimized Nginx server with Ubuntu Precise Pangolin 12.04, Ubuntu Quantal 12.10, or Ubuntu Server 13.04 Raring Ringtail.

In this tutorial we will be running the server using Amazon Web Services and a Ubuntu 12.04 instance. Follow the link if you need help setting up the instance.

Once you have the server set up, use SSH and a command line tool and begin with the following command.

cd /

Next we will be downloading a preconfigured package, thanks to the awesome contributors to vladgh.com-LEMP.

To begin we will need to make sure we have GIT installed on the server. Use the following commands.

sudo apt-get install git-core

Next we will use GIT to get the very fast startup script and package.

sudo git clone git://github.com/vladgh/VladGh.com-LEMP.git

This will install the package onto your server. The package includes and OPTIONS file that we will now need to look at.

cd VladGh.com-LEMP

sudo vi OPTIONS

In the file that opens up we will want to make the following changes.

On the line INSTALL_MYSQL=’no’ make the line say INSTALL_MYSQL=’yes’

If you would like to use phpmyadmin then change the line INSTALL_PHPMYADMIN=’no’ to ‘yes’.

Now exit and save the file.

After setting up the options we will run the script. It make take some time for the installation to complete so grab a cup of coffee, a beer or surf this website.

Make sure you are still in the vladGh.com-LEMP directory before continuing and run the following command.

sudo bash install.sh

After the install script runs, you will have a LEMP server up and running. We need to make some adjustments before continuing to add sites or web applications.

First we will set the root password for MySQL using the following command. Make sure you change “MYPASSWORD” to what you want to use.

sudo mysqladmin -u root password ‘MYPASSWORD’

Now you will be able to begin adding sites and further configuring your Nginx server. For details on how to add sites and to tweak performance on the server please see the following tutorials.

To use Amazon RDS databases, see the tutorial on Apache Server configuration and look for the details on setting up the relational database service from Amazon.

Adding Sites to an Nginx Server

Optimizing Nginx

Comments are closed.