[FASTCGI] Apache 2.2.13 Server on Windows + FastCGI

sauda.furkhana at wipro.com sauda.furkhana at wipro.com
Wed Sep 2 01:48:09 EDT 2009


Hi,

 

I have Apache 2.2.13 installed on Windows XP. It works on port 8080.
1) I have configured Apache to support FastCGI module
(mod_fastcgi-2.4.6-AP22.dll) as well, by downloading it from
http://fastcgi.com/dist. I have placed the module in "modules" directory
of Apache.
2) I have built a standalone FastCGI application "check.exe". This
required libfcgi.dll which I created using source files in .tar
(fcgi-2.4.0.tar.gz) provided at http://fastcgi.com/dist.
3) I placed the executable in cgi-bin folder.
4) Now when I access it using http://localhost:8080/cgi-bin/check
<http://localhost:8080/cgi-bin/check>  - I get "Internal Server Error".
Please see error.log attached here for more details.

Please reply what is going wrong!! I'm stuck up with this for quite a
long time by now!!! Any response to this will be of GREAT help!!!

Thanks in advance!

 

Here are the details:

===============

I) Apache configuration:

LoadModule fastcgi_module modules/mod_fastcgi.dll
<IfModule mod_fastcgi.c>
     <Directory /cgi-bin/>
        SetHandler fastcgi-script
        Options +ExecCGI
    </Directory>
    AddHandler fastcgi-script .exe
  </IfModule>

 

II) Code in the application:

#include "fcgi_stdio.h"
#include "fcgiapp.h"
#include <stdlib.h>
#include "stdafx.h"
extern "C" _declspec (dllimport) int FCGI_Accept(void);
int main(int argc, char* argv[])
{
               int count = 0;
               while (FCGI_Accept() >= 0)
               {
    printf("Content-type: text/html\r\n"
           "\r\n"
           "<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
           "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>"
           "Request number %d running on host <i>%s</i>\n",
            ++count, getenv("SERVER_HOSTNAME"));
 
                               printf("Hello World!\n");
                               printf("Hello FCGI!\n");
                               printf("Hello ALEX!\n");
               }
               return 0;
}

 

III) Error.log in Apache:

[Wed Sep 02 10:30:29 2009] [notice] Apache/2.2.13 (Win32)
mod_fastcgi/2.4.6 configured -- resuming normal operations

[Wed Sep 02 10:30:29 2009] [notice] Server built: Aug  6 2009 15:50:50

[Wed Sep 02 10:30:29 2009] [notice] Parent: Created child process 2900

Apache server shutdown initiated...

Child 2900: Child process is running

[Wed Sep 02 10:30:29 2009] [notice] Child 2900: Acquired the start
mutex.

[Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting 64 worker
threads.

[Wed Sep 02 10:30:29 2009] [notice] FastCGI: process manager initialized

[Wed Sep 02 10:30:29 2009] [notice] Child 2900: Starting thread to
listen on port 8080.

[Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" started
(pid 3968)

[Wed Sep 02 10:30:36 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 3968)
terminated with exit with status '0'

[Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted
(pid 2592)

[Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] (OS 109)The pipe
has been ended.  : FastCGI: comm with server "C:/Program Files/Apache
Software Foundation/Apache2.2/cgi-bin/check.exe" aborted:
GetOverlappedResult() failed

[Wed Sep 02 10:30:41 2009] [error] [client 127.0.0.1] FastCGI:
incomplete headers (0 bytes) received from server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe"

[Wed Sep 02 10:30:41 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2592)
terminated with exit with status '0'

[Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted
(pid 2496)

[Wed Sep 02 10:30:46 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 2496)
terminated with exit with status '0'

[Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted
(pid 1344)

[Wed Sep 02 10:30:51 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 1344)
terminated with exit with status '0'

[Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted
(pid 980)

[Wed Sep 02 10:30:56 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 980)
terminated with exit with status '0'

[Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" restarted
(pid 196)

[Wed Sep 02 10:31:01 2009] [warn] FastCGI: (dynamic) server "C:/Program
Files/Apache Software Foundation/Apache2.2/cgi-bin/check.exe" (pid 196)
terminated with exit with status '0'

[Wed Sep 02 10:31:02 2009] [notice] Parent: Received shutdown signal --
Shutting down the server.

[Wed Sep 02 10:31:02 2009] [notice] Child 2900: Exit event signaled.
Child process is ending.

[Wed Sep 02 10:31:03 2009] [notice] Child 2900: Released the start mutex

[Wed Sep 02 10:31:04 2009] [notice] Child 2900: All worker threads have
exited.

[Wed Sep 02 10:31:05 2009] [notice] Child 2900: Child process is exiting

[Wed Sep 02 10:31:05 2009] [notice] Parent: Child process exited
successfully.

 


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20090902/89dad929/attachment.html>


More information about the FastCGI-developers mailing list