logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.



Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: difficulty getting started with fastcgi
Author
dragonmage



Joined: 14 Jul 2007
Posts: 2

PostPosted: Sat 14 Jul '07 8:16    Post subject: difficulty getting started with fastcgi Reply with quote

Hi,

I have been testing a fcgi program on ubuntu linux setup with fastcgi mod for apache2.

For some reason, my C program would not display anything whereas the binary echo example program did.

I eventually tried recompiling the echo program found in the fcgi source examples and I noticed the
size of the binary is about doule the size of the one that was working.

8463 2007-07-14 11:31 echo
4494 2007-07-14 11:37 echo

The recompiled echo also displayed the same behaviour as my fcgi program: did not seem to run/respond. copying the old example binary back and it works.

to compile I used:

gcc -I /usr/local/inclcude/ -L/usr/local/lib/ -o echo echo.c -lfcgi

then copied it to fcgi web dir. I then shutdown and restarted and tried accessing thru a web browser and it does not respond as described. From the error log: /var/log/apache2/error.log

[Sat Jul 14 11:38:15 2007] [error] [client 130.95.80.251] FastCGI: comm with server "/var/www/nsw/echo" aborted: idle timeout (30 sec)
[Sat Jul 14 11:38:15 2007] [error] [client 130.95.80.251] FastCGI: incomplete headers (0 bytes) received from server "/var/www/nsw/echo"

I am stumped as to the cause of this problem as it seems to be something to do with the compilation of linked in libraries.
Back to top
dragonmage



Joined: 14 Jul 2007
Posts: 2

PostPosted: Sat 14 Jul '07 14:23    Post subject: Reply with quote

more info:
When I used the debug level I got the following:
"
with debug on:
[Sat Jul 14 19:52:24 2007] [notice] FastCGI: process manager initialized (pid 18800)
/var/www/nsw/echo: error while loading shared libraries: libfcgi.so.0: cannot open shared object file: No such file or directory
[Sat Jul 14 19:52:24 2007] [warn] FastCGI: server "/var/www/nsw/echo" started (pid 18801)
[Sat Jul 14 19:52:24 2007] [warn] FastCGI: server "/var/www/nsw/echo" (pid 18801) terminated by calling exit with status '127'
[Sat Jul 14 19:52:24 2007] [notice] Apache/2.2.3 (Ubuntu) mod_fastcgi/2.4.2 configured -- resuming normal operations
[Sat Jul 14 19:52:24 2007] [info] Server built: Jan 15 2007 18:11:52
[Sat Jul 14 19:52:24 2007] [debug] worker.c(1740): AcceptMutex: sysvsem (default: sysvsem)
/var/www/nsw/echo: error while loading shared libraries: libfcgi.so.0: cannot open shared object file: No such file or directory
"
--
if I use the working binary, the error log reports:
"
[Sat Jul 14 20:04:36 2007] [warn] FastCGI: server "/var/www/nsw/echo" started (pid 19242)
[Sat Jul 14 20:04:36 2007] [notice] Apache/2.2.3 (Ubuntu) mod_fastcgi/2.4.2 configured -- resuming normal operations
[Sat Jul 14 20:04:36 2007] [info] Server built: Jan 15 2007 18:11:52
[Sat Jul 14 20:04:36 2007] [debug] worker.c(1740): AcceptMutex: sysvsem (default: sysvsem)
"

so, it seems there is a problem with the libfcgi.so.0
but it is in usr/local/lib and had read and execute permissions to all.
- it is actually a simlink to libfcgi.so.0.0.0
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 610
Location: Milford, MA, USA

PostPosted: Sat 14 Jul '07 17:04    Post subject: Reply with quote

Some things you could try:
    Add the option -initial-env LD_LIBRARY_PATH=/usr/local/lib to your FastCgiServer directive in fastcgi.conf to make FastCGI look for libraries in /usr/local/lib

    -or-

    Link echo with the static library, libfcgi.a, instead of the shared library.
    Code:
    gcc -I /usr/local/include/ -o echo echo.c /usr/local/lib/libfcgi.a

It is curious that your libraries are in /usr/local/lib. The Ubuntu libfcgi-dev package usually puts these libraries in /usr/lib, and puts the include files in /usr/include.

-tom-
Back to top


Reply to topic   Topic: difficulty getting started with fastcgi View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules