08.15.08

Two things this week

Posted in Technology, Linux at 2:37 pm by Stoner

Ok…Apache needs to do a better job at documenting how to build the software and what the defaults are. I’ve been building Apache for years, including the painful days of Apache 1.3 when you had to patch the module into the Apache source tree (I don’t want to hear about your “back in Apache 0.99 we had to hand edit the core.c to add modules, uphill, both ways” pains.) So, yesterday, I was setting up a server where I want to use Apache and the mod_proxy modules to front two Jboss servers for some experimentation. I downloaded the latest tarball, unpacked it and did a “./configure –prefix=/usr/local/work –enable-mods-shared=all” - foolishly thinking that all modules would get built as shared DSO objects. I mean, doesn’t “all” mean “everything?” I found that I was wrong.

After doing a “make && make install” I went and checked the fruits of my labor. Examining the contents of the modules directory revealed <drum roll> no mod_proxy modules. I didn’t even see mod_ssl. So I checked the config.log and saw that mod_proxy and mod_ssl were disabled. Shock. Surprise. Much swearing. Apparently, “all” does not mean “all” but rather “some.” I went back and added “–enable-proxy=shared –enable-sll=shared” to my ./configure command line and rebuilt.

If you’ve Linux/Unix long enough, you’ve come across the mknod command. It’s for creating special files and device files. One very useful special file is called a pipe, which is a simple queue. A process can write to the pipe while another can read whatever is written to it. This allows for multiple processes to share data using simple file handling code instead of more complex networking code.

Now, a pipe is a First In, First Out structure. There exists another, similar mechanism called a stack. This is a First In, Last Out structure - also called a Last In, First Out structure. It’s very handy. What would be even handier would be the ability to create a “stack special file” like you can a pipe using mknod.