Archives For server

I have good news and bad news for you. SPDY is out (also known as HTTP/2), and it’s well supported enough that we’re seeing it in more places. SPDY, pronounced Speedy, is a new web protocol to replace HTTP and promises to make web browsing both faster, safer and more secure.

It’s quite common for web developers and server administrators to need details about what is happening when requests to the server are made. When you use plain HTTP (non SSL or TLS), it’s so easy, you can use any common telnet client. It is possible to use some helper tools to get the same effect to test SSL/TLS based websites.

Sadly, telnet won’t work for SPDY because it is no longer a text-based protocol, but there is a great command line tool that is easily installed that will help you get all the details you need about your connection. Continue Reading…

Have you ever been doing a little web development and needed a web server for local testing? This usually happens to me when I’m doing Javascript and want to use a little Ajax. Much of what you do will work fine with the classic file:/// protocol, but sometimes that just won’t cut it.

Yeah, we can always use MAMP or XAMP or maybe you have a web server (IIS, Apache or Nginx) installed locally. Then you have to either move your files to the web root or configure it to point to your project folder, then remember how to start it (edit that config file). I just found a simpler way… Continue Reading…

I’ve tried using Jetpack a few times on this blog and failed because whenever I try to enable it I’m unable to activate it with I get an error xml_rpc-32700 and a message indicating that I’m special.

Well, maybe I am special. I host my website on a server using Nginx and Varnish. I did some searching and found some horribly unuseful suggestions, for example here, which essentially amount to disabling Varnish on the site, either temporarily or permanently. You don’t have to do this, you simply need to create a rule for your Varnish config that prevents caching of POST requests to xmlrpc.php. Here’s the code I used:

Inside of of the sub vcl_recv section of your varnish config add some code like this:

# Don't cache posts to /xmlrpc.php
if (req.request == "POST" && req.url == "/xmlrpc.php") {
    return (pass);

What this says is that if the request is a POST and the url is /xmlrpc.php then don’t return the cached version of the page.

Save your changes then restart or reload Varnish and voila, you can now activate your site with I suspect this will also fix problems with Akismet as well.

And for those of you running a WordPress multisite, this works just fine.

Big Performance from Apache on a Small Server

I’ve published another article for DigitalOcean on performance, this time focusing on Apache. They apparently didn’t like my catchy name and simply called it “How to optimize Apache web server performance,” which is too bad, but hey, that’s how it goes!

Apache is an amazingly powerful and capable web server. In order to make initial setup as easy as possible, it comes with numerous modules pre-installed. This makes it a great choice for new projects when you need to quickly be productive. However, as your site grows you may start to bump into performance problems.

What first attracted me to DigitalOcean was the low cost to get started. The smallest and cheapest droplets have 512MB of RAM, which doesn’t seem like much in today’s world of big frameworks. However, you’d be surprised what you can do with a small server like this if you take a little time to tweak the settings.

If you’re running Apache on one of the smaller sizes of droplets, or if you want to maximize your performance on the bigger droplets, here are a few things you should do. I’ll be using Ubuntu 12.04 in the examples but the principles I’m demonstrating are applicable to other versions of Linux as well.

Read the article on DigitalOcean: How to Optimize Apache Web Server Performance

Ruby has it. Node.js has it. Python has it. Java has it. And now, finally, PHP has it too! A built in web server for developing and testing applications locally! Let’s be fair, PHP has had this capability since mid-2012, but it wasn’t available on Mac OS until Mavericks launched in October 2013.

So now you don’t need MAMP to do local development. You probably just need a database, either the included sqlite3, the fabulous or MySQL (brew install mysql). Here’s how to get going: Continue Reading…

I had a server recently start having serious problems with connections of all types, at least when IPv6 was involved. I use IPv6 at home and ssh access took a significant amount of time to make a connection. Then when I tried to do apt-get update from the server it would fail with a message like this:

$ sudo apt-get update
[sudo] password for matt:
0% [Connecting to (2001:67c:1360:8c01::1a)] [Connecting to (2001:67c:1360:8c01::1...

It would sit there and take forever without making any progress. Sadly, the Ubuntu docs aren’t much help unless you’re using Ubuntu 8.04 or older (I refuse to link to them which will only add to their credibility).

A workaround is to disable IPv6, but really you should take the time to fix the problem, since it is the way of the future. In my case I’m sure it’s routing related, and hopefully my server provider can resolve it. Until then, I do this: Continue Reading…

In the last blog post I explained that I was moving to Node.js from Django and what is motivating me to do so. So how am I making the switch to Node? This post answers that question.

I love to read so I’ve got two books to share with you, and then I’ll identify three tasks that are well suited to Node.js which you can choose from for your to get started. First let me share the books I read and found helpful.

note: This is part two of three, stay tuned for the final installment. Continue Reading…

I help out a popular clothing retailer,, sometimes when they need some after-hours help. Last night at dinner I got an urgent text from the lead developer who is based in Europe saying the website was melting due to being mentioned in a highly popular Reddit post. It seems that one of the Boston bombing suspects was spotted wearing a hoodie from Kuhl.

The first problem was that there weren’t enough database connections available, the second was that, of the M1.extra-large’s 15G of RAM, only 4G was being used, and the third problem was that the disk i/o and cpu usage was close to nil. We solved all of these problems, and they all helped, but ultimately could only handle the load by serving a static copy of the popular page. But here’s the process I took to get there and how each step impacted performance. Continue Reading…