Re: [Cppcms-users] Integrated FastCGI module
Brought to you by:
artyom-beilis
|
From: Sab <rim...@gm...> - 2012-12-18 14:52:13
|
Thanks for the answers.
I built the hello word app and configured my Lighty to look for the application
on port 9000 as a FastCGI module. It seems to work fine, the main function gets
called and I can send a response back to the server. So that looks just fine.
But as soon as I configure Lighty to run in authorizer mode, my application does
not receive the request. As far as I understand the authorizer mode, the server
should first send the request to the FastCGI module, the module should decide if
the access is granted or not and return accordingly a 200 or 401 as status in
the response. But I don't receive the request in my CppCMS app. According to the
server's error.log, the fastcgi module is called and it returns immediately with
no further comment, so it goes on to find the physical path (which in my case
does not exists but that shouldn't be the reason not to execute the FastCGI
function).
What am I doing wrong?
My config.js:
{
"service" : {
"api" : "fastcgi",
"port" : 9000,
"ip" : "127.0.0.1"
}
}
The critical parts of my lighttpd.conf:
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite"
)
fastcgi.server = (
"" =>
(( "host" => "127.0.0.1",
"port" => 9000,
"check-local" => "disable",
"docroot" => "/",
"mode" => "authorizer"
))
)
This is my error.log:
2012-12-18 13:15:16: (request.c.304) fd: 8 request-len: 406
GET /test24 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.16) Gecko/20120511
Iceweasel/3.5.16 (like Firefox/3.5.16)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
2012-12-18 13:15:16: (response.c.241) run condition
2012-12-18 13:15:16: (response.c.300) -- splitting Request-URI
2012-12-18 13:15:16: (response.c.301) Request-URI : /test24
2012-12-18 13:15:16: (response.c.302) URI-scheme : http
2012-12-18 13:15:16: (response.c.303) URI-authority: localhost
2012-12-18 13:15:16: (response.c.304) URI-path : /test24
2012-12-18 13:15:16: (response.c.305) URI-query :
2012-12-18 13:15:16: (response.c.349) -- sanatising URI
2012-12-18 13:15:16: (response.c.350) URI-path : /test24
2012-12-18 13:15:16: (mod_access.c.135) -- mod_access_uri_handler called
2012-12-18 13:15:16: (mod_fastcgi.c.3636) handling it in mod_fastcgi
2012-12-18 13:15:16: (response.c.470) -- before doc_root
2012-12-18 13:15:16: (response.c.471) Doc-Root : /var/www
2012-12-18 13:15:16: (response.c.472) Rel-Path : /test24
2012-12-18 13:15:16: (response.c.473) Path :
2012-12-18 13:15:16: (response.c.521) -- after doc_root
2012-12-18 13:15:16: (response.c.522) Doc-Root : /var/www
2012-12-18 13:15:16: (response.c.523) Rel-Path : /test24
2012-12-18 13:15:16: (response.c.524) Path : /var/www/test24
2012-12-18 13:15:16: (response.c.541) -- logical -> physical
2012-12-18 13:15:16: (response.c.542) Doc-Root : /var/www
2012-12-18 13:15:16: (response.c.543) Rel-Path : /test24
2012-12-18 13:15:16: (response.c.544) Path : /var/www/test24
2012-12-18 13:15:17: (mod_fastcgi.c.3061) got proc: pid: 0 socket:
tcp:127.0.0.1:9000 load: 1
2012-12-18 13:15:17: (mod_fastcgi.c.1492) released proc: pid: 0 socket:
tcp:127.0.0.1:9000 load: 0
2012-12-18 13:15:17: (response.c.561) -- handling physical path
2012-12-18 13:15:17: (response.c.562) Path : //test24
2012-12-18 13:15:17: (response.c.618) -- file not found
2012-12-18 13:15:17: (response.c.619) Path : //test24
2012-12-18 13:15:17: (response.c.128) Response-Header:
HTTP/1.1 404 Not Found
Content-Type: text/html
Content-Length: 345
Date: Tue, 18 Dec 2012 12:15:17 GMT
Server: lighttpd/1.4.28
Any suggestions?
Thanks,
Sab
|