From: Trastabuga
Subject: Integration of CL-EMB with Apache or Hunchentoot
Date: 
Message-ID: <1176689582.721346.243710@n59g2000hsh.googlegroups.com>
Looking at CL-EMB examples it looks like the embedded lisp should work
in the same way as PHP does (the example of cl-who and cl-emb). But
PHP is integrated in Apache with some special module which is not the
case for Lisp.
I don't understand how Apache would generate an html page with lisp
inserts. Same question goes for Hunchentoot, which doesn't seem need
CL-EMB as everything there is written in Lisp anyway. I asked the
question to the CL-EMB newsgroup but it got no answer within a few
days.
I basically need to understand how to integrate CL-EMB with Apache or
Hunchentoot.
Sorry if my question is trivial, I am a newbie.

Thank you,
Andrew

From: Edi Weitz
Subject: Re: Integration of CL-EMB with Apache or Hunchentoot
Date: 
Message-ID: <uslb0ygdz.fsf@agharta.de>
On 15 Apr 2007 19:13:02 -0700, "Trastabuga" <·········@gmail.com> wrote:

> Looking at CL-EMB examples it looks like the embedded lisp should
> work in the same way as PHP does (the example of cl-who and
> cl-emb). But PHP is integrated in Apache with some special module
> which is not the case for Lisp.

You don't need this special module.  You can also use PHP as a
stand-alone application.  Likewise, I guess, you can use CL-EMB
stand-alone.

> I basically need to understand how to integrate CL-EMB with Apache
> or Hunchentoot.

The CL-EMB website links to CL-WIKI which seems to have code to
integrate CL-EMB with TBNL, the predecessor of Hunchentoot.  That
should give you an example to look at.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Robert Uhl
Subject: Re: Integration of CL-EMB with Apache or Hunchentoot
Date: 
Message-ID: <m3d52444gj.fsf@latakia.dyndns.org>
"Trastabuga" <·········@gmail.com> writes:
>
> I basically need to understand how to integrate CL-EMB with Apache or
> Hunchentoot.

Well, first things first.  Let's ignore Apache for a second.  You'll
start up a Hunchentoot server (see the docs for how) and then set up
some handlers (ditto).  Within a handler function, you can do anything,
including calling CL-EMB.  So you call EXECUTE-EMB and Bob's your
uncle.  IIRC it defaults to *standard-output*, and I think that
Hunchentoot handlers bind that to the response's textual output, so you
shouldn't have to do anything more.

As for Apache, you can configure it as a front-end for the Hunchentoot
server using mod_proxy, or you can configure it to talk directly to
Hunchentoot via mod_lisp.  I believe the Hunchentoot docs discuss both
alternatives.  For now, though, just start a Hunchentoot server on some
non-well-known port (e.g. 1234) and play with it as
<http://localhost:1234/>.

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
Your chances of being mugged in London are now six times greater than
in New York.  You're also twice as likely to be shot by the mugger in
any particular encounter, even if you don't resist.  High law levels
do not consistently translate to less crime.             --John Kwon
From: Edi Weitz
Subject: Re: Integration of CL-EMB with Apache or Hunchentoot
Date: 
Message-ID: <uwt0cxltw.fsf@agharta.de>
On Mon, 16 Apr 2007 11:25:00 -0600, Robert Uhl <·········@NOSPAMgmail.com> wrote:

> So you call EXECUTE-EMB and Bob's your uncle.  IIRC it defaults to
> *standard-output*, and I think that Hunchentoot handlers bind that
> to the response's textual output

No, it doesn't.  The default behaviour is that handlers have to return
strings or binary content.  So, you'd do something like (untested):

  (with-output-to-string (*standard-output*)
    (execute-emb ...))

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")