How to find a web hosting service for running Compojure
I am very interested in building a website using Clojure and Compojure, like so:
http://briancarper.net/blog/deploying-clojure-websites
However, due to my limited experience with the Java environ开发者_开发百科ment and Java culture, I am not sure where to begin when shopping for a web-hosting service.
Do I simply need to find a service that gives me full root access and has the JDK/JVM? Or are there other requirements as well?
I use Linode 540. Any Linux VPS will probably work fine. You can install the JVM and anything else you need yourself. Depending on what kind of site you're running, you should try to get a lot of RAM, because the JVM can be RAM-hungry.
I'd probably go for Google AppEngine (well, in fact I'm planning to do that sooner or later).
Here's some reading to get you started:
Interactive Programming with Clojure, Compojure, Google App Engine and Emacs
Clojure on GAE
Clojure on Google AppEngine
Heroku now do clojure hosting: https://gist.github.com/1001206 - it's brand new, so no idea how reliable it is, but could be a great starting point.
You just need root access + a JVM. Once you have that, working with Compojure (and its embedded Jetty) is just like it is on your desktop.
I recommend Rackspace Cloud (http://www.rackspacecloud.com/). It's pay-as-you-go, which is great for testing, and leaving a server running full-time only costs around $12/mo for their small instance. Plus it makes it really easy to test distributed applications. They've got a great admin console and API. (I have no affiliation with Rackspace other than being a satisfied customer).
If you want to use a more robust/mainstream Java server instead of Jetty, you can deploy a WAR bundle of your application to Tomcat, Glassfish, Weblogic, etc. Installing and configuring those is beyond the scope of this question, but deploying a WAR to them is a straightforward, well-documented procedure.
Edit:
As the other commenter mentioned, if you just want to get started playing with Compojure, you can do it easily on your local machine. There's no need to move to a server until you want to start serving pages publicly.
Look into one of the many VPS solutions out there. Slicehost and Linode both seem popular. You can also host Clojure+Compojure applications on Google App Engine.
You could also look at Amazon's Elastic Beanstalk, and CloudBees. I can't comment on which of these is best for clojure because I am in the research stage myself. This might be useful in deciding which to go with:
http://www.ibm.com/developerworks/java/library/j-paasshootout/?ca=drs-
UPDATE: this looks quite interesting (even if the name sounds like something you'd pick up at an adult toy shop): http://www.jelastic.com/
You should also be able to get started for free with AWS Free Usage Tier with a free EC2 micro instance http://aws.amazon.com/free/
精彩评论