Wisdom

The erudition of Inventive Labs, collected.

Archive / RSS
Apr 2

Logging the domain with Apache wildcard virtual hosts

If you have an Apache virtual host set up to respond to a number of different domains, the two typical access log configurations (common and combined) do not include domain information. So you can see what resource is being accessed, but not for which domain. This becomes significant if you are serving different content based on the domain, as we do with Blueprint.

We use the NCSA combined log format. Adding the domain information to this format is as simple as plucking it from the request headers: "{Host:}i". To retain compatibility with the standard ‘combined’ format, we replace the superfluous “user” item in the format with the domain, like this:

CustomLog access_log "%h %l \"%{Host}i\" %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""

Feb 23

Feb 23

Feb 23
" Show spaces at the end of lines
hi RedundantSpaces ctermbg=DarkGrey guibg=#222222
match RedundantSpaces /\s\+$/
Pop it in your .vimrc.

Sep 25
“dpkg-reconfigure tzdata” Change the timezone in Ubuntu.

Jun 1

Jun 1

May 29
Mr and Mrs Systems, we’re sorry to inform you that your child, Adobe, has received yet another F. This ongoing string of fails is a concern to us, and in light of recent anti-social behaviour, we’re left with no alternative but to threaten expulsion.

Mr and Mrs Systems, we’re sorry to inform you that your child, Adobe, has received yet another F. This ongoing string of fails is a concern to us, and in light of recent anti-social behaviour, we’re left with no alternative but to threaten expulsion.


May 20

Alarming events in the life of your Rails project #1: you’ve just written a Rake task labelled :armageddon. True story. Actually, some theologians posit that the event in question has already occurred, when (unrelatedly) I dropped down to SQL this morning and executed DELETE FROM users WHERE god IS NULL.


May 15
Oy, some of my old code found its way into Warehouse a while back. Cheers for the shout, ActiveReload.

Oy, some of my old code found its way into Warehouse a while back. Cheers for the shout, ActiveReload.


Page 1 of 5