Time Machine Problems After Snow Leopard Upgrade

I finally got around to upgrading my Mac Pro desktop to Snow Leopard a
couple of weeks ago, but I didn’t reconnect my Time Machine backup drive
until late last week. When Time Machine fired up it would endlessly hang
while starting the backup, or hang on a “clean up” operation, or in some
cases would crash the Finder entirely and force me to have to reboot the
machine.

My backup drive was connected via firewire, so on a whim tonight I
reconnected it via USB. So far no problems. I searched around a bit and did
find several references to firewire problems after Snow Leopard upgrades,
so I’m hoping that was the culprit. Just thought I’d post this in case
anyone else was having similar problems.

ColdFusion 8 on Snow Leopard

I did a clean install of Snow Leopard on my Mac Pro, and although I do 100% of my work on Linux these days, many of my colleagues use Macs so I thought I’d give installing ColdFusion 8 a shot.

First problem is the CF 8 intsaller won’t run without Rosetta, which is an emulation layer that allows Universal Binaries to run on Snow Leopard. (For those of you who aren’t aware, Snow Leopard does not run on PowerPC-based Macs.)

I decided not to install Rosetta, so that’s a non-starter. From what I understand if you have Rosetta it does work, but the JRun web server connector doesn’t. This is exactly the same as it was with CF 7, when you had to get the web server connector source code and compile it using Xcode. Not a big deal, but I don’t use JRun anymore and since it’s more or less a dead product at this point, I really encourage people to investigate other servlet containers like Tomcat. Short answer is it’s not worth my time to even worry about the web server connector.

So what to do? Since this is all Java you can use a WAR file generated on ANY machine, deploy it on Tomcat, and you’re good to go. I grabbed a WAR from my Ubuntu laptop, dropped that in Tomcat’s webapps directory, and it runs fine.

Just thought I’d throw that out there as another approach since in the big of Scroogling I did on the issue, it seems people are just twiddling their thumbs waiting for Adobe to release a patch for Snow Leopard.

Why wait? Scrape up another machine somewhere, fire up a VM, or beg a friend who’s not running Snow Leopard to generate a WAR for you, and move to a much more flexible development environment than you get with the standard ColdFusion install.

MAMBO: Serving Up CFML Apps On a Mac, On the Cheap

I know, yet another lame acronym, but hey–it’s no more lame than LAMP or LAMBDA and at least my flat panel iMac actually looks like a lamp. 😉 MAMBO stands for “Mac + Apache + MySQL + BlueDragon + Other Stuff” (yes, that’s a REEEAL stretch to get that last O in there, so if you have a better idea let me know!) and is a great way to serve CFML apps on the cheap if you have a spare Mac laying around. Read on for all the nitty-gritty details!

 

A few weeks ago I mentioned that I got rid of my dedicated server, moved my blog over to HostMySite, and moved some smaller sites that I was hosting over to my 15″ flat panel G4 iMac, so here’s the details on my MAMBO setup. I’m hosting this over my DSL connection and so far it’s working extremely well.

Since Mac OS X (I’m on Tiger now, 10.4.1 to be exact) already has Apache built in, the web server part of things is actually quite simple. Just go into your System Preferences, then to Sharing, then turn on Personal Web Sharing. Voila, Apache is running. What this gets you is only one site and one docroot, however, so obviously some tweaking is necessary to get multiple sites running. This involves two things: a DNS server and Apache virtual hosts.

DNS Server

I don’t know about you, but I tend to like keeping things as simple as possible, so I really didn’t want to get into hosting my own DNS server, and I wasn’t even sure if my ISP would allow that, so I looked for a way to host my DNS information somewhere else. I’m using dnsexit.com for this because it’s free, and it supports dynamic DNS (even though my IP address hasn’t changed since I got my service over a year ago). Other free DNS services tend to only allow subdomains of the DNS service domain (e.g. mydomain.dyndns.org), but with dnsexit.com you can have full domains as well as hosts, aliases, and MX records for each domain. Cool stuff. So basically I just set up each of my domains in dnsexit.com and pointed them all to my DSL’s public IP address.

Virtual Hosts

The second thing to do is edit the httpd.conf file on the Mac so it supports multiple virtual hosts. If you’ve ever worked with host headers in IIS this is the same concept, you just have to edit a text file and restart Apache to get this working. It’s really quite simple and once you know what you’re doing is actually a bit simpler than dealing with the wizards in IIS.

The httpd.conf file is located in your /etc/httpd directory, and you’ll have to use a terminal window to see it (it doesn’t show up in the Finder). Just open up a term window, navigate to that directory, and open up httpd.conf using pico (or your favorite text editor). You’ll likely have to use the sudo command because of the permissions on the file, so if you want to use pico your command will look like this:
sudo pico httpd.conf

After you enter this you’ll be prompted for your root password and then pico will open up the configuration file. What you’re looking for in this file is the VirtualHost section, and there is where you tell Apache “if someone hits this server using this URL, send them here.” Rather than go into details about this, I’ll point you to the Apache VirtualHost Docs for more information. There’s also some great articles on MacDevCenter about web serving on Mac OS X. Some are a bit dated but the general principles still apply, and you can find good information here about enabling PHP and all sorts of other good web server-related stuff.

While you’re in your httpd.conf file you might also want to set up the default documents so index.cfm will come up automatically. (Yes, if you’re still with me, this is all heading up to being able to serve CFML from the Mac for free!) See this article for more details on setting up your default documents.

Web Site File Placement

Finally, you of course need to know where to put your web site documents. Since we’re using virtual hosts and pointing Apache to the docroot for each site the files can more or less be placed anywhere, but for organizational purposes as well as keeping with the conventions of OS X, I just created a new directory for each site under /Library/WebServer/Documents.

OK, so at this point we have our DNS information in dnsexit.com, our virtual hosts set up in Apache, and our web site files in place. But what about a database? What about FTP? And most importantly, what about ColdFusion? Don’t worry–this stuff is all a snap as well.

Database Server

This is a no-brainer. MySQL is fast, free, extremely capable, and works great on OS X. Gone are the days when you had to compile the source code for MySQL on OS X; they now have a very slick installer that even puts a little startup program in the System Preferences panel. Download it, install it, love it.

I tend to just use MySQL from the terminal, but if you want some help with your MySQL administration, phpMyAdmin is a very nice browser-based admin tool. There is also a ColdFusion version called CFMyAdmin but I’m not sure it will work on the Mac with BlueDragon (I haven’t tried). There are also some nice Mac and Java database admin programs that will give you a GUI but you’d still be using straight SQL for the most part, so if you want to avoid SQL for stuff like creating tables, etc. phpMyAdmin might be the way to go. Check out SQL Grinder or Aqua Data Studio for the Mac/Java option, or for more information on enabling PHP on your Mac, see this MacDevCenter article.

FTP Access

Unless you want to maintain the sites of all your mooch friends that are using your MAMBO box instead of getting cheap hosting elsewhere, they’ll need FTP access. FTP is easy to enable on the Mac, but the issue is that for every FTP user you have to set up an account on your Mac for them. This is kind of a pain, and in my mind just isn’t a great idea.

Luckily there’s another way, and yes it’s free. (Sensing a trend here?) There’s a very nice FTP server manager called PureFTPd Manager that gives OS X users a nice GUI frontend for the PureFTPd server, which I’m assuming is what OS X uses under the hood since it’s based on BSD … all I know is I installed the PureFTPd Manager and didn’t have to install the server separately, and it seems to interact with the FTP checkbox in the sharing area of the System Preferences.

So the cool thing here is you can set up a single user and group (I just called mine virtualftp) and then use virtual users through PureFTPd Manager, which means you don’t have to create an account on the Mac for each FTP user. Slick. Just make sure you set the permissions correctly on your /Library/WebServer/Documents directory so the virtualftp user has the access it needs and the rest takes care of itself more or less.

I also gave one trusted soul ssh access because he likes to just log onto the server and edit directly using vi, so he’s happy with the MAMBO setup as well.

And saving the best for last …

CFML: Served by BlueDragon

By now most CFers are aware of New Atlanta’s alternative CFML engine BlueDragon, but if you aren’t, you need to be. It’s a great product, it’s supported for production use on the Mac, and they have a version that’s free to use in production environments. That’s right–free! Perfect price tag for the MAMBO box.

Basically all that’s involved here is to go to New Atlanta’s web site and download the free version of BlueDragon for Mac OS X and install it. It works great with the version of Apache that comes with OS X and configures itself automatically IF YOU READ AND FOLLOW THE INSTALLATION GUIDE. There are some symbolic links you have to set up to get it to work automatically and I strongly suggest you do this. If you set up the symbolic links and install BlueDragon while Apache is still running, then it will configure itself with Apache automatically. After an Apache restart you can serve up CF apps to your heart’s content! I’m pretty sure BlueDragon even sets itself up to start automatically when the server restarts, but make sure you read the BlueDragon guides for any issues related to that. Mine works, I just don’t remember if I had to do anything to get it to start automatically or not.

So there you have it, MAMBO in a nutshell. O’Reilly, I’m available to write up a book on this if you’re interested. 😉 I hope that helps some of you Mac folks out there (particularly the newbies) with getting a solid CF-serving environment set up on the Mac. And hey, with enough demand maybe Macromedia will make ColdFusion a first-class citizen on the Mac as well.

Comments

Just wanted to say that I really appreciate this article. PureFTPd is my FTP server of choice as well. I’ve been using it for various projects for almost 3 years now… Thanks agian!

Posted by Jordan Michaels @ 4/17/07 3:04 PM

O = OS X!

Posted by David @ 4/17/07 3:04 PM

OK, that’s the second vote for OS X, which honestly I think is probably better. I actually thought of that first but then thought it was redundant since “Mac” was already in there, but “other stuff” does seem kind of lame even though what I had in mind was PureFTPd and the other bits and pieces involved.

So “Other Stuff” or “OS X” or “Oh My!” (another suggestion from an email) is fine by me. 🙂

Posted by Matt Woodward @ 4/17/07 3:04 PM

How about:

O = Open Source Stuff

Great post by the way. We’re serving our website up at work on a DP G5 Xserve & Xserve RAID with BlueDragon JX. It flat out rocks. Just getting ready to upgrade to Tiger Server & BD 6.2, just want to set it up on a test box first.

Grant

Posted by Grant Gelinas-Brown @ 4/17/07 3:04 PM

Great article! I love CF but have been tied to Windoz servers because of it. This gives me hope that I can have my cake and eat it to.

Posted by Mark Aplet @ 4/17/07 3:04 PM

Further Clarification: Mach-II in a Shared Hosting Environment

A few more details came to light from a discussion on the Fusebox Forums, and thanks to Sean Corfield as usual for clarifying things.

To summarize, what the MACHII_APP_KEY variable does is sets the key in the Application scope struct that stores the data. In my case the issue I was seeing related to MACHII_APP_KEY was because I had installed the sample applications from the Mach-II site, and apparently others on my server had done the same thing, because unless I explicitly changed MACHII_APP_KEY to something other than the default (which just gets the path dynamically), it was apparently attempting to tap into someone else’s key. Specifically I was seeing errors related to the application not being able to find MachII.framework.* CFCs, even though my copy of the Mach-II no longer has the default MachII.* calls anywhere in it.

The long and short of all of this is that in a shared environment you need to be careful about how you name your directories in your Mach-II applications because this directory name is in essence what determines the key in the application scope for your application. For names I think other people might be using (like the Mach-II sample apps) I’ve taken to putting the “SFS” prefix before everything (abbreviation for my company name, “Sixth Floor Software“) and this seemed to do the trick. By the time my “real” project in a shared environment starts I should have these issues completely ironed out.