Help Setting up FCGI for Oracle Connection pooling

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Jan 23 15:01:13 EST 2007


Hi,

This is my first attempt to get FastCGI running with Mapserver to do 
Oracle connection pooling, and it is not working. Any help would be 
appreciated.

I have the mapfile working for CGI so I know I have the system and 
environment set up correctly, but in fcgi mode I get:

This is the error message:

msDrawMap(): Image handling error. Failed to draw layer named 
'Mexican_States'.
msOracleSpatialLayerOpen(): OracleSpatial error. Cannot create OCI 
Handlers. Connection failure. Check the connection string. Error: .

This is the apache error.log:

[Tue Jan 23 12:44:48 2007] [warn] FastCGI: (dynamic) server 
"/usr/lib/cgi-bin/mapserv410.fcgi" restarted (pid 15479)
[Tue Jan 23 12:44:48 2007] [error] [client 129.44.191.48] FastCGI: 
server "/usr/lib/cgi-bin/mapserv410.fcgi" stderr: CGI Request 1 on 
process 15469
[Tue Jan 23 12:44:48 2007] [error] [client 129.44.191.48] FastCGI: 
server "/usr/lib/cgi-bin/mapserv410.fcgi" stderr: msDrawMap(): Layer 0 
(color_symbol), 0.000s
[Tue Jan 23 12:44:48 2007] [warn] FastCGI: (dynamic) server 
"/usr/lib/cgi-bin/mapserv410.fcgi" (pid 15469) terminated by calling 
exit with status '0'

   LAYER
     NAME "Mexican_States"
     STATUS DEFAULT
     TYPE POLYGON
     CONNECTIONTYPE oraclespatial
     CONNECTION "user/pass at test"
     PROCESSING "CLOSE_CONNECTION=DEFER"
     DATA "GEOMETRY FROM MEXSTATES USING SRID 4326 FILTER VERSION 10g"
     ##DATA "mdata/mexico/mexstates"
     CLASS
       NAME "Mexico States"
       SYMBOL 0
       COLOR 204 204 204
       OUTLINECOLOR 128 128 128
     END
   END


Basically I have followed:

http://mapserver.gis.umn.edu/docs/howto/fastcgi

Running Debian Sarge

1) have the libfcgi-dev loaded
2) have the apache module loaded
3) build mapserver with fcgi support

swoodbridge at data:~/work$ "/usr/lib/cgi-bin/mapserv410.fcgi" -v
MapServer version 4.10.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER 
SUPPORTS=FASTCGI INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS 
INPUT=ORACLESPATIAL INPUT=SHAPEFILE DEBUG=MSDEBUG

4) have configured apache 1.3 thusly:

FastCgiConfig -initial-env PROJ_LIB=/usr/share/proj -initial-env 
LD_LIBRARY_PATH=/home2/oracle/cl10/lib -initial-env 
TNS_ADMIN=/home/swoodbridge/.oracle/ -initial-env 
ORACLE_HOME=/home2/oracle/cl10/  -appConnTimeout 60 -idle-timeout 60 
-init-start-delay 1 -minProcesses 2 -maxClassProcesses 20 -startDelay 5

LoadModule fastcgi_module /usr/lib/apache/1.3/mod_fastcgi.so

     <Location ~ \.fcgi>
         Options ExecCGI
         SetHandler fastcgi-script
     </Location>

5) installed mapserv as

cp mapserv /usr/lib/cgi-bin/mapserv410
cp mapserv /usr/lib/cgi-bin/mapserv410.fcgi

and have a shell script for CGI to set environment variables

swoodbridge at data:~/work$ cat /usr/lib/cgi-bin/mapserv410a
#!/bin/sh
export TNS_ADMIN=/home/swoodbridge/.oracle/
export ORACLE_HOME=/home2/oracle/cl10/
export LD_LIBRARY_PATH=/home2/oracle/cl10/lib/
/usr/lib/cgi-bin/mapserv410 $*


So this works in CGI mode but not fcgi mode:

# CGI
http://localhost/cgi-bin/mapserv410a?mode=map&layers=all&scale=50000000&map=/home/direct/mapserver/na_navteq_ora.map&mapxy=-75.7+45.42&map_size=300+200

# FCGI
http://localhost/cgi-bin/mapserv410.fcgi?mode=map&layers=all&scale=50000000&map=/home/direct/mapserver/na_navteq_ora.map&mapxy=-75.7+45.42&map_size=300+200


Anyone have some clue on this?

Thanks,
   -Steve W.



More information about the mapserver-users mailing list