How to get your WordPress site running fast on a $5/month VPS within 10 minutes – Part #2

In a previous post, we spoke about different types of hostings, and we’ve created our first droplet (VPS) at DigitalOcean. Now I’ll show you how to install LEMP (Nginx, MySQL, and PHP) stack on VPS within few minutes and fully automatically.

As you may know you can install LEMP stack one by one. You install and configure Nginx, then MySQL, then install php5-fpm and php5-mysql modules and configure Nginx to use them. What if you can do all of this with few commands from your shell? The solution is the automatic install script. There are many automatic install scripts available. Most of them are OS-specific, e.g. for CentOS there is Centmin. For Debian and its clones, there is solution named EasyEngine. EasyEngine (ee) will install all necessary software for you (Nginx, MySQL, PHP as well as HHVM, PageSpeed, postfix, mysqladmin)

EasyEngine is currently compatible with:

  • Ubuntu 12.04 & 14.04
  • Debian 7 & 8

So move on…

1. Before we start

In the first step, we have to check if there is Apache installed on our VPS. If so, we have to remove it first. I prefer Nginx over Apache because it uses much less RAM as well as it’s noticeable faster especially when it comes to serving static files. If you still want to keep apache (for any reason) you have to either stop it or reconfigure it to use the different port. I suggest you to uninstall it completely with following command:

2. Install EasyEngine

Now we can start to install EasyEngine.

Sometimes you can experience some common problems because of missing packages. If so, use the command bellow. This will install all necessary packages. BTW: I didn’t experience this issue with the DO Ubuntu 14.04 image, however, you can experience this with some other OS images e.g. minimal installs used by RamNode.

If you installed EE you can start to edit its config file with following command (I just prefer nano over vim 😛 )

Everything in the config file is well documented and straightforward. I’ll just mention a few things here you may consider changing.

In the “WordPress” section, you can see few parameters your can change. I suggest to change:

  1. User: this parameter is used to set your administrator account name. If you do not enter anything here EE will create administrator account with name “admin”. This is dangerous. Why ? Because most of the brute force attacks use “admin” for the administrator account name.
  2. Password: this parameter is used to set your administrator password. If you do not enter anything here EE will create a random password for you. I prefer to set this to my own password as autogenerated one is quite hard to remember. If you use password manager you can leave this blank and use autogenerated one.

3. Install LEMP stack + your first WP site

And now the magic comes in. With the single command, we will install Nginx, MySQL and PHP as well as our new WordPress site. Run the following command:

The command above creates WP site with no cache enabled.

wp install

[tip color=”lightgreen”]Note: EasyEngine will create a swap file (on KVM based VPS). Its size is based on the size of VPS RAM.[/tip]

EE supports many other types of WP sites. Here they’re:

Standard WordPress Sites

It is important to mention here that EE won’t configure cache plugins for you. It’ll just install and activate them.

WordPress Multisite with subdirectory

WordPress Multisite with subdomain

Non-WordPress Sites

HHVM Enabled Sites

HHVM (HipHop virtual machine) was created by Facebook engineers to save resources on Facebook servers. It’s much faster than any current version of PHP. Seems to be even faster than upcoming PHP version 7.

[tip color=”lightgreen”]Note: HHVM requires 64bit OS to be installed. More information about HHVM you can find here[/tip]

PageSpeed Enabled Sites

EE also supports pagespeed module created by Google. It helps you to improve your PageSpeed rank automatically. For more information click here.

[tip color=”lightgreen”]Note: PageSpeed module can be CPU intensive sometimes. I suggest you to test it before you make this change on live server[/tip]

In the next post, I’ll show you some useful EE commands you need to know to manage your WP sites and the status of the EE stack.

Leave a Reply

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