title: How To Integrate Clojure Web Applications in Apache
body: <p><strong>Note</strong></p>
  
  <p><em>Given this OP was written about two years ago, rather than ask the same question again, I am wondering if step-by-step instructions exist, so that I can integrate a Noir or other Clojure web application into Apache, whether it's Jetty, Tomcat, or something else. Similar instructions exist for Django, and I think I understand that Python is being run in Django's case as an engine rather than a ring framework, so things are more complicated with Clojure web applications.</em> </p>
  
  <p><strong>End Note</strong></p>
  
  <p>I'm deeply in love with Clojure, and Compojure seems like a neat web framework.</p>
  
  <p>But it all fell apart when I wanted to deploy my application on a regular application server like Tomcat as a WAR. I actually had to write custom Ring handlers for static files and resources that would work on both local Jetty and Tomcat because the stock handlers didn't, and I had to prepend the context root everywhere manually.</p>
  
  <p>I am negatively amazed that I had to write all this code to create the simplest web application conceivable that would run on both Jetty and Tomcat. I have only three possible explanations for this:</p>
  
  <ol>
  <li>Nobody uses Clojure/Compojure for anything other than local development with Jetty, i.e. in production</li>
  <li>Everybody deploys Clojure/Compojure apps on a dedicated Jetty without context root (LIke people do it with Node.js apps)</li>
  <li>There is a really simple way to circumvent the problems I ran into I wasn't aware of</li>
  </ol>
  
  <p>Which of these is in your opinion the case? Or is it something else?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Please note that creating a war file is a no-brainer with Maven/Leiningen and not what I mean. I'm wondering that I have to write so much code to make Compojure work with Tomcat, basic stuff like static file serving and context root awareness that <em>should</em> work out of the box.</p>