Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache + FastCGI + win32

Status
Not open for further replies.

ComDlg32

Programmer
Dec 6, 2002
2
RU
I've a problem that is probably not new one. But I can't move
further on without your advise.

Win32 platform, XP Pro

I've compiled FastCGI Perl 0.66 and installed it. I wrote a
simple FastCGI test file that is (c:/usr/bin/perl - is the right
path to my Perl)

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;

that runs smoothly by Perl, using FastCGI.

I all so have Apache 1.3.22
Apache/1.3.22 (Win32) mod_fastcgi/2.2.12 PHP/4.2.0 running...

I configured it to run with FastCGI dll that I had not compiled
but downloaded from by adding the following lines in
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>

And everything would have finished well if I've not typed
Apache showed me 500 Server Error and
I found in log file the following messages:

[Thu Dec 05 15:13:09 2002] [error] [client 127.0.0.1] (109)The pipe has been ended: FastCGI: comm with sever &quot;c:/ap
ache/htdocs/ru/test.fpl&quot; aborted: PeekNamedPipe() failed
[Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 2628)
[Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 2628) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:19 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 4076)
[Thu Dec 05 15:13:19 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 4076) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:24 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 1768)
[Thu Dec 05 15:13:25 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 1768) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:29 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 2364)
[Thu Dec 05 15:13:29 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 2364) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:34 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 2212)
[Thu Dec 05 15:13:35 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 2212) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:39 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 900)
[Thu Dec 05 15:13:39 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 900) terminated wit
h exit with status '0'
[Thu Dec 05 15:13:44 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 1264)
[Thu Dec 05 15:13:44 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (pid 1264) terminated wi
th exit with status '0'
[Thu Dec 05 15:13:49 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 3732)
[Thu Dec 05 15:13:50 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (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 &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 3732)
...
strings wouldn't even end showing till I have not restarted Apache and
FastCGI correspondently.

Is there any solution? All none fastcgi scripts are working smoothly.
 
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(&quot;$Counter++ $$&quot;);
}

And it would work with the earlier dll published at 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(&quot;$Counter++$$&quot;); 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
>> &quot;c:/apache/htdocs/ru/test.fpl&quot; restarted (pid 2628)
>> [Thu Dec 05 15:13:14 2002] [warn] FastCGI: (dynamic) server
>> &quot;c:/apache/htdocs/ru/test.fpl&quot; (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 &quot;c:/apache/htdocs/ru/test.fpl&quot; (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 &quot;c:/a
pache/htdocs/ru/test.fpl&quot; aborted: GetOverlappedResult() failed
[Mon Dec 09 11:26:44 2002] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server &quot;c
:/apache/htdocs/ru/test.fpl&quot;
[Mon Dec 09 11:26:48 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; 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 &quot;c:/a
pache/htdocs/ru/test.fpl&quot; aborted: GetOverlappedResult() failed
[Mon Dec 09 11:26:48 2002] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server &quot;c
:/apache/htdocs/ru/test.fpl&quot;
[Mon Dec 09 11:26:48 2002] [warn] FastCGI: (dynamic) server &quot;c:/apache/htdocs/ru/test.fpl&quot; (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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top