[mapserver-users] lighttpd, TNS:could not resolve...
Michael Smith
michael.smith at usace.army.mil
Tue Oct 5 04:48:40 PDT 2010
Sebastian,
Instead of using TNS, you could try the EZConnect syntax of
@host:port/service_name. That way you bypass even needing a TNS. Also if
your port is 1521, you can just not include it and use
CONNECTION ³user/pass at hostname/service_name²
Mike
--
Michael Smith
US Army Corps of Engineers
Remote Sensing/GIS Center
Hanover, NH
On 10/5/10 7:26 AM, "Sebastian E. Ovide" <sebastian.ovide at gmail.com> wrote:
> I've also add a script that prints the variables and TNS_ADMIN is there...
>
> USERNAME=root
> LANG=en_US.UTF-8
> SUDO_GID=1001
> SHELL=/bin/bash
> SUDO_COMMAND=/etc/init.d/lighttpd restart
> ORACLE_HOME=/home/gis/libs/instantclient_11_2/
> SUDO_UID=1001
> TERM=xterm
> PHP_FCGI_CHILDREN=1
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> PWD=/home/gis/conf
> LOGNAME=root
> USER=root
> HOME=/home/gis
> MAIL=/var/mail/gis
> SUDO_USER=gis
> LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:
> cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:
> ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01
> ;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01
> ;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz
> =01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31
> :*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp
> =01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35
> :*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.p
> cx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01
> ;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.
> wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01
> ;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cg
> m=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;3
> 6:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.m
> pc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;3
> 6:*.xspf=00;36:
> LD_LIBRARY_PATH=/home/gis/libs/instantclient_11_2/
> TNS_ADMIN=/home/gis/conf/
>
> any other ideas ?
>
> On Thu, Sep 30, 2010 at 3:09 PM, Sebastian E. Ovide
> <sebastian.ovide at gmail.com> wrote:
>> done. (restarted server etc...)
>>
>> exactly the same problem...
>>
>>
>>
>>
>>
>> On Thu, Sep 30, 2010 at 2:51 PM, Dan Little <danlittle at yahoo.com> wrote:
>>> 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 ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101005/2003d86e/attachment.htm>
More information about the MapServer-users
mailing list