Upgrading to Mac OS X 10.3 (Panther) brings some really nice enhancements to the OS, but if you're like me and have Tomcat and MySQL installed on your Mac, or have customized httpd.conf, you need to be a little careful to make sure you keep those installations intact during the upgrade process.
If you do an in-place upgrade install, you may well survive with everything intact. But most people recommend the "archive-and-clean" install, where your old system folder is renamed and a new clean install is created, while your user directories are left intact. The only problem with this is that anything that you normally install outside your user directories will need to be either moved back into place, or in some cases saved and re-installed or otherwise reconfigured. But it's still the better way to go.
In my case there were 3 things to get back in working order after installing Panther. First was the Apache configuration. Second was Tomcat. Third was MySQL.
Apache
The Apache configuration file is located here:
/private/etc/httpd/httpd.conf
I recommend saving a copy of this file before upgrading, and then merging back any desired changes afterwards. I actually used CodeWarrior's nice visual diff feature (the Compare Files dialog) to see the old and new side-by-side and to let it do the merge of the particular changes I still wanted. In my case, the changes I still wanted were things like enabling server-side includes, .shtml files, and changing the location of the document root.
Tomcat
Tomcat normally gets installed here:
/Library/Tomcat/
In addition, the startup script files are located here:
/Library/StartupItems/Tomcat/
Fortunately, after the archive-install completes, both of those directories are simply moved into the old system backup area. Since I didn't have junk left around from a previous such install, these could be found here:
/Previous Systems/Previous System 1/Library/Tomcat/
/Previous Systems/Previous System 1/Library/StartupItems/Tomcat/
To restore Tomcat, simply move these two directories back to their normal install locations. To test that Tomcat starts up correctly, run these commands:
> cd /Library/StartupItems/Tomcat/
> ./Tomcat
You should hear a bunch of disk activity as Tomcat starts up, and then you should be able to access any Tomcat web apps as usual. Of course, those web apps that connect to the MySQL database will not work yet, hence the next section!
MySQL
MySQL normally gets installed here:
/usr/local/
In particular, there is a subdirectory whose name contains the exact version number of MySQL, and a symbolic link to it bearing the short name "mysql".
MySQL also has a startup script usually installed in:
/Library/StartupItems/MySQL/
The MySQL files are also simply moved into the old system backup area: (the actual name is version-dependent)
/Previous Systems/Previous System 1/usr/local/mysql
/Previous Systems/Previous System 1/usr/local/mysql-standard-4.0.13-apple-darwin6.4-powerpc
You can move the MySQL directory back to its proper place, but you can't just move the symbolic link, because it points to the backup location. Instead, create a new symbolic link after you copy the directory with the ridiculous long name:
> cd /usr/local/
> ln -s mysql-standard-4.0.13-apple-darwin6.4-powerpc mysql
You may well also need to fix the ownership of the MySQL database files. I found that these were set to my ID even though they should really be owned by "mysql". This was remedied with:
> cd /usr/local/mysql/data/
> sudo chown -R mysql .
After moving the MySQL startup script to its proper place, try running it manually to make sure the Tomcat webapp can reach MySQL, or if you have phpMyAdmin installed, just try logging in to the MySQL interface.
I hope this helps someone. It took some trial and error and digging around to figure out that it was actually pretty simple and predictable where things were saved to.
Extra Tricks
I keep my home directory on a little external FireWire drive, so that I can carry it from home to work and take my personal data and documents with me -- things like email, iTunes library, web site, etc.
To make this work you have to point your account to the external home directory in the NetInfo Utility. You have to configure each machine that you're going to use with a relocated home directory. The command shown below needs to be run once on each such machine to let it know where your home directory is. My external drive is named spock, so I set it up with the following command:
> sudo niutil -createprop / /users/trygve home /Volumes/spock/Users/trygve
To make Apache serve files from a document root on the external drive, I change a couple of variables that by default point to "/Library/WebServer/Documents", to instead point to where I keep the stuff:
DocumentRoot "/Volumes/spock/Users/trygve/Documents/Web/bombaydigital/bombaydigital"
<Directory "/Volumes/spock/Users/trygve/Documents/Web/bombaydigital/bombaydigital">
To make Tomcat live on the external drive, I created a symbolic link, on any machine I want to use it from:
/Library/Tomcat is a link to /Volumes/spock/Library/Tomcat
To make MySQL live on the external drive, I simply created a symbolic link, on any machine I want to use it from:
/usr/local/mysql is a link to /Volumes/spock/usr/local/mysql-standard-4.0.16-apple-darwin6.6-powerpc
These changes allow me to keep my home directory, Tomcat environment, MySQL environment, and Apache documents on the external drive.