5

Is there an application server like Apache Tomcat that I can use with a Lisp like web language?

I've been playing a little bit with Arc/Anarki and Clojure lately. But what I really miss is something like mod_arc or mod_clojure for Apache. What I really miss is good Apache integration for a Lispy web language.

Both Arc and Clojure use their own built in webserver that you launch within your code. I want all the functionality, resiliency and scalability that Apache httpd gives me. Is anyone working on an Apache module for Arc or Clojure? Is there another Lisp like language that I can use with Apache?

I come from a background in PHP and Perl. But also have lots of experience in C and /bin/sh. Since when I started writing web apps I was using cgi-bin and stdin to C binaries.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Smutt
  • 81
  • 3

6 Answers6

7

You can set up a Clojure/Java HTTP server (Jetty, etc.) running on some port, then use Apache's mod_proxy to forward certain requests from Apache to Clojure on that port. Something like this in your Apache configs:

    ProxyPass /static !
    ProxyPass /cgi-bin !
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

So Apache will send every request to your Clojure app on port 8080 except requests to things in /static and /cgi-bin, which Apache will handle itself.

Brian Carper
  • 71,150
  • 28
  • 166
  • 168
6

Maybe mod_lisp would work?

Verbeia
  • 4,400
  • 2
  • 23
  • 44
pjb3
  • 5,191
  • 5
  • 25
  • 44
6

Hunchentoot, a web server in/for Common Lisp, can also be used behind Apache, through mod_lisp2.

octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131
Svante
  • 50,694
  • 11
  • 78
  • 122
  • This is pretty much the standard solution for Lisp web deployment; Hunchentoot running the app with Apache/Nginx/Lighttp/what-have-you out front handling the static content/SSL certs. – Inaimathi Jul 14 '12 at 22:00
6

Using Clojure and Compojure, you can generate WAR-archives that can be deployed in pretty much any Java EE-webserver (Jetty, Tomcat etc.).

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
pmf
  • 7,619
  • 4
  • 47
  • 77
3

Clojure is a JVM language, so you should be able to set it up pretty much like any other Java app.

Chuck
  • 234,037
  • 30
  • 302
  • 389
-1

Why not use CGI?

alamar
  • 18,729
  • 4
  • 64
  • 97