install Nginx, PHP FPM, Cache, MySQL on VPS VULTR Ubuntu 12.04

Probably a lot of people are going to use their Vultr VPSes as webservers, a good choice would be Nginx as a webserver. In this topic I’m going to describe on how to install Nginx, PHP FPM and MySQL. Also we’re going to look at Nginx’s caching feature. In this topic we’re using Ubuntu 12.04, I do not know if this will also work on CentOS or Debian.

Install Nginx + PHP FPM + Caching + MySQL on Ubuntu 12.04

Install Nginx + PHP FPM + Caching + MySQL on Ubuntu 12.04

First steps

Make sure your server is up to date:

Install Nginx and PHP FPM

Install MySQL

When prompted enter a password. This is the root password which you will need to create databases and users.

Now that we’re installed all the programs we need, we’ll configure our so called vhosts. A vhost is the configuration file for a domain, this means you can attach multiple domain to your server.

The configuration file can be found here:

To begin we’ll remove the default vhost for nginx:

We’ll now create a new one with the contents of the vhost I gave you.

Now that we’ve created our vhost and we’ve pasted the contents we’ll have to edit some things.

Below the old values:

And the new values:

If you don’t want caching, remove/comment the following lines:

Now that our configuration is complete and we’ve setup all our services, we can restart Nginx.

We’re done! If you go to the domainname you’ve pointed to your server, you should see the new document root and you should be able to put content on it.