Ryan Frankel has a wonderful article on how to run a WordPress installation on a 512MB Droplet at digitalocean.com. Unfortunately, since it was written in the Spring of 2014 it was a bit out of date when creating a Droplet with Ubuntu 14.041. Here are some notes about how to get things running on Ubuntu 14.04.
The biggest problem I ran into was configuring Apache because between releases of Ubuntu many of the Apache configuration files were moved around.
The portion of his article in question is the section on reducing the number of Apache processes used by the running instance. This is done to reduce the memory footprint of everything and because Varnish is being used as a front end to cache almost everything.
The only configuration file I needed to modify was
mpm_prefork.conf which, on Ubuntu 14.04, is located in
/etc/apache2/mods_enabled. In Ryan’s documentation the setup for this module is in
apache.conf but this has changed with 14.04. Modules have been split out into their own configuration files. Ryan also notes that you need to update the configuration for
mpm_event_module. In a default Apache install on 14.04 these two modules are not enabled and I did not have to enable them to get WordPress up and running. My prefork configuration looks like:
# prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxRequestWorkers: maximum number of server processes allowed to start # MaxConnectionsPerChild: maximum number of requests a server process serves <IfModule mpm_prefork_module> StartServers 1 MinSpareServers 1 MaxSpareServers 3 MaxRequestWorkers 6 MaxConnectionsPerChild 0 </IfModule>
MaxRequestWorkers has replaced
MaxClients in the Apache version shipped with 14.04.
MaxClients is still supported but I chose to use the new terminology. Note that they do the same thing, just the name has changed.
The same situation applies to
MaxConnectionsPerChild. It has replaced
MaxRequestsPerChild is still supported. They both do the same thing, just the name has changed.
WordPress Plugin Setup
One thing to consider before setting up Varnish is to get your WordPress install working the way you want it first before making Varnish a proxy for Apache. I ran into quite a few glitches setting up the Jetpack plugin for WordPress as well as getting sharing settings working (Twitter, for instance, wouldn’t redirect properly when I was authorizing my WordPress install to post to my Twitter timeline). I first tried just redirecting everything through Varnish without hitting the cache but still had problems. The only solution I could find was to completely disable Varnish and have Apache work on its own while I did the setup and configuration of WordPress, then reconfigure to get Varnish working again.
- Ubuntu 12.04, the version used in Ryan’s article, is still available on 11/17/15 as an OS option for a new Droplet. I wanted to use 14.04 because many of the Digital Ocean help documents are using that version. ↩