Compojure on a Slicehost VPS

This article has been archived because much better Clojure resources are available now. Some of my favorite Clojure learning resources include Learn Clojure and Clojure web applications on Heroku. You can also find commercial support at Clojure Core.



Filed under Programming

18 responses to “Compojure on a Slicehost VPS

  1. rzezeski

    I’ve been meaning to start learning Compojure. This was the perfect kick-start. Thanks!

  2. Thanks for the feedback, rzezeski. Building a Compojure application has been a lot of fun so far. If this article inspires someone else to start building, then it was definitely worth writing. Hopefully I can finish a second article in the next few days.

  3. Pingback: Using PostgreSQL with Compojure « Eric Lavigne

  4. Mathias Dahl

    I can only agree with rzezeski, this was a great kickstart! I have developed a couple of small web apps using webjure, another web framework for clojure which runs under Tomcat (or similar, I assume), but development of it seems to have stopped. Also, compojure looked more powerful the last time I checked.


  5. Pingback: Autodidact » Blog Archive » On Clojure: A close look at Luke VanderHart’s Markov Chain generator

  6. Pingback: Clojure roundup « Clojure Study Group DC

  7. arjun

    hey, thanks for the post, eric. just trying out compojure myself. all your steps seem to work great, until I try to execute the simple web app:

    root@arjun:~/site# ./run
    Caused by: Could not locate compojure/http__init.class or compojure/http.clj on classpath:

    any thoughts/ideas? sorry for being such a n00b 🙂

  8. Arjun, this is definitely NOT your fault. There have been some recent changes to Compojure, and I haven’t yet found time to update these articles.

    At the beginning of the program, there are two lines of code for importing libraries:

    (use ‘compojure.http)
    (use ‘compojure.jetty)

    Try changing them as follows:

    (use ‘compojure.http.servlet)
    (use ‘compojure.http.routes)
    (use ‘compojure.server.jetty)

    The other articles have similar issues. I hope to fix those issues in the next few days. Until then, please feel free to ask for help with any problems you encounter.

  9. I just finished updating the code in this article for the latest version of Compojure.

    If you are still using an old version of Compojure, use the following commands to update to the latest version:

    cd /root/install/compojure
    git pull

    The other two articles also need to be updated. I will place a comment like this one at the bottom of each article after I finish updating them. I hope to finish by the end of the day.

    I am preparing to deliver a Clojure presentation to a Java user group in mid-February. I will definitely post my slides later.

  10. arjun

    awesome, i’m up & running now. thanks, eric.

  11. Thanks Eric for sharing this information.

    I’d like to mention there’s more slice set up and lock down tips in the slice setup article for Ubuntu Hardy:

    It’s important to disallow root login via ssh, and there are a few more good tips in there.

    Welcome to Slicehost.


  12. Thanks, this was really helpful as I set up my blog in Clojure.

  13. Thanks for the good post – you might want to add ant deps before ant (I got
    /home/compojure/install/compojure/build.xml:34: /home/compojure/install/compojure/deps not found.”
    until I went to and saw that addition)

  14. You can abbreviate the classpath with “java -Djava.ext.dirs=/root/install/compojure/deps” — there is no need to list every jar individually on the classpath.

  15. Pingback: Setting up clojure « Follow the Data

  16. Martin

    I needed – in addition to the above – to do the following:

    Add the partner sources to sources.list:
    deb karmic partner
    deb-src karmic partner

    Change the default jvm:

  17. Daniel Cotter

    Great article. Here’s the script that ended up working for me, a slightly modified version of one that somebody else linked to:


    for f in $COMPOJURE_DIR/deps/*.jar; do

    java -cp $CLASSPATH clojure.lang.Script $1

  18. Will

    I know this post is old(er), but instead of screen, you can use `nohup`. Also, instead of a massive classpath, you can throw your jars in a `lib` directory and use `java -cp “lib/*” clojure.main page.clj`, which might be easier.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s