[OpenLayers-Users] How to set up the proxy?

=?GBK?B?ufnR9NKr?= gistop at 163.com
Mon Oct 31 04:15:12 EDT 2011


I know this has been asked before.but....
I mean there is sth different.
Openlayer2.11 Apache-Tomcat7.0(not Apache)

So my question is how to set up the proxy host in Tomcat7.0

I find this by google.but I could find  servlets-cgi,and there is no server folder,etc.
It is totally different.

Any suggestion will be welcome.

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:

    <servlet> 
         <servlet-name>cgi</servlet-name> 
        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class> 
        <init-param> 
              <param-name>debug</param-name> 
              <param-value>0</param-value> 
        </init-param> 
        <init-param> 
              <param-name>cgiPathPrefix</param-name> 
              <param-value>WEB-INF/cgi</param-value> 
        </init-param> 
        <load-on-startup>5</load-on-startup> 
    </servlet> 

    <servlet-mapping> 
          <servlet-name>cgi</servlet-name> 
          <url-pattern>/cgi-bin/*</url-pattern> 
    </servlet-mapping> 

You have also to add this piece of code:

      <param-name>executable</param-name>
        <param-value>c:\python25\python.exe</param-value> 
       </init-param>

<init-param>
<param-name>passShellEnvironment</param-name>
<param-value>true</param-value>
</init-param>


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

3.- I downloaded the "proxy.cgi" file from Openlayers:http://trac.openlayers.org/browser/trunk/openlayers/examples/proxy.cgi 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"

4.- In the proxy.cgi file I included my machine in the allowed hosts:

allowedHosts = ['demo.mapfish.org', 'localhost:5000', 'localhost', '127.0.0.1']

5.- I included this piece of code in my map:

OpenLayers.ProxyHost = "/client/cgi-bin/proxy.cgi?url=";
6.- I also included in our client folder the context.xml file:

C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\client\META-INF\context.xml

Make sure that the privileged is set to: "true":

<Context privileged="true" antiResourceLocking="false" antiJARLocking="false" />

7.- Restart Tomcat.

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111031/5c7ea2aa/attachment.html


More information about the Users mailing list