Category Archives: Tips & Tricks

Free Stuff and Kickstart Hell

Recently, my employer had a free hardware giveaway that allowed employees to pick through pallets upon pallets of retired server hardware and claim things as their own. Some of it was known to be dead, but the state of most of it was unknown, so it was kind of a crap shoot. I grabbed myself a few (okay, thirteen) machines in the hopes that I’d pick up a few decent pieces of machinery. As luck would have it, ten out of the thirteen boxes were in working order. Five of them were dual-dual core machines, and the other five were dual-quad-core machines, all server grade. After picking up some RAM, I have a pile of working machines just waiting for something to do. Time for a new lab setup at home!

The first thing I’m working on is a kickstart setup to automate system installs of various types. I’ve got a few basic CentOS server setups configured already, and I’ve been working on some Fedora-based stuff as well. Fedora is much more bleeding-edge, so there’s a lot of change from what I’m used to with the “OMG SO OLD” CentOS.

One of those differences cropped up while I was trying to write up a kickstart script for a Fedora 16-based desktop with an encrypted storage setup on a software RAID1. Prior to Fedora 16, one could easily set up a kickstart that would partition a disk with “growable” RAID partitions of non-fixed size – a partition on the disk that would grow to fill the available space on the disk. Fedora 16 forces you to create a RAID partition of fixed size, without the ability to fill up the available space. This makes the kickstart script non-flexible, since you have hard-coded size values for each partition. This is not at all desirable in the setup I was going for, except for the /boot partition.

With a bit of elbow grease and a non-trivial amount of time spent waiting for test runs to complete, I was able to craft a work-around. I’ve documented it here.

More Uses for Generic Apache Logging

In my last post, I showed how it was possible to fix Apache logging so that it would properly log client IPs accessing a back-end through a reverse proxy. It turns out that logging request headers in that fashion can be handy in other contexts as well. Last night, while debugging a vexing and time-sensitive software issue, we found the need to figure out how large the payload of a POST operation was. The normal combined log format only shows the amount of data returned to the client, so I needed to start hacking again. It turns out that the Content-Length header that’s set during POSTs was just what we needed. I just added the following to our LogFormat directive, and we started getting the data we were looking for.

CL:%{Content-Length}i

Note that the “CL:” bit is just to make a distinction between the Content-Length size and other arbitrary numerical fields I’ve added to on to that logging format. It’s just a label, and not necessary to make things work.

How to fix logging of proxied IP addresses in Apache

Are your apache application server logs showing the IPs of your reverse proxy instead of the requesting client? This should help!

Fix Logging of Proxied IPs in Apache

Enjoy!