I spent some time with a colleague from South Africa yesterday. He’s a long-time Windows user that writes in Java. He has a new MacBook Pro, and we scratched our head why Apache+mod_jk+Tomcat was blowing up on him.
The first thing we had to get right was the JAVA_HOME variable. If it’s not set right when compiling mod_jk, you’re out of luck. On OS X there is a program that spits out the right value. We put the following in his ~/.profile. Please note the back ticks (accents graves) to run the java_home program.
With $JAVA_HOME set correctly, compiling mod_jk was straightforward. Download the mod_mod_jk tarball, unpack it, and change directories to the native subdirectory. The following should work cleanly.
$ ./configure --with-apxs=/usr/sbin/apxs
$ make clean ; make
$ sudo make install
Apache Configuration File
Be aware that OS X Lion has some lines (commented out) for support for mod_jk. Be sure to uncomment those lines. Previous versions of OS X don’t have these lines, so you’ll just add the load module directive and Jk* commands in the usual places.
That’s it, really. Once JAVA_HOME and the Apache configuration file were straightened out, things worked.
I downloaded a development tool to give it a trial run today. It reported that git support was disabled because it wasn’t on the path. I thought this odd since it works in Terminal. It turns out that the UI uses a different PATH than Terminal. That’s a topic for a different article.
The path to git is /usr/local/git/bin/git, but this cannot be selected in a file open dialog since /usr (along with other system directories) is hidden. 99.9% of the time this is no problem. Anybody who needs to dig into those directories will drop to the command line instinctively. However, this tool offered no place to type in a path. Only the file open dialog was available.
It turns out that there is an undocumented (or poorly documented) key combination to show and hide hidden folders and files. Press Command-Shift-Period (⌘⇧.) to toggle hidden files and folders on and off.
I use Preview’s ability to manage pages in PDF files after scanning pages into the computer (points number two and three). Ofttimes the back side of the page gets scanned in (I frequently use green engineering paper twenty years after college) and I want to remove those from the PDF. I also will merge pages from PDF. Drag. Drop. Save. Done.
I ran across a Macworld article called Preview’s Hidden Powers that lists of the capabilities of the built-in Preview tool in OS X. It lists a couple of other uses that you might find useful.
Developers, and power users in general, tend to like using the keyboard for moving around because it’s ofttimes faster to push a key or two than pick up the dominant hand, grab the mouse, click, then move the hand back to the keyboard.
The default behaviour on OS X is to skip drop-down (“list box”) controls when using the tab key to move around, which is at odds with using the keyboard for navigation. But, this can be changed in System Preferences.