<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><P>I know this has been asked before.but....<BR>I mean there is sth different.<BR>Openlayer2.11 Apache-Tomcat7.0(not Apache)</P>
<P>So my question is how to set up the proxy host in Tomcat7.0</P>
<P>I find this by google.but I could find servlets-cgi,and there is no server folder,etc.<BR>It is totally different.</P>
<P>Any suggestion will be welcome.</P>
<P>1.- I modified the file: "web.xml" C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\conf\web.xml. I uncomented the following lines of code: </P>
<P> <servlet> <BR> <servlet-name>cgi</servlet-name> <BR> <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class> <BR> <init-param> <BR> <param-name>debug</param-name> <BR> <param-value>0</param-value> <BR> </init-param> <BR> <init-param> <BR> <param-name>cgiPathPrefix</param-name> <BR> <param-value>WEB-INF/cgi</param-value> <BR> </init-param> <BR> <load-on-startup>5</load-on-startup> <BR> </servlet> </P>
<P> <servlet-mapping> <BR> <servlet-name>cgi</servlet-name> <BR> <url-pattern>/cgi-bin/*</url-pattern> <BR> </servlet-mapping> </P>
<P>You have also to add this piece of code: </P>
<P> <param-name>executable</param-name><BR> <param-value>c:\python25\python.exe</param-value> <BR> </init-param></P>
<P><init-param><BR><param-name>passShellEnvironment</param-name><BR><param-value>true</param-value><BR></init-param></P>
<P><BR>2.- I renamed the file servlets-cgi.renametojar to servlets-cgi.jar under the folder: C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\lib </P>
<P>3.- I downloaded the "proxy.cgi" file from Openlayers: <A href="http://trac.openlayers.org/browser/trunk/openlayers/examples/proxy.cgi">http://trac.openlayers.org/browser/trunk/openlayers/examples/proxy.cgi</A> and copy the file in a folder called "cgi-bin" that I created under my directory: "C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\client\WEB-INF\cgi\proxy.cgi" </P>
<P>4.- In the proxy.cgi file I included my machine in the allowed hosts: </P>
<P>allowedHosts = ['demo.mapfish.org', 'localhost:5000', 'localhost', '127.0.0.1'] </P>
<P>5.- I included this piece of code in my map: </P>
<P>OpenLayers.ProxyHost = "/client/cgi-bin/proxy.cgi?url="; <BR>6.- I also included in our client folder the context.xml file: </P>
<P>C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\client\META-INF\context.xml </P>
<P>Make sure that the privileged is set to: "true": </P>
<P><Context privileged="true" antiResourceLocking="false" antiJARLocking="false" /></P>
<P>7.- Restart Tomcat. </P>
<P> <BR></P></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"><hr/>
<a href="http://v.163.com/special/positivepsychology/?from=mailfooter" target="_blank">网易公开课推出哈佛最受欢迎《幸福》课程,帮您修满幸福学分!</a>
</span></span>