June 2006 Archives

How to add mod_jk to apache on Mac OS X

| 1 Comment
The apache that ships with Mac OS X is still 1.3, not 2.0. Not that this matters, but it surprised me a little. Download mod_jk from apache.org. I used 1.2.15, which is what we use on our Linux machines at work. Compile mod_jk like this:
 cd jakarta-tomcat-connectors-1.2.15-src/jk/native
 ./configure --with-apxs=/usr/sbin/apxs
 cd apache-1.3 
 make -f Makefile.apxs
 sudo cp mod_jk.so /usr/libexec/httpd
Edit /etc/httpd/httpd.conf:
 #jk must be before rewrite
 LoadModule jk_module libexec/httpd/mod_jk.so
 LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
 .
 .  
 #jk must be before rewrite
 AddModule mod_jk.c
 AddModule mod_rewrite.c
Define your worker properties and jk mounts normally. Restart Apache:
  /System/Library/StartupItems/Apache/Apache restart

arping

I learned something new today about ARP caches.

I was working on this script for work to move an IP address (alias) from
one physical machine to another. (The way we have things set up is that
each of our physical servers has a primary machine-specific IP address. Each
application instance we run on that machine has its own IP address; so the
way we move an application/service is by simply assigning the IP to
another machine, and installing the files on that other machine.
We think it is a clever way of managing application instances.)

I ran into a problem where the IP would be taken down on machine A,
and successfully added to machine B. But only machines on the same subnet
as machine B would be able to ping the new address. Anything outside
would time out. Like our web servers, which kind of defeats the whole
purpose.

The problem was the ARP cache on the fancy Cisco switches we use.
They would refuse to re-arp when the ping failed. That seems silly
to me, but Cisco knows a lot more about networking than I do, so
I suppose there is a good reason for it.

In any case, our network dude (thanks Chris!) figured out that you can run
a utility on Linux called "arping" to cause the Cisco switch (or
anybody else nearby who has cached the old MAC address) to
invalidate the ARP cache and fix everything. Like this:

/sbin/arping -c 4 -U NEWIPADDR

I run that on machine B, and it clears up the problem. Yay.

Reference for kickstart commands

I have been unable to find an authoritative, recent source for kickstart commands. It's annoying because the automated install is so useful, and it's clearly still being used by a lot of folks who have very large Linux installations.

The best I have found is this section of an old Red Hat 6.2 doc set. Weird, huh?

In an earlier note, I documented how to create a kickstart server to do automated network installs for FC4.

I recently repeated the process for CentOS, and found a few things that I had forgotten about. This is a brief recap.

  1. You need to make sure you install a DHCP server, a TFTP server and Apache:

yum install tftp-server
yum install dhcp

2. Edit the dhcpd.conf as in the other article.

3. Edit /etc/xinetd.d/tftp and set "disable" to "no"

4. Use this rsync script:

#! /bin/sh
mirror=rsync://mirrors.kernel.org/centos
localdir=/var/www/html/centos-mirror
rsync -azvH --exclude-from=/l/etc/centos-rsync-exclude.txt $mirror $localdir
createrepo -q $localdir/4/updates
repoview -f -q $localdir/4/updates
createrepo -q $localdir/4/os
repoview -f -q $localdir/4/os
createrepo -q $localdir/4/extras
repoview -f -q $localdir/4/extras

This assumes you have repoview utility to make yum repositories web browse-able.

I try real hard not to say mean things on this blog. Really, I do. But give me a break:

200606131713

What it really means:

To use this product, you need to go to the store, buy a crappy operating system for $150 that will take 10 hours to install and patch, cost an extra $40-60 to protect it from viruses and spyware, and, oh you might actually need to buy a new computer to run it on. Then you can install this free software and see this video.

This isn't a dig so much as Microsoft, but rather at the ersatz media company, which decides to ignore 5% of its audience, and then has the gall to suggest that said audience needs nothing but "free software" watch its product.

Hey guys: quicktime (free viewer on all platforms); MPEG, MPEG2 (free viewers on all platforms); flash video (FREE VIEWERS ON ALL PLATFORMS!!). Media company's job: maximize audience (or maximize high-value demographic, I suppose). Media company's non-job: enhance monopoly power of a software company. Get a clue!