[mapserver-users] lighttpd, TNS:could not resolve...

Dan Little danlittle at yahoo.com
Thu Sep 30 09:51:09 EDT 2010


I was starting to suspect MapServer is just no seeing the environment 
variables...

Try this... write a wrapper script "mapserv.sh"

#!/bin/bash

TNS_ADMIN=/home/gis/conf

/home/gis/bin/mapserv

Then update your script to point to "mapserv.sh".




>
>From: Sebastian E. Ovide <sebastian.ovide at gmail.com>
>To: Dan Little <danlittle at yahoo.com>
>Cc: Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>; mapserver-users at lists.osgeo.org
>Sent: Thu, September 30, 2010 8:01:22 AM
>Subject: Re: [mapserver-users] lighttpd, TNS:could not resolve...
>
>on the same machine, with the same data and same tns file it works fine with 
>APACHE.... the problems is only with LIGHTTPD... it looks like "TNS_ADMIN" => 
>"/home/gis/conf/" is ignored (in apache I've used SetEnv and PassEnv
>
>
>???
>
>
>On Thu, Sep 30, 2010 at 12:22 PM, Dan Little <danlittle at yahoo.com> wrote:
>
>Does shp2img work with your Mapfile?
>>
>>>
>>>From: Sebastian E. Ovide <sebastian.ovide at gmail.com>
>>>To: Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>
>>>Cc: mapserver-users at lists.osgeo.org
>>>Sent: Thu, September 30, 2010 4:47:30 AM
>>>Subject: Re: [mapserver-users] lighttpd, TNS:could not  resolve...
>>>
>>>
>>>the message says: 
>>>
>>>
>>>ORA-12154: TNS:could not resolve the connect identifier specified in 
<unnamed>
>>>
>>>
>>>so... does <unnamed> mean that gdal didn't get any name for the connection ?
>>>
>>>
>>>
>>>
>>>
>>>On Thu, Sep 30, 2010 at 9:54 AM, Sebastian E. Ovide <sebastian.ovide at gmail.com> 
>>>wrote:
>>>
>>>no luck...
>>>>
>>>>
>>>>renamed servicename to capital.. so now connection name==service name...
>>>>
>>>>
>>>>same problem... ogrinfo works, mapserver doesn't....
>>>>
>>>>
>>>>
>>>>On Thu, Sep 30, 2010 at 9:37 AM, Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi> 
>>>>wrote:
>>>>
>>>>Hi,
>>>>> 
>>>>>For me, sometimes with some Oracle user name from some  computers SQL*Plus does 
>>>>>not understand if I am using the SERVICE_NAME.  It  you happen to have the same 
>>>>>situation you should be able to connect with the  connection name, which seems 
>>>>>to be MFUATDB for you. 
>>>>> 
>>>>>Actually, the error message "TNS:could not resolve the  connect identifier 
>>>>>specified" may mean that you should not use service name but  the connect 
>>>>>identifier.  Have a try and tell how it  went.
>>>>> 
>>>>> 
>>>>>-Jukka  Rahkonen- 
>>>>>
>>>>>
>>>>>
________________________________
 Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
[mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Sebastian E.    Ovide
>>>>>>Lähetetty: 30. syyskuuta 2010 11:15
>>>>>>Vastaanottaja: Dan Little
>>>>>>Kopio: mapserver-users at lists.osgeo.org
>>>>>>Aihe: Re: [mapserver-users] lighttpd, TNS:could not resolve...
>>>>>>
>>>>>>
>>>>>>yes. 
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>gis at mapserver:~$ ls -la /home/gis/conf/tnsnames.ora
>>>>>>-rw-r--r-- 1 gis gis 184 2010-09-29 16:19    /home/gis/conf/tnsnames.ora
>>>>>>gis at mapserver:~$ sudo su www-data -c 'cat    /home/gis/conf/tnsnames.ora'
>>>>>>MFUATDB =
>>>>>>  (DESCRIPTION =
>>>>>>    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.60.70)(PORT    = 1521))
>>>>>>    (CONNECT_DATA =
>>>>>>      (SERVER = DEDICATED)
>>>>>>      (SERVICE_NAME = mfuatdb)
>>>>>>    )
>>>>>>  )
>>>>>>
>>>>>>
>>>>>>
>>>>>>On Wed, Sep 29, 2010 at 7:58 PM, Dan Little <danlittle at yahoo.com> wrote:
>>>>>>
>>>>>>Is tnsnames.ora accessible by the web-server user? (Check the      
>>>>>permissions.)
>>>>>>>
>>>>>>>
>>>>>>>Is        t
>>>>>>>>
>>>>>>>>From: Sebastian E. Ovide <sebastian.ovide at gmail.com>
>>>>>>>>To: mapserver-users at lists.osgeo.org
>>>>>>>>Sent: Wed, September 29, 2010        11:10:09 AM
>>>>>>>>Subject: [mapserver-users] lighttpd, TNS:could not resolve...
>>>>>>>> 
>>>>>>>>
>>>>>>>>Hi All, 
>>>>>>>>
>>>>>>>>
>>>>>>>>I have installed MapServer on lighttpd + fastcgi.
>>>>>>>>
>>>>>>>>
>>>>>>>>fastcgi.server = (
>>>>>>>>        "/mapserver" =>
>>>>>>>>        ( "localhost" =>
>>>>>>>>                (
>>>>>>>>                               "socket" => 
>>"/tmp/mapserver-fastcgi.socket",
>>>>>>>>                               "bin-path" => "/home/gis/bin/mapserv",
>>>>>>>>                               "bin-environment" =>
>>>>>>>>                               (
>>>>>>>>                                       "TNS_ADMIN" =>        
>>>>>"/home/gis/conf/"
>>>>>>>>                               ),
>>>>>>>>                               "max-procs" => 2,
>>>>>>>>                               "check-local" => "disable"
>>>>>>>>                )
>>>>>>>>        )
>>>>>>>>)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>gis at mapserver:~$ cat /home/gis/conf/tnsnames.ora
>>>>>>>>MFUATDB =
>>>>>>>>  (DESCRIPTION =
>>>>>>>>    (ADDRESS = (PROTOCOL = TCP)(HOST =        192.168.60.70)(PORT = 
>1521))
>>>>>>>>    (CONNECT_DATA =
>>>>>>>>      (SERVER = DEDICATED)
>>>>>>>>      (SERVICE_NAME = mfuatdb)
>>>>>>>>    )
>>>>>>>>  )
>>>>>>>>
>>>>>>>>
>>>>>>>>and I'm getting: 
>>>>>>>>
>>>>>>>>
>>>>>>>>msDrawMap(): Image handling error. Failed to draw layer named        'TESTII'. 
>>>>>>>>msOGRFileOpen(): OGR error. Open failed for OGR connection in        layer 
>>>>>>>>`TESTII'. ORA-12154: TNS:could not resolve the connect identifier        
>>>>>>>>specified in <unnamed>
>>>>>>>>
>>>>>>>>
>>>>>>>>from the logs:
>>>>>>>>
>>>>>>>>
>>>>>>>>[Wed Sep 29 17:00:13 2010].649965 CGI Request 1 on process 1513
>>>>>>>>[Wed Sep 29 17:00:13 2010].717290 msOGRFileOpen(): OGR error. Open        failed 
>>>>>>>>for OGR connection in layer `TESTII'.
>>>>>>>>ORA-12154: TNS:could not resolve the connect identifier        specified
>>>>>>>> in <unnamed>
>>>>>>>>
>>>>>>>>
>>>>>>>>[Wed Sep 29 17:00:13 2010].717319 msDrawMap(): Image handling error.        
>>>>>>>>Failed to draw layer named 'TESTII'.
>>>>>>>>[Wed Sep 29 17:00:13 2010].717454 msFreeMap(): freeing map at        
>>>>>>0xa00f298.
>>>>>>>>[Wed Sep 29 17:00:13 2010].717579 freeLayer(): freeing layer at        
>>>>>>>>0xa0237a0.
>>>>>>>>[Wed Sep 29 17:00:13 2010].717591 freeLayer(): freeing layer at        
>>>>>>>>0xa024718.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>in mapserver:
>>>>>>>>
>>>>>>>>
>>>>>>>>  LAYER
>>>>>>>>    NAME TESTII
>>>>>>>>    TYPE POLYGON
>>>>>>>>    STATUS ON
>>>>>>>>    CONNECTION        "OCI:GEO_US_DATA/GEO_US_DATA at mfuatdb"
>>>>>>>>    CONNECTIONTYPE OGR
>>>>>>>>    DATA "CA_WILDFIRE"
>>>>>>>>    PROJECTION
>>>>>>>>      "init=epsg:3857"
>>>>>>>>    END
>>>>>>>>    CLASS
>>>>>>>>#      NAME "local_shape"
>>>>>>>>      COLOR 0 0 255
>>>>>>>>      OUTLINECOLOR 0 0 255
>>>>>>>>    END
>>>>>>>>  END
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>The connection string is right as I'm using it from gdal:
>>>>>>>>
>>>>>>>>
>>>>>>>>gis at mapserver:~$ ogrinfo        
>>>>>>OCI:GEO_US_DATA/GEO_US_DATA at mfuatdb:CA_WILDFIRE
>>>>>>>>INFO: Open of `OCI:GEO_US_DATA/GEO_US_DATA at mfuatdb:CA_WILDFIRE'
>>>>>>>>      using driver `OCI' successful.
>>>>>>>>1: CA_WILDFIRE
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>any ideas ?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>-- 
>>>>>>>>Sebastian E.        Ovide
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>-- 
>>>>>>Sebastian E. Ovide
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>-- 
>>>>Sebastian E. Ovide
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>-- 
>>>Sebastian E. Ovide
>>>
>>>
>>>
>>>
>>
>
>
>-- 
>Sebastian E. Ovide
>
>
>
>
>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100930/764158dc/attachment.html


More information about the mapserver-users mailing list