Le 22/12/2010 11:48, Alexander Konotop a écrit :
Hello. Does anyone have experience in using neko as a web backend
without apache? I have set it up in lighttpd and even in IIS.
Everything's good but HTTP input data - I can't recieve POST/GET.
1. That's how simply lighttpd handles neko:
server.modules += ( "mod_cgi" )
cgi.assign = ( ".n" => "/usr/bin/neko" )
And that's all I've done in server config.
2. Code in haxe:
//Gettest.hx
class Gettest {
public static function main()
{
trace(neko.Web.getParamsString());
}
}
//gettest.hxml
-neko gettest.n
-main Gettest.hx
3. CGI output:
// http://localhost/nekocgi/gettest/gettest.n?a=2
Gettest.hx:5:
// nothing?
4. nekotools server output:
// http://localhost:2000/gettest.n?a=123&b=1234
Gettest.hx:5: a=123&b=1234
In truth I do not understand how nekoserver redirects
POST/GET data to nekovm. So I don't understand how to make another
server (nginx, lighttpd, IIS, or any other) do the same.
In the case of mod_neko everything's clear: mod_neko is a part of
apache.
Last time I started thinking about using nekoserver as a backend and
lighty as a frontend (same way as a popular combination of
nginx+apache). But nekoserver isn't known to be recommended on a
production server.
So what can you advice? Not to waste time and install apache? I don't
like it... And what can you say about performance in CGI mode? In case
of (for example) Perl every time when request comes to a web-server the
interpreter is loading from HDD to memory, so CGI is slow. But neko is
really small!!! So I thought it will be quiet fast. Am I wrong?
CGI runs commands, so your web server will run the following command :
neko /absolute/path/to/gettest.n
http://localhost/nekocgi/gettest/gettest.n?a=2
If you look at neko.Web implementation (in haxe/std/neko/Web.hx) you'll
see that if neko is not run from inside mod_neko, it will use the first
argument as URL. This has not been tested a lot, but should work.
I wonder how CGI sends POST data, maybe through environment variables ?
Try printing neko.Sys.environment()
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)