threads in mapserv

Chris Tweedie chris at NARX.NET
Fri Mar 3 03:20:21 PST 2006


Hi Frank/Paul

Tim and myself have been trying to get fcgi support running with no success.

Briefly, we cannot get past the following exception when submitting a 
standard getcapabilities call ...

[Fri Mar  3 12:04:44 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" started (pid 32471)
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[Fri Mar  3 12:04:44 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" (pid 32471) terminated by calling 
exit with status '0'

Does this ring any bells with you in your implementations? It seems as 
though the fcgi handler is not passing on the query string, which is 
causing mapserv to throw the usual "Should be initiated as a cgi 
process". The reason though, i have no idea. The same executable, when 
fcgi is disabled works as expected ... all the SDE connections have the 
defer parameter defined in the map file.

Our complete configuration is as follows .. any thoughts/ideas would be 
muchly appreciated.

1. Unpacked fcgi-2.4.0 to /WSPACE5/fcgi-2.4.0
2. Built and installed library to /WSPACE5/fcgi_bin
3. Unpacked mod_fastcgi.so
4. Modified httpd.conf

Options Indexes FollowSymLinks MultiViews ExecCGI
AddHandler fastcgi-script fcgi
FastCgiConfig -initial-env PROJ_LIB=/MapServer/lib -initial-env 
LD_LIBRARY_PATH=/MapServer/lib -appConnTimeout 60 -idle-timeout 60 
-init-start-delay 1 -minProcesses 2 -maxClassProcesses 20 -startDelay 5

LoadModule fastcgi_module /MapServer/mod_fastcgi.so

5. Built mapserv.fcgi with the following configuration

./configure --with-proj --with-ogr --with-gdal --with-wfs --with-wcs 
--with-wmsclient --with-wfsclient --with-sde-version=91 
--with-sde=/arcsdesdk/sdeexe91/lib/  --with-fastcgi=/WSPACE5/fcgi_bin

[root at t2lin cgi-bin]# ./mapserv.fcgi -v
MapServer version 4.6.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=SDE INPUT=OGR INPUT=GDAL 
INPUT=SHAPEFILE

[root at t2lin cgi-bin]# ldd ./mapserv.fcgi
        libgd.so.2 => /MapServer/lib/libgd.so.2 (0x00fa9000)
        libjpeg.so.62 => /MapServer/lib/libjpeg.so.62 (0x00789000)
        libfreetype.so.6 => /MapServer/lib/libfreetype.so.6 (0x00ed9000)
        libpng.so.3 => /MapServer/lib/libpng.so.3 (0x006d8000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00b2f000)
        libproj.so.0 => /MapServer/lib/libproj.so.0 (0x008dd000)
        libsde91.so => /arcsdesdk/sdeexe91/lib/libsde91.so (0x00cae000)
        libpe91.so => /arcsdesdk/sdeexe91/lib/libpe91.so (0x00246000)
        libsg91.so => /arcsdesdk/sdeexe91/lib/libsg91.so (0x00b58000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00111000)
        libdl.so.2 => /lib/libdl.so.2 (0x00f92000)
        libgdal.so.1 => /MapServer/lib/libgdal.so.1 (0x00ff8000)
        libcurl.so.3 => /MapServer/lib/libcurl.so.3 (0x00377000)
        libssl.so.4 => /lib/libssl.so.4 (0x00af1000)
        libcrypto.so.4 => /lib/libcrypto.so.4 (0x00121000)
        libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2 
(0x00213000)
        libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x004db000)
        libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3 (0x00226000)
        libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3 (0x005a7000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00539000)
        libc.so.6 => /lib/tls/libc.so.6 (0x00911000)
        libfcgi.so.0 => /fcgi_lib/lib/libfcgi.so.0 (0x0054b000)
        libm.so.6 => /lib/tls/libm.so.6 (0x00c69000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x007f3000)
        libpng12.so.0 => /MapServer/lib/libpng12.so.0 (0x00554000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00585000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00230000)
        libodbc.so.1 => /MapServer/lib/libodbc.so.1 (0x005b9000)
        libxerces-c.so.26 => /MapServer/lib/libxerces-c.so.26 (0x060ee000)
        libNCSEcw.so => /ecwsdk/lib/libNCSEcw.so (0x05ecb000)
        libNCSCNet.so => /ecwsdk/lib/libNCSCNet.so (0x0058e000)
        libNCSUtil.so => /ecwsdk/lib/libNCSUtil.so (0x0061d000)
        libgeotiff.so => /MapServer/lib/libgeotiff.so (0x0062e000)
        libtiff.so.3 => /MapServer/lib/libtiff.so.3 (0x00650000)
        libnetcdf.so => /MapServer/lib/libnetcdf.so (0x0069c000)
        libpq.so.4 => /MapServer/lib/libpq.so.4 (0x00c15000)
        librt.so.1 => /lib/tls/librt.so.1 (0x006c1000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00709000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x0071e000)

*** Although no SUPPORTS=FASTCGI displayed for mapserv.fcgi -v, the ldd 
shows libfcgi.so.0 => /fcgi_lib/lib/libfcgi.so.0 (0x0054b000) indicating
it is using the library. Or is it?

6. Pressed on to see if we got lucky, so did a getcapabilities

[root at t2lin logs]# tail -f error_log
[Fri Mar  3 12:04:17 2006] [notice] caught SIGTERM, shutting down
Processing config directory: /MapServer/www/conf.d/*.conf
Processing config file: /MapServer/www/conf.d/gdal.conf
Processing config file: /MapServer/www/conf.d/mapserver.conf
Processing config file: /MapServer/www/conf.d/php.conf
Processing config file: /MapServer/www/conf.d/proj.conf
[Fri Mar  3 12:04:19 2006] [warn] NameVirtualHost *:80 has no VirtualHosts
[Fri Mar  3 12:04:19 2006] [notice] FastCGI: process manager 
initialized (pid 32464)
[Fri Mar  3 12:04:19 2006] [notice] Apache/1.3.34 (Unix) 
mod_fastcgi/2.4.2 configured -- resuming normal operations
[Fri Mar  3 12:04:19 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)

***** SUBMITTED GETCAPABILITIES START HERE *********

[Fri Mar  3 12:04:44 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" started (pid 32471)
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[Fri Mar  3 12:04:44 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" (pid 32471) terminated by calling 
exit with status '0'
[Fri Mar  3 12:04:49 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" restarted (pid 32473)
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[Fri Mar  3 12:04:49 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" (pid 32473) terminated by calling 
exit with status '0'
[Fri Mar  3 12:04:54 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" restarted (pid 32476)
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[Fri Mar  3 12:04:54 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" (pid 32476) terminated by calling 
exit with status '0'
[Fri Mar  3 12:04:59 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" restarted (pid 32477)
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[Fri Mar  3 12:04:59 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" (pid 32477) terminated by calling 
exit with status '0'
[Fri Mar  3 12:04:59 2006] [warn] FastCGI: (dynamic) server 
"/MapServer/www/cgi-bin/mapserv.fcgi" has failed to remain running for 
30 seconds given 3 attempts, its restart interval has been backed off 
to 600 seconds

7. FastCGI continues to output Error 500 while looping thru the above 
continuously.

*pulls hair out*



More information about the MapServer-users mailing list