Apache + FastCGI + Win32
Скомпилировал и установил FastCGI Perl 0.66. Написал просой FastCGI скрипт (c:/usr/bin/perl - это там где мой перл стоитl)
test.fpl
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard :html3);
use CGI::Fast qw(:standard :html3);
use CGI::Carp qw/fatalsToBrowser/;
print header;
Если не пускать через веб вышеприведенный скрипт то он работает.
У меня кстановлен 1.3.22
Apache/1.3.22 (Win32) mod_fastcgi/2.2.12 PHP/4.2.0 running...
Я сконфигурировал его чтобы он работал с FadtCGI скачав с fastcgi.com dll'ку
Добавил в конфу следующую информацию:
httpd.conf:
LoadModule fastcgi_module mods/mod_fastcgi-2.2.12.dll
# (mod_fastcgi-2.2.12.dll is in C:/Apache/mods/)
AddModule mod_fastcgi.c
# in
<IfModule mod_mime.c>
AddType application/x-httpd-fcgi .fcg .fcgi .fpl
AddHandler fastcgi-script .fcg .fcgi .fpl
</IfModule>
В результате получил 500 Server Error в логи обнаружил:
[Thu Dec 05 15:13:09 2002] [error] [client 127.0.0.1] (109)The pipe has been ended: FastCGI: comm with sever "c:/ap
ache/htdocs/ru/test.fpl" aborted: PeekNamedPipe() failed
[Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 2628)
[Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 2628) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:19 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 4076)
[Thu Dec 05 15:13:19 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 4076) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:24 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 1768)
[Thu Dec 05 15:13:25 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 1768) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:29 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 2364)
[Thu Dec 05 15:13:29 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 2364) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:34 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 2212)
[Thu Dec 05 15:13:35 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 2212) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:39 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 900)
[Thu Dec 05 15:13:39 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 900) terminated wit
h exit with status '0'
[Thu Dec 05 15:13:44 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 1264)
[Thu Dec 05 15:13:44 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 1264) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:49 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 3732)
[Thu Dec 05 15:13:50 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 3732) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:52 2002] [notice] FastCGI: process manager initialized
And
[Thu Dec 05 15:13:49 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 3732)
...
Пока апач с FastCGI модулем не перерестартовал строки так и появлялись....
Подскажите где грабли?Content-Disposition: form-data; name="attach"; filename=""
Content-Type: application/octet-stream
Spot Spot 2002-12-06 17:12:01
And
[Thu Dec 05 15:13:49 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 3732)
...
Пока апач с FastCGI модулем не перерестартовал строки так и появлялись....
Подскажите где грабли?
Hello Rob,
Monday, December 9, 2002, 5:14:09 AM, you wrote:
>> use strict;
>>
>> use CGI qw(:standard :html3);
>> use CGI::Fast qw(:standard :html3);
>> use CGI::Carp qw/fatalsToBrowser/;
>>
>> print header;
>>
>> that runs smoothly by Perl, using FastCGI.
RS> There is no accept loop!? See the CGI::Fast docs.
You're right.
I've been programming FastCGI applications for a year. And
the last three months I thought that a program like
#!/usr/bin/perl -w
use strict;
use CGI::Fast qw(:standard :html3);
print header;
should work but should have no benefits of FastCGI application. So I
wrote as simple FastCGI program as possible and wrote it in a wrong
manner. As there was no FastCGI loop. I forgot that when I first tried
FastCGI a year ago it didn't work for me exactly because of this.
Actually it should have been written like
#!/usr/bin/perl -w
use strict;
use 5.004;
use CGI::Fast qw(:standard :html3);
my $Counter = 0;
while (new CGI::Fast) {
print header;
print h3("$Counter++ $$");
}
And it would work with the earlier dll published at fastcgi.com too.
It was really stupid of me. I should have tried one of my other programs
first. :(
If I put an exit after print h3("$Counter++$$"); it wouldn't have the
benefits of FastCGI. But the first program is completely wrong.
RS> I believe this problem was fixed in later version. Please use the latest
RS> dll/so from fastcgi.com/dist (I just put a new snap up).
Yes it did fix it. Thanks. You've a broken dll link from an index page
though now.
>> [Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server
>> "c:/apache/htdocs/ru/test.fpl" restarted (pid 2628)
>> [Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server
>> "c:/apache/htdocs/ru/test.fpl" (pid 2628) terminated wi
>> th exit with status '0'
RS> If there is no accept loop, this is what you'll see - your application isn't
RS> staying running.
Yes, now with the messages like (the new snap)
[Mon Dec 09 11:26:44 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 2496) terminated wi
th exit with status '0'
[Mon Dec 09 11:26:44 2002] [error] [client 127.0.0.1] (109)The pipe has been ended: FastCGI: comm with server "c:/a
pache/htdocs/ru/test.fpl" aborted: GetOverlappedResult() failed
[Mon Dec 09 11:26:44 2002] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "c
:/apache/htdocs/ru/test.fpl"
[Mon Dec 09 11:26:48 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" restarted (pid 2524)
[Mon Dec 09 11:26:48 2002] [error] [client 127.0.0.1] (109)The pipe has been ended: FastCGI: comm with server "c:/a
pache/htdocs/ru/test.fpl" aborted: GetOverlappedResult() failed
[Mon Dec 09 11:26:48 2002] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "c
:/apache/htdocs/ru/test.fpl"
[Mon Dec 09 11:26:48 2002] [warn] FastCGI: (dynamic) server "c:/apache/htdocs/ru/test.fpl" (pid 2524) terminated wi
th exit with status '0'
I can understand that the matter was actually in my none in reality
FastCGI program.
PS Thanks to all FastCGI team for FastCGI. It is great. Not only does it
make applications to load with speed of static HTML documents but the benefit
of persistent database connection and the benefits of similar kind are
very handful.
--
Best regards,
Igor mailto:sprog@online.ru
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/