Upgrading Tombuntu in 2013
Last week Tombuntu’s server received a much-needed upgrade to Ubuntu 12.04. Tombuntu launched in 2007 hosted on my home server running Ubuntu. In 2008, I moved it to a Linode VPS running Ubuntu 8.04. Support for Ubuntu 8.04 ended back in April, so it was definitely time for an upgrade.
Other than some security issues, I haven’t had any problems with Linode, so I re-provisioned by existing server with a new Ubuntu 12.04 install. Here’s a brief overview of the setup process I went though:
- Linode’s Ubuntu image requires some extra configuration that you would normally do during an Ubuntu install. Follow Linode’s documentation to set the hostname, set the timezone, and create a user.
- Configure the SSH server to use a non-standard port (to reduce brute-force attempts), disable root login, and disable password authentication.
- Create a directory for document roots. I’m the only person who needs to log
into the server, so I just create directories like
/srv/www/tombuntu.comfor each domain that are owned by my user.
- Install Nginx and add configuration for each domain in
- Install MySQL, run
mysql_secure_installation, and create users and databases for each application.
- Install Postfix with no relay host so the server can send notifications.
- Write a cron job on my home desktop to create database dumps and back everything up using rdiff-backup.
The software stack has only changed slightly: Nginx has replaced the Apache web server. I used to have problems with the number of Apache processes and their memory usage inflating and running the server out of memory. Nginx uses a event-driven architecture so one process/thread can handle multiple connections asynchronously, whereas Apache (in the most common configuration) requires one process for each connection. This makes Nginx more scalable and keeps memory usage consistent.
My favorite way to backup is still rdiff-backup, because it allows remote, incremental backups, and restoring from the most recent backup only requires copying files. My desktop at home initiates the server backup through cron. This has the advantage that the server does not have direct access to its backups (my desktop can reach the server via SSH, but not the other way around).
Tombuntu is powered by WordPress. Between upgrading to the latest version and having to run SQL queries to delete massive amounts of spam, WordPress is pretty high-maintenance. It’s also really slow without caching pages on the server. For whatever reason, WordPress doesn’t include a built-in page cache, but there are numerous plugins providing this. Unfortunately, many of the popular plugins are now buggy, poorly maintained, and/or are trying to upsell you to a premium version. Currently I’ve settled on Hyper Cache.
Finally, I did some optimization on the site itself to improve load time. The FeedBurner widgets were slow and didn’t seem to work any more, so I removed them. I used Google’s excellent PageSpeed Insights tool to get some additional suggestions for speeding things up.
It’s been a while since you’ve popped up in my RSS reader. Welcome back!