Today I came up against a frustrating realization: Apache doesn’t have a satisfying way to redirect multiple domains to canonical hostnames! In other words, it’s fairly easy to redirect one domain’s content from “www.example.com” to just plain “example.com” or to make both hostnames work, but there’s no one-stop solution to do this with a dozen domains. I’ve hit on a method that correctly redirects alternate hostnames and will save you aggravation in the long run.
I’ve previously written about my Multi-Server Web Hosting Environment and the how I Tuned Lighttpd For Linux to run as well as possible. But I’ve been having weird issues with that setup lately and was forced to rebuild the server entirely. While I was at it, I decided to give Apache another try, since the lighttpd hackery I needed to perform to get things like WP-SuperCache running were starting to get me down. The configuration documented here uses Ubuntu Lucid (10.04), Apache 2.2, FCGI, and PHP-CGI tuned for a 512 MB virtual private server (VPS) running on Rackspace Slicehost.
The last few weeks have been tough on my web servers. The release of iPhone OS 3.0 tripled my site traffic overnight as folks investigate the new Exchange integration features, and traffic to IT commentary site, Gestalt IT, which I also host, has been growing rapidly. Plus, Google just refreshed PageRank again, sending even more […]