lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


	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.

> > therefore, your script will have the cgilua API
> > already available.  also, 
> > there's no need for the "#!/bin/lua" line, since it
> > won't be 'executed' by 
> > the system.
> > 
> Yes, that again assume the launcher is being called
> which would arrange the environment. It is how to pass
> this info(what interesting script to run) to the
> launcher that is the question. As it is kind of being
> "pushed" one level down, IOW, the launcher can only be
> the script, not the launcher on dreamhost.
> 
> I did some experiment with the fastcgi-magnet which I
> have to "re-construct" the SCRIPT_FILENAME/SCRIPT_NAME
> based on the one in the environment(passed by the
> dreamhost launcher) and the REQUEST_URI to derive the
> real script name.
	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.

	Tomás