[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: cgilua/kepler in a shared hosting environment ?
- From: gary ng <garyng2000@...>
- Date: Tue, 13 Mar 2007 17:31:04 -0700 (PDT)
--- Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br>
wrote:
> Hi Gary
>
> > On the dreamhost setup, I have to either name the
> > launcher as launcher.fcgi(anything with the fcgi
> > extension) or put it in a say cgi-bin directory.
> > Either case, by the time it is called, the
> > SCRIPT_NAME/SCRIPT_FILENAME would be set to
> > launcher.fcgi and not the real script which would
> be
> > doing the interesting job.
> >
> > In other words, the launcher(provided in kepler)
> don't
> > know what script to run as it see itself as the
> script
> > name.
> I think I told this before :-)
> Let's put the cgi launcher in the cgi-bin
> directory.
> Now let's put a file called "test.lua" in your web
> root
> directory (htdocs, for instance). The "test.lua"
> file should
> be something like:
>
> cgilua.htmlheader()
> cgilua.put"Hello World!"
>
> Now try the URL:
>
> http://your.server/cgi-bin/cgi/test.lua
>
> I think this should work. Apache will notice that
> the URL refers to a script by reading the following
> part of
> the URL:
>
> http://your.server/cgi-bin/cgi
>
> The launcher should be called and it will parse the
> rest of the string (/test.lua) to know what to do:
> run the
> named script. The cgi launcher will call CGILua,
> which
> expects this format of URL and it will fail
> otherwise.
This is what I got :
The requested URL /cgi-bin/cgi/abc.lua was not found
on this server.
> With FastCGI the configuration is a little bit
> different
> but it follows the same structure: the FastCGI
> Apache module
> must call the fastcgi launcher which will call
> CGILua to parse
> the rest of the URL to find what script to execute.
>
The point is, the dreamhost setup seems to expect the
URL as a fastcgi application by itself and don't have
the concept of "launcher". For it, the URL is the end
thing, It would not search for a launcher to handle
that URL.
My solution end up with modifying the
sapi.fastcgi.request.lua and reconstruct the
"SCRIPT_NAME" as expected by cgilua and use
mod_rewrite to load the lua launcher(not the C
compiled executable, just fastcgi.lua).
BTW, what is the advantage of embedding
fastcgi.lua/cgi.lua into a C and turn it into an EXE ?
Is it mainly for Windows
BTW2, I found a bug in cgilua.lua in the pcall()
function for its use of (...), which was mentioned a
day or two ago on this thread. Already file a bug
tracker on forge.
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097