Fabrice Colin | 1 Mar 2004 15:56

Missing environment variables with FastCGI on Apache 2.0.48/Win32

Hello all,

I am experiencing a problem with FastCGI based applications on Apache 
2.0.48/Windows NT.

Basically it appears that REQUEST_METHOD, CONTENT_LENGTH and the other 
CGI variables our apps expect are not made available. I wrote a simple
FCGI app that prints out environ, and only these three variables are
defined :

  SystemRoot=C:\WINNT
  _FCGI_SHUTDOWN_EVENT_=1240
  _FCGI_MUTEX_=1236

With a vanilla CGI program, the same code shows environ holds 28
variables...

The same apps work like a charm on Linux (Fedora Core 1) and I must say
with the same combination of software (apache 2.0.48, mod_fastcgi 2.4.0,
fcgi 2.4.0).
The configuration file is very similar to the "typical httpd.conf"
described in the FAQ, and is basically what we use on Linux.

I tried the dll that's in fastcgi.com/dist as well as compiling
mod_fastcgi 2.4.2 and the snapshot dated 20.01.2004 with VC++ 6 (in
Debug and Release), but this didn't make any difference...

Two other things I tried were
- a FastCgiServer directive with "-initial-env REQUEST_METHOD" but
REQUEST_METHOD remains empty.
(Continue reading)

Guhan Santhanam | 1 Mar 2004 17:22
Picon
Favicon

cgi-fastcgi

Hi ,
I have written a simple python webpage that connects
to a firebird database in CGI. I want to convert this
into a fastcgi application. please help.
thanks. the code is...

#!/usr/lib/cgi-bin/gsanthan

import cgi

import kinterbasdb

print"Content-type: text/html\n\n"

def connect():
	return kinterbasdb.connect(
	host='149.149.30.72',database='e:\\program
files\\firebird\\grappl.fdb',
	user='SYSDBA', password='masterkey', dialect=3)

def main():
	con = connect()
	cur = con.cursor()
	con.begin()
	form = cgi.FieldStorage()
	if (form.has_key("STUDENT_ID")):
		
		Insert = """insert into STUDENT_INFORMATION_DETAILS
(STUDENT_ID) values
(%d)"""%(int(form["STUDENT_ID"].value ))	
(Continue reading)

Rob Saccoccio | 3 Mar 2004 02:15

FastCGI List Problems

I haven't been getting mail from the list manager for about a month.  Not
sure what the problem is yet.  If you've had the same problem (and found
your way to this message through another means), please reply to this
message offlist so I can "fix" your delivery too.

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
John Huong | 3 Mar 2004 02:55
Picon
Favicon

Problems with Apache2 2.0.48+FastCGI+PHP 4.3.4

Hi,
  I'm trying to use fastcgi to run php under Apache2.
Here is what I inserted into httpd.conf

LoadModule fastcgi_module modules/mod_fastcgi.dll
<IfModule mod_fastcgi.c>
Alias /phpbin/ c:/php/
FastCgiServer c:/php/php.exe -processes 5
AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /phpbin/php.exe
</IfModule>

Everytime I make a request, I would run into the
following problem.
The browser would show

Forbidden
You don't have permission to access
/phpbin/php.exe/index.php on this server.

--------------------------------------------------------------------------------

Apache/2.0.48 (Win32) mod_fastcgi/2.4.2 Server at
cimserv Port 80

And in the apache error log I would see this
[error] [client xxx.xx.xxx.xxx] client denied by
server configuration: C:/php/php.exe

Any ideas on how I can fix this?
(Continue reading)

Fabrice Colin | 3 Mar 2004 14:58

Re: Missing environment variables with FastCGI on Apache 2.0.48/Win32

Hello,

In case anybody is interested, I found that the compilation settings
were to blame.
Apps must be linked against the Multithreaded DLL C run-time. In Debug
mode, link against the Debug libfcgi.lib and make sure the Debug
libfcgi.dll can be located in the path.

Fabrice

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
Mark D. Roth | 3 Mar 2004 15:42

Re: SIGTERM causing "incomplete headers" error?

I never got a response to this, so I'm resending it in case it got
lost in the recent list manager problems.  Any and all ideas would be
appreciated!

On Mon Feb 16 17:49 2004 -0600, Mark D. Roth wrote:
> I've got a home-grown application written in Perl using CGI::Fast.
> For the most part, it works fine, but we are seeing sporradic
> instances of users reporting "500 internal server error" responses
> from the web server.  When this happens, I always see a sequence like
> the following in the Apache error log:
> 
> [Mon Feb 16 09:36:53 2004] [warn] FastCGI: (dynamic) server "/pathname/index.fcgi" (pid 24790)
termination signaled
> [Mon Feb 16 09:36:53 2004] [error] [client XXX.XXX.XXX.XXX] FastCGI: incomplete headers (0 bytes)
received from server "/pathname/index.fcgi"
> [Mon Feb 16 09:36:53 2004] [warn] FastCGI: (dynamic) server "/pathname/index.fcgi" (pid 24790)
terminated by calling exit with status '0'
> 
> Normally, I wouldn't worry about the "termination signalled" or
> "terminated by calling exit with status '0'" messages, since they're
> just caused by the process manager cleaning up a presumably unused
> process.  However, I find it suspicious that the "incomplete headers"
> message always comes right between those two messages.
> 
> My first thought was that if the process manager is really killing an
> idle process, then the process should be blocking in the call to
> CGI::Fast->new() (i.e., in FCGI::accept()), and it's behaving almost
> as if the SIGTERM signal handler is returning back into the accept()
> call instead of causing the process to exit.  However, the code looks
> like it should never do that, so I'm not sure what's going on.
(Continue reading)

Howard Smith | 9 Mar 2004 20:54
Picon
Favicon

fastcgi and shared memory

Newbie fastcgi questions:

           Does fastcgi work with sysV shared memory (perl)?
    Experienced developers ~or~ funny anecdotes welcomed...

           Is it mandatory to setup a FastCGIServer line in the 
httpd.conf file?

          Does stdout need to be redirected (perl?)
               (Im getting the fcgi output in the error log rather than 
to the browser)

Thanks!          

--

-- 
Howard Smith
Web Portal Developer/Admin
University of Notre Dame
hsmith3@...  / 574.631.3680 

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/

Alan Rykhus | 9 Mar 2004 21:20
Favicon

Re: fastcgi and shared memory

Hello Howard,

We have a fastcgi application in which we use shared memory and 
semaphores. We have a configuration file that is 'required' that 
contains the shared memory id and semaphore id. We use the semaphore to 
lock the shared memory so that only one fastcgi app is acquiring a line 
in the shared memory at a time. Once the app has its line it lets the 
semaphore go so that another app can get a line.

Been using it for years without a problem.

al

Howard Smith wrote:
> Newbie fastcgi questions:
> 
>           Does fastcgi work with sysV shared memory (perl)?
>    Experienced developers ~or~ funny anecdotes welcomed...
> 
>           Is it mandatory to setup a FastCGIServer line in the 
> httpd.conf file?
> 
>          Does stdout need to be redirected (perl?)
>               (Im getting the fcgi output in the error log rather than 
> to the browser)
> 
> Thanks!         

--

-- 
Alan Rykhus
(Continue reading)

Arkadiusz Miskiewicz | 10 Mar 2004 00:16

php4 as fastcgi + apache 2, setup howto


Hi,

I've got php4 as fastcgi + apache 2 + suexec setup working fine. Description 
is here http://www.t17.ds.pwr.wroc.pl/~misiek/index.php/ApacheModFastcgiPHP
(based on docs, faq).

There are also two patches to allow using fastcgi and suexec on systems where 
only UID/GID is used without corresponding /etc/passwd entry.

It would be nice if fastcgi patch could be incorporated into official version 
(now it's unconditional but it also could be enabled by some -allow-uid-gid 
config option).

Comments welcome.
--

-- 
Arkadiusz Miƛkiewicz     CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
David Birnbaum | 10 Mar 2004 04:32
Favicon

Testing

Please ignore, testing list....

David.

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/

Gmane