<HTML>
<HEAD>
<TITLE>Re: [mapserver-users] lighttpd, TNS:could not resolve...</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Sebastian,<BR>
<BR>
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<BR>
<BR>
CONNECTION &#8220;user/pass@hostname/service_name&#8221;<BR>
<BR>
Mike<BR>
<BR>
<BR>
-- <BR>
Michael Smith<BR>
US Army Corps of Engineers<BR>
Remote Sensing/GIS Center<BR>
Hanover, NH <BR>
<BR>
&nbsp;<BR>
<BR>
<BR>
On 10/5/10 7:26 AM, &quot;Sebastian E. Ovide&quot; &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I've also add a script that prints the variables and TNS_ADMIN is there...<BR>
<BR>
USERNAME=root<BR>
LANG=en_US.UTF-8<BR>
SUDO_GID=1001<BR>
SHELL=/bin/bash<BR>
SUDO_COMMAND=/etc/init.d/lighttpd restart<BR>
ORACLE_HOME=/home/gis/libs/instantclient_11_2/<BR>
SUDO_UID=1001<BR>
TERM=xterm<BR>
PHP_FCGI_CHILDREN=1<BR>
PATH=/sbin:/bin:/usr/sbin:/usr/bin<BR>
PWD=/home/gis/conf<BR>
LOGNAME=root<BR>
USER=root<BR>
HOME=/home/gis<BR>
MAIL=/var/mail/gis<BR>
SUDO_USER=gis<BR>
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:*.pcx=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:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:<BR>
LD_LIBRARY_PATH=/home/gis/libs/instantclient_11_2/<BR>
TNS_ADMIN=/home/gis/conf/<BR>
<BR>
any other ideas ?<BR>
<BR>
On Thu, Sep 30, 2010 at 3:09 PM, Sebastian E. Ovide &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt; wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>done. (restarted server etc...)<BR>
<BR>
exactly the same problem...<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
On Thu, Sep 30, 2010 at 2:51 PM, Dan Little &lt;<a href="danlittle@yahoo.com">danlittle@yahoo.com</a>&gt; wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'>I was starting to suspect MapServer is just no seeing the environment variables...<BR>
<BR>
Try this... write a wrapper script &quot;mapserv.sh&quot;<BR>
<BR>
#!/bin/bash<BR>
<BR>
TNS_ADMIN=/home/gis/conf<BR>
<BR>
/home/gis/bin/mapserv<BR>
<BR>
Then update your script to point to &quot;mapserv.sh&quot;.<BR>
<BR>
<BR>
<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'><BR>
</SPAN></FONT></FONT><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>From:</B></SPAN><SPAN STYLE='font-size:12pt'> Sebastian E. Ovide &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt;<BR>
<B>To:</B> Dan Little &lt;<a href="danlittle@yahoo.com">danlittle@yahoo.com</a>&gt;<BR>
<B>Cc:</B> Rahkonen Jukka &lt;<a href="Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>&gt;; <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
<B>Sent:</B> Thu, September 30, 2010 8:01:22 AM<BR>
<BR>
<B>Subject:</B> Re: [mapserver-users] lighttpd, TNS:could not resolve...<BR>
</SPAN></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"><BR>
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 </FONT></SPAN><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'>&quot;TNS_ADMIN&quot; =&gt; &quot;/home/gis/conf/&quot; is ignored (in apache I've used SetEnv and PassEnv<BR>
</SPAN></FONT></FONT><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'><BR>
???<BR>
</SPAN></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"><BR>
On Thu, Sep 30, 2010 at 12:22 PM, Dan Little &lt;<a href="danlittle@yahoo.com">danlittle@yahoo.com</a>&gt; wrote:<BR>
</FONT></SPAN><BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'>Does shp2img work with your Mapfile?<BR>
</SPAN></FONT></FONT><BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'><BR>
</SPAN></FONT></FONT><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>From:</B></SPAN><SPAN STYLE='font-size:12pt'> Sebastian E. Ovide &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt;<BR>
<B>To:</B> Rahkonen Jukka &lt;<a href="Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>&gt;<BR>
<B>Cc:</B> <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
<B>Sent:</B> Thu, September 30, 2010 4:47:30 AM<BR>
<B>Subject:</B> Re: [mapserver-users] lighttpd, TNS:could not resolve...<BR>
</SPAN></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"><BR>
the message says: <BR>
<BR>
ORA-12154: TNS:could not resolve the connect identifier specified in &lt;unnamed&gt;<BR>
<BR>
so... does &lt;unnamed&gt; mean that gdal didn't get any name for the connection ?<BR>
<BR>
<BR>
<BR>
On Thu, Sep 30, 2010 at 9:54 AM, Sebastian E. Ovide &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt; wrote:<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman">no luck...<BR>
<BR>
renamed servicename to capital.. so now connection name==service name...<BR>
<BR>
same problem... ogrinfo works, mapserver doesn't....<BR>
<BR>
<BR>
On Thu, Sep 30, 2010 at 9:37 AM, Rahkonen Jukka &lt;<a href="Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>&gt; wrote:<BR>
</FONT></SPAN></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><FONT COLOR="#0000FF"><FONT FACE="Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
</SPAN></FONT></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT><FONT COLOR="#0000FF"><FONT FACE="Arial"><SPAN STYLE='font-size:11pt'>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 </SPAN></FONT></FONT><FONT SIZE="4"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:14pt'>MFUATDB for you. <BR>
</SPAN></FONT></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT><FONT COLOR="#0000FF"><FONT FACE="Arial"><SPAN STYLE='font-size:11pt'>Actually, the error message </SPAN></FONT></FONT><FONT SIZE="4"><FONT FACE="Times New Roman"><SPAN STYLE='font-size:14pt'>&quot;TNS:could not resolve the connect identifier specified&quot; may mean that you should not use service name but the connect identifier.  Have a try and tell how it went.<BR>
</SPAN></FONT></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
 <BR>
</SPAN><FONT SIZE="4"><SPAN STYLE='font-size:14pt'>-Jukka Rahkonen-</SPAN></FONT></FONT><FONT COLOR="#0000FF"><FONT FACE="Arial"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"><BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="100%"> </FONT></SPAN><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>L&auml;hett&auml;j&auml;:</B></SPAN><SPAN STYLE='font-size:12pt'> &nbsp;<a href="mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> &nbsp;[<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mailto:mapserver-users-bounces@lists.osgeo.org</a>] <B>Puolesta </B>Sebastian E. &nbsp;Ovide<BR>
<B>L&auml;hetetty:</B> 30. syyskuuta 2010 11:15<BR>
<B>Vastaanottaja:</B> &nbsp;Dan Little<BR>
<B>Kopio:</B> <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
<B>Aihe:</B> &nbsp;Re: [mapserver-users] lighttpd, TNS:could not resolve...<BR>
</SPAN></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"><BR>
&nbsp;<BR>
yes. <BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
gis@mapserver:~$ ls -la /home/gis/conf/tnsnames.ora<BR>
&nbsp;<BR>
-rw-r--r-- 1 gis gis 184 2010-09-29 16:19 &nbsp;/home/gis/conf/tnsnames.ora<BR>
&nbsp;<BR>
gis@mapserver:~$ sudo su www-data -c 'cat &nbsp;/home/gis/conf/tnsnames.ora'<BR>
&nbsp;<BR>
MFUATDB =<BR>
&nbsp;<BR>
  (DESCRIPTION =<BR>
&nbsp;<BR>
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.60.70)(PORT &nbsp;= 1521))<BR>
&nbsp;<BR>
    (CONNECT_DATA =<BR>
&nbsp;<BR>
      (SERVER = DEDICATED)<BR>
&nbsp;<BR>
      (SERVICE_NAME = mfuatdb)<BR>
&nbsp;<BR>
    )<BR>
&nbsp;<BR>
  )<BR>
&nbsp;<BR>
<BR>
<BR>
&nbsp;<BR>
On Wed, Sep 29, 2010 at 7:58 PM, Dan Little &lt;<a href="danlittle@yahoo.com">danlittle@yahoo.com</a>&gt; wrote:<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
</FONT></SPAN><FONT SIZE="2"><FONT FACE="Arial"><SPAN STYLE='font-size:10pt'> <BR>
Is tnsnames.ora accessible by the web-server user? (Check the &nbsp;permissions.)<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
Is &nbsp;t<BR>
&nbsp;<BR>
</SPAN></FONT></FONT><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><B>From:</B></SPAN><SPAN STYLE='font-size:12pt'> &nbsp;Sebastian E. Ovide &lt;<a href="sebastian.ovide@gmail.com">sebastian.ovide@gmail.com</a>&gt;<BR>
<B>To:</B> <a href="mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><BR>
<B>Sent:</B> Wed, September 29, 2010 &nbsp;11:10:09 AM<BR>
<B>Subject:</B> &nbsp;[mapserver-users] lighttpd, TNS:could not resolve...<BR>
</SPAN></FONT><SPAN STYLE='font-size:12pt'><FONT FACE="Times New Roman"> <BR>
&nbsp;<BR>
&nbsp;<BR>
<BR>
Hi All, <BR>
<BR>
&nbsp;<BR>
I have installed MapServer on lighttpd + fastcgi.<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
fastcgi.server = (<BR>
&nbsp;<BR>
        &quot;/mapserver&quot; =&gt;<BR>
&nbsp;<BR>
        ( &quot;localhost&quot; =&gt;<BR>
&nbsp;<BR>
                (<BR>
&nbsp;<BR>
                   &nbsp;     &quot;socket&quot; =&gt; &quot;/tmp/mapserver-fastcgi.socket&quot;,<BR>
&nbsp;<BR>
                   &nbsp;     &quot;bin-path&quot; =&gt; &quot;/home/gis/bin/mapserv&quot;,<BR>
&nbsp;<BR>
                   &nbsp;     &quot;bin-environment&quot; =&gt;<BR>
&nbsp;<BR>
                   &nbsp;     (<BR>
&nbsp;<BR>
                   &nbsp;             &quot;TNS_ADMIN&quot; =&gt; &nbsp;&quot;/home/gis/conf/&quot;<BR>
&nbsp;<BR>
                   &nbsp;     ),<BR>
&nbsp;<BR>
                   &nbsp;     &quot;max-procs&quot; =&gt; 2,<BR>
&nbsp;<BR>
                   &nbsp;     &quot;check-local&quot; =&gt; &quot;disable&quot;<BR>
&nbsp;<BR>
                )<BR>
&nbsp;<BR>
        )<BR>
&nbsp;<BR>
)<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
gis@mapserver:~$ cat /home/gis/conf/tnsnames.ora<BR>
&nbsp;<BR>
MFUATDB =<BR>
&nbsp;<BR>
  (DESCRIPTION =<BR>
&nbsp;<BR>
    (ADDRESS = (PROTOCOL = TCP)(HOST = &nbsp;192.168.60.70)(PORT = 1521))<BR>
&nbsp;<BR>
    (CONNECT_DATA =<BR>
&nbsp;<BR>
      (SERVER = DEDICATED)<BR>
&nbsp;<BR>
      (SERVICE_NAME = mfuatdb)<BR>
&nbsp;<BR>
    )<BR>
&nbsp;<BR>
  )<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
and I'm getting: <BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
msDrawMap(): Image handling error. Failed to draw layer named &nbsp;'TESTII'. msOGRFileOpen(): OGR error. Open failed for OGR connection in &nbsp;layer `TESTII'. ORA-12154: TNS:could not resolve the connect identifier &nbsp;specified in &lt;unnamed&gt;<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
from the logs:<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].649965 CGI Request 1 on process 1513<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].717290 msOGRFileOpen(): OGR error. Open &nbsp;failed for OGR connection in layer `TESTII'.<BR>
&nbsp;<BR>
ORA-12154: TNS:could not resolve the connect identifier &nbsp;specified<BR>
&nbsp;<BR>
 in &lt;unnamed&gt;<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].717319 msDrawMap(): Image handling error. &nbsp;Failed to draw layer named 'TESTII'.<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].717454 msFreeMap(): freeing map at &nbsp;0xa00f298.<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].717579 freeLayer(): freeing layer at &nbsp;0xa0237a0.<BR>
&nbsp;<BR>
[Wed Sep 29 17:00:13 2010].717591 freeLayer(): freeing layer at &nbsp;0xa024718.<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
in mapserver:<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
  LAYER<BR>
&nbsp;<BR>
    NAME TESTII<BR>
&nbsp;<BR>
    TYPE POLYGON<BR>
&nbsp;<BR>
    STATUS ON<BR>
&nbsp;<BR>
    CONNECTION &nbsp;&quot;OCI:GEO_US_DATA/GEO_US_DATA@mfuatdb&quot;<BR>
&nbsp;<BR>
    CONNECTIONTYPE OGR<BR>
&nbsp;<BR>
    DATA &quot;CA_WILDFIRE&quot;<BR>
&nbsp;<BR>
    PROJECTION<BR>
&nbsp;<BR>
      &quot;init=epsg:3857&quot;<BR>
&nbsp;<BR>
    END<BR>
&nbsp;<BR>
    CLASS<BR>
&nbsp;<BR>
#      NAME &quot;local_shape&quot;<BR>
&nbsp;<BR>
      COLOR 0 0 255<BR>
&nbsp;<BR>
      OUTLINECOLOR 0 0 255<BR>
&nbsp;<BR>
    END<BR>
&nbsp;<BR>
  END<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
The connection string is right as I'm using it from gdal:<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
gis@mapserver:~$ ogrinfo &nbsp;OCI:GEO_US_DATA/GEO_US_DATA@mfuatdb:CA_WILDFIRE<BR>
&nbsp;<BR>
INFO: Open of `OCI:GEO_US_DATA/GEO_US_DATA@mfuatdb:CA_WILDFIRE'<BR>
&nbsp;<BR>
      using driver `OCI' successful.<BR>
&nbsp;<BR>
1: CA_WILDFIRE<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
any ideas ?<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
<BR>
&nbsp;<BR>
</FONT></SPAN>
</BODY>
</HTML>