<DIV>Hi <BR>I came across error when using Tomcat 5.5 under Windows OS to set the proxy work properly. I have remove the comment of the servlet and mapping, and renname the jar folloing the steps found on Apache site. But when I try to acess the <A href="http://localhost:8080/geoserver/cgi-bin/proxy.cgi,I">http://localhost:8080/geoserver/cgi-bin/proxy.cgi,I</A> always get a error:<BR>Some unexpected error occurred. Error text was: <urlopen error (11001, 'getaddrinfo failed')></DIV>
<DIV>I can get a <A href="http://localhost:8080/geoserver/cgi-bin/test1.cgi">http://localhost:8080/geoserver/cgi-bin/test1.cgi</A> work and print "hello world" on the browser.</DIV>
<DIV>The cotent of test1.cgi is below:</DIV>
<DIV>*************</DIV>
<DIV>#!C:\Python25\python -u</DIV>
<DIV>import urllib2<BR>import cgi<BR>import sys, os<BR>import urllib</DIV>
<DIV><BR>print "hello world"</DIV>
<DIV>**************</DIV>
<DIV> </DIV>
<DIV>And I write a test2.cgi:<BR>************<BR>#!C:\Python25\python -u<BR>import urllib2<BR>import cgi<BR>import sys, os<BR>import urllib<BR># Designed to prevent Open Proxy type stuff.</DIV>
<DIV>try:<BR> the_url = "<A href="http://www.google.com">http://www.google.com</A>"<BR> req = urllib2.urlopen(the_url)<BR> print req.read()<BR>except Exception, E:<BR> print "Status: 500 Unexpected Error"<BR> print "Content-Type: text/plain"<BR> print <BR> print "Some unexpected error occurred. Error text was:", E<BR> the_url = "<A href="http://www.google.com">http://www.google.com</A>"<BR> req = urllib2.urlopen(the_url)<BR>************/</DIV>
<DIV>When I access <A href="http://localhost:8080/geoserver/cgi-bin/test2.cgi">http://localhost:8080/geoserver/cgi-bin/test2.cgi</A> I get the same error:
<DIV> Some unexpected error occurred. Error text was: <urlopen error (11001, 'getaddrinfo failed')></DIV>
<DIV>So I think the problem is the urllib2.urlopen(). But I can get it work properly using console command: pythoy test2.cgi and get the html content, but after I put it under tomcat I get such a error, I don't know why, is it because I didn't configur the Tomcat correctly?</DIV></DIV>
<DIV>Thank you, best regards!</DIV>
<DIV> lorkyo</DIV><br><!-- footer --><br>
<hr>
<a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/004572_0806_4537.html">想免费升级vip邮箱吗?</a><font style="font-size:12px;line-height:15px;">快来参加喝汇源游网易活动吧!</font>