technology

A Production Quality WordPress Configuration Tutorial

The blogging software used to power this site, WordPress, has just had its 10th anniversary. In the last decade it has become incredibly popular, and currently accounts for about 18% of all websites. Due to my job at (mt) Media Temple, I’ve gotten to admin several popular blogs at various times over the years, and thus have a pretty good idea of how to optimize everything for good efficiency. In this WordPress configuration tutorial, I’m going to walk you through the production quality setup that I have for this blog, which makes use of Ubuntu Linux, Nginx, php5-fpm and MariaDB.

Interested in More About Nginx and WebSockets?

This blog doesn’t get a ton of traffic. At least not currently. But it’s pretty clear from the analytics that my post on proxying WebSockets with Nginx is by far the most popular thing I’ve written about to date. That article was fairly bare-bones, but people seem to find it useful, so I thought I’d just put the question out there: is there anything else related to the WebSockets functionality in Nginx you’d like to get some clarity on? Any examples you might find useful? If so, please just let me know in the comments, and I’ll do my best to make some new posts covering the areas of interest.

What You Should Know About DNS

This post is from an earlier incarnation of this blog. I’ve gotten a few requests to republish it (the original post date was 2009-06-23), so here we go.

/*************************************/

Recently, I’ve found myself typing quickly into my IM client to a few friends, explaining how a DNS change of some kind was going to work. It occurred to me that I should probably just write something up that would explain some DNS basics.

DNS is a big topic. I’m not even going to attempt to cover all of it here. If you really want to dig into it, then I recommend that you get and read the bugs book. A lot of this book is devoted to talking about the BIND software package (more on this later), but it’s still pretty much the reference for understanding DNS. If, on the other hand, you fall into the overwhelming majority of people who need to “get it”, but don’t need every detail, hopefully this article will help you out.

Switching the Blog to MariaDB

WordPress, which is the blogging platform used to run this site, relies on PHP and MySQL to operate. A while back, Sun bought MySQL, and then Oracle subsequently bought Sun. Two of the most important pieces of that second acquisition were MySQL, and the Java programming language. Without getting into too much of the debates, many people feel that Oracle isn’t a great steward for either Java or MySQL. To that end, the original creator of MySQL forked the code and created an alternative called MariaDB. MariaDB aims to be a seamless drop in replacement for MySQL, with better performance and some extended features. I decided to see how “drop in” it really was by updating this site to use it.

using strace on multiple processes in linux

My distinguished and decidedly sexy colleague Josh Barratt recently noted that you can use multiple -p flags with strace in order to simultaneously attach to multiple process. This is very useful when you’re trying to debug something like Nginx where there are likely multiple child processes that you want to monitor. If this is something that you think you might find useful, here’s a bash snippet that will make an easy to use straceall command: function straceall { strace $(pidof “${1}” | sed ‘s/\([0-9]*\)/-p \1/g’) } Just put this in your .bashrc, and then you can easily monitor a family of processes with a command such as: straceall php5-fpm if you’re trying to debug say a PHP issue.

Navigate