FastCGI/Oracle Solved

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Wed Jan 24 06:39:48 PST 2007


Hi Fernando,

Thank you for your post. It lead me to the fix. I added the environment 
variables here and I am able to make connections now.

     <Location ~ \.fcgi>
         Options ExecCGI
         SetHandler fastcgi-script
         SetEnv PROJ_LIB /usr/share/proj
         SetEnv LD_LIBRARY_PATH /home2/oracle/cl10/lib
         SetEnv TNS_ADMIN /home/swoodbridge/.oracle/
         SetEnv ORACLE_HOME /home2/oracle/cl10/
     </Location>

Defining them here does NOT work:

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

I tried to add a comment to the Documentation Page for FastCGI but the 
disk is full :( and this needs to be documented!

-Steve

Fernando Simon wrote:
> Hi Stephen,
>     This error (without error code, just point) that the Mapserver
> reported occurs when the Oracle Spatial driver can't connect with
> Oracle, when the Oracle variables are not present in the system
> (ORACLE_HOME and/or ORACLE_BASE). Did you define it inside the
> httpd.conf?
>     Or, how you reported, the Mapserver can access the Oracle libs,
> inside the path the ORACLE_HOME refer. How you report you can change
> the permissions to the Ooracle director. The folders, just the
> folders, need the execution permissions (+x). I don believe that the
> Mapserver as FastCGI needs special access, here I use the PHP as
> FastCGI and I didn't change any special about the Oracle.
>     Another thing that I saw for FastCGI is the Oracle variables in
> the Apache. When you define the Oracle Libs inside the httpd.conf the
> FastCGI can't read correctly, you need to define the variables inside
> the FastCGI module (the <IfModule fcgid_module>). Unfortunately I am
> not in the Lab today (just tomorrow) to have access to my httpd.conf.
>  I will send to you the configure that I use here tomorrow.
>     Best regards.
> 
> ---------------------------------------------
> Fernando Simon 
> UMN Mapserver and Oracle Spatial developer
> ---------------------------------------------
> 
> 
> Citando Stephen Woodbridge <woodbri at SWOODBRIDGE.COM>:
> 
>> Frank Warmerdam wrote:
>>> Stephen Woodbridge wrote:
>>>> 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: .
>>> Steve,
>>>
>>> It seems like you have done everything right.  Does the fastcgi
>>> mapserver work for other stuff (like shapefiles) if there is no
>>> oracle in the mix?
>>>
>>> It looks like some sort of subtle environment type issue, but
>> your
>>> efforts seem pretty comprehensive.
>>>
>>> Best regards,
>>>
>> Hi Frank,
>>
>> Good call, I should have thought of that! Yes, if I change the
>> mapfile 
>> to a shapefile only mapfile it runs just fine in fastcgi.
>>
>> Yesterday, when I was setting up the Oracle connection I got the
>> same 
>> error message and resolved it by fixing the file permission on the
>>
>> /home2/oracle directory tree. So I guess there are still some
>> issues 
>> there. I'll go back over that again maybe I missed something.
>>
>> Does the fastcgi version need access to different oracle client
>> files 
>> that the CGI does not need?
>>
>> Thanks for the quick response,
>>    -Steve W
>>
> 
> 
> 
> 
> -------------------------------------------------
>   Univali - Webmail - http://webmail.univali.br



More information about the MapServer-users mailing list