Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

apache

clojure

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.

like image 376
octopusgrabbus Avatar asked Aug 23 '26 18:08

octopusgrabbus


1 Answers

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.

like image 190
Arthur Ulfeldt Avatar answered Aug 26 '26 22:08

Arthur Ulfeldt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!