Nginx (pronounced "engine x") is a very popular Web server. In an April 2014 survey conducted by NetCraft, they received responses from 958,919,789 sites. Nginx is reported to be on 146,204,067 of those sites surveyed or 15.25% of the overall marketshare. And these aren't small sites either, they're sites like Netflix, Box and Dropbox, WordPress, Tumblr, Pinterest and Instagram. If you consider only the top 1,000 websites as ranked by Alexa, Nginx surpasses Microsoft and Apache servers at 38%. Canonical has also decided to support Nginx as a component of its Ubuntu Server Linux distribution. In January 2014, Sam Soltano writing for W3Techs said:
In the last 2 months, every 15.5 seconds one of the top 10 million websites started using Nginx.
The survey didn't distinguish between the Nginx community server and the paid Nginx Plus.
Nginx and WordPress
A typical WordPress powered site is built upon the very popular LAMP stack (Linux + Apache + MySQL + PHP). Much of the WordPress development effort has gone into optimizing code for the LAMP stack. But WordPress can work on other web servers besides Apache. I've run a WordPress development environment under Windows and most recently I enjoyed the challenge of setting up a WordPress multisite site installation on an Ubuntu powered VPS. It's a development site, but it is wickedly fast!
EasyEngine for Nginx
EasyEngine (ee) is a linux shell-script to manage your WordPress-Nginx websites on Ubuntu and Debian servers. rtCamp is a web solutions provider company, prominently working on open-source projects.
I'm not going to walk you through installing EasyEngine on your server. There's plenty of information on the EasyEngine site for that. Installing a WordPress instance with EasyEngine is as simple as you can imagine. For example, to install a WordPress site with no caching, the command is ee site create example.com --wp. The various options for installing WordPress system include:
Single Site | Multisite w/ Subdir | Multisite w/ Subdom | |
---|---|---|---|
NO Cache | –wp | –wpsubdir | –wpsubdom |
WP Super Cache | –wpsc | –wpsubdir –wpsc | –wpsubdom –wpsc |
W3 Total Cache | –w3tc | –wpsubdir –w3tc | –wpsubdom –w3tc |
Nginx cache | –wpfc | –wpsubdir –wpfc | –wpsubdom –wpfc |
When you run the EasyEngine install, it does everything for you. It installs Nginx, MySQL, PHP and WordPress in whatever configuration you've chosen. The particular development server upon which I've been working was originally installed by someone else who selected a single WordPress installation instead of the multisite that was requested. Instead of blowing away the site and starting over, I decided to modify the current site to make it multisite. There are plenty of instructions on the EasyEngine site to make this happen, but there is one thing that they apparently overlooked. Their multisite subdirectory configuration files refer to the blogs.dir directory. Blogs.dir was used in WordPress multisite until version 3.5. If you build a new multisite installation with WordPress 3.5 or higher, the blogs.dir directory won't exist so the Nginx configuration files will be wrong. You would have to replace blogs.dir with uploads/sites to make the config work. Other than that little gotcha, Nginx is definitely the way to go.
Leave a Reply