octopusgrabbus
octopusgrabbus

Reputation: 10695

Can Apache Be Configured To Run Clojure Web-Based Programs?

Note

The following question is similar to this SO post, but I am asking a slightly different question two years later.

Is it possible to run Clojure programs, like those created from lein new noir or a program that expects to process httpd from Apache without running Tomcat or having to install a Jetty server, much the way Perl programs can run with mod_perl and Python programs can run most typically with mod_wsgi?

Am I missing the point because Clojure web applications behave more like Java servlets, and need to be handled similarly to JSPs?

I am asking this, because I have a full Apache system already set up and configured, and would like the simplest way to introduce Clojure web applications into that environment.

Upvotes: 3

Views: 397

Answers (1)

Arthur Ulfeldt
Arthur Ulfeldt

Reputation: 91554

the short answer is: not reasonably.

In theory any program can be run by Apache and have requests proxied to it, and so you could write a program in clojure that expected web requiests from stdin and then write a mod_clojure that would pass the requests though none of the popular web frameworks would do this for you, and this would have some undesirable performance characteristics (intentional understatement).

The shortest path I see is to write a normal clojure ring application and run it in jetty, then have apache proxy the appropriate requests to it.

Upvotes: 7

Related Questions