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:

  1. 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.
  2. Configure the SSH server to use a non-standard port (to reduce brute-force attempts), disable root login, and disable password authentication.
  3. 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.com for each domain that are owned by my user.
  4. Install Nginx and add configuration for each domain in /etc/nginx/sites-available.
  5. Install php5-fpm.
  6. Install MySQL, run mysql_secure_installation, and create users and databases for each application.
  7. Install Postfix with no relay host so the server can send notifications.
  8. 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.


Related Posts