Here's how I keep my server setup and running (buyer beware, and all that).
I use fink for some packages that I've had notorious problems compiling (mainly OpenSSH). Fink installs (by default) to /sw, although it could just as easily be /usr/local. Unix directory structure would suggest /usr/local, but there are a few reasons I avoid that (mainly, sometimes packages will install to /usr/local. I would like to keep my production sw totally separate than anything else, so /sw works. Avoids confusion, keeps it cleaner, but this doesn't really matter).
So I install what I want with fink, into /sw, which yields the traditional ./bin/ ./lib/ ./share and all that. For software I compile myself (MySQL, PHP, Apache, a few other minor ones), I configure with the --prefix flag set. So, using apache for an example, let's say that I have 2.0.54 (stable) installed, running my production line website. Directory structure:
/sw/apache2.0.54
./bin
./sbin
./lib
./mod
... And all the other directories that apache installs. Out of curiousity (but remembering the lessons learned from the whole cat thing), I want Apache 2.2. Simple!
in the source directory, ./configure --prefix=/sw/apache2.2.xx
This will give you a structure like:
/sw/apache2.2.xx
./bin
./lib
and so forth.
Then I can play with apache2.2 all I want -- I usually set it up to use a different port than normal, open that port on my firewall, do an IP restriction, and try my damndest to break / crack / evaluate 2.2. If I like it, I just change a few conf files for startup to point towards apache2.2.xx, and the switch is made!
This is good for bugfixes, minor revisions, and evaluating new versions. You can also leave the old, stable, venerable apache installs there in case you need a quick rollback. If you do that, though, I recommend using Access Control Lists to make sure that someone doesn't manage to start the old apache and cause you conflicts.
Hope this helps one and all!
Cheers,
Travis