开发者

C/C++ FastCGI Developers toolkit example program (not working?)

I am using the fastcgi C/C++ toolkit, to develop a test fastcgi app. I built (and am now testing) this example provided by the toolkit.

I have loaded Apache mod_fcgid and successfully restarted the apache2 daemon. However, when I try to access the fastcgi resource, it is returning a blank page.

Note: I made the following changes to the example code (as it didn't work with the default socket fd value of 0):

int sock_fd = FCGX_OpenSocket(":5000", 1);
FCGX_InitRequest(&request, sock_fd, 0);

My /etc/apache2/mods-enabled/fcgid.conf file looks like this:

<IfModule mod_fcgid.c>
     AddHandler fcgid-script .fcgi
     SocketPath /var/lib/apache2/fcgid/sock
     IPCConnectTimeout 10
     IPCCommTimeout 20
     OutputBufferSize 0
     MaxRequestsPerProcess 500
</IfModule>

My /etc/apache2/mods-enabled/fcgid.load file looks like this:

LoadModule fcgid_module /my/path/here/libs/mod_fcgid.so

I then accessed the 'resource' in a browser using the following url:

http://127.0.0.1:5000

What am I doing wrong? (assuming that someone has actually managed to get the example cited above, to work)

I am develop开发者_运维问答ing/testing on Linux Ubuntu 10.x


i don't use apache for while, but i think your url is bad i assume your apache run on port 80 and your echo.fcgi is at root of apache folder

for information, i use nginx for serve fcgi application

http://localhost/echo.fcgi


Run apachctl -D to verify your have mod_fcgid running. I believe no output (i.e a white page) occurs when your process crashes.

You will need to compile your program with debugging (-O0 -ggdb), redeploy, and restart Apache.

Change your Apache config to only spawn one process. This will allow you to attach gdb to your FCGI application and debug it.

Let me know if you need further assistance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜