Site Technology
favicon
If you’re wondering about the favicons, this should clear things up:
public function favicon() {
return $this->filePath($this->favicons[array_rand($this->favicons)]);
}
Unless of course you’re on IE, in which case you have no idea what I’m talking about. Because if you’re using IE, you probably had or are receiving a severe blow to the head.
Software
I use the following to run this site:
- nginx for a web server, which proxies to…
- Apache for…
- Subversion for source control
- PHP because it’s awesome
- MySQL for a database
- Notepad++ to write code
- Blue Shift for dependency injection
- PHP MVC for an MVC framework
The nginx Story
This site used to run on Apache, just
like everybody else’s site. Then one day, I was all, “apache sux, nginx rulez.”
So then I decided to port everything to nginx.
Also, I wanted to try out some mod_mono
action, which is incompatible with mod_php, so something had to give. And that
something was Apache.
mod_php (at least the version I compiled) could not run in a multi-threaded
environment, and mod_mono required a multi-threaded web server. So I took
the plunge and set up nginx. But it wasn’t so easy. See, I’m a bit of an unusual
find in the development world: I do all of my development on Windows, but the only environments
I deploy to are Linux (QED). Mostly, I just hate Linux as a desktop, and you can pry
Notepad++
from my cold dead fingers. So first I had to set up nginx on Windows, which was kind of annoying,
and also learn how to run PHP via CGI, which is also kind of annoying.
Then I ported all of my Apache virtual hosts to nginx virtual hosts (about 20 or so), which took
a long time. mod_rewrite doesn’t port one-to-one, so it required some finagling.
Once I was ready, I realized I should totally upgrade my web server’s operating system, so
that took another hour or so. Then I apt-get’d my way to success, installed Apache
and mod_mono (running on port 8080), and then compiled nginx (with the
fancyindex module
because it’s awesome and so am I). So far so good.
Then I needed to compile PHP. See, I’m pretty badass, so I compile PHP myself so I can always
get the latest version and more conveniently assert my superiority over the losers who use the packaged
version. But, I read somewhere on the internet so it must be true that the built-in CGI stuff for
PHP sucks, so you should use something else. All the cool kids were using
php-fpm, so I decided to use that.
php-fpm is a patch on the PHP source that makes the cgi SAPI more awesome.
Or something.
Finding the right version to download was super sketchy, because it was only up to PHP 5.3.1 and I was
rocking PHP 5.3.2 as hard as possible (it had just come out a few weeks ago). So I just assumed that
the patch would work (e.g. I crossed my fingers super hard). Once I patch -p1’d
myself to success, I needed to re-configure PHP. But, since the php-fpm patch
modified the source, I needed to rebuild the configure script. It turns out that doing just
that is an absolute nightmare on the PHP source. PHP apparently distinguishes between a development
package and a release package. On release packages, there are safeguards against
rebuilding the configure script. Luckily, you can bypass it by adding --force, but
it still makes you twinge a little bit.
Unfortunately, that totally doesn’t work.
See, PHP sucks in another way. It uses a version of
autoconf that is as
old as Father Time.
Fortunately, I found the
sketchiest possible patch
for configure, which made it work with versions of autoconf created this century. Somehow, after all that,
PHP compiled. I was good to go.
In conclusion, I’m a pretty cool guy. Thanks for reading.