Wednesday, June 10, 2009

Deploying A Compojure "Hello World"

Tonight I got "Hello World" running on Compojure on my Slicehost slice. I modified the code to say "Clojure" instead of "Hello World", but otherwise it was straight cut and paste from the Compojure docs.

Deploying it was an epic, horrifying pain in the ass, and I would not attempt it again for love nor money. However, bear in mind, I only know the absolute basics of Apache config. I'm sure the problem would have been simple to an Apache expert, but I am not one.

Anyway, after wrestling with these horrible unreadable config files for hours, I decided to just say fuck it and I figured out a way to cheat. The config on my Slicehost blocks all incoming connections except for port 80 and port 443. I just opened up port 8080 to incoming connections and set it up to bypass Apache altogether.

In terms of actually building and uploading the app, it was quite painless. The pain only came in when Apache got involved. I said I wouldn't do it again for love nor money, but that really only applies to wrestling with Apache. The Compojure part was fun.