[OpenLayers-Users] Open layers proxy problem
maw269
maw269 at gmail.com
Mon Dec 2 07:54:31 PST 2013
Here are the instructions I use for Tomcat:
Creating a CGI proxy under Tomcat
1. Go to or create tomcat/webapps/your-application/WEB-INF/web.xml
2. Add the following to the above web.xml:
<web-app>
<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>
<init-param>
<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>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
</web-app>
3. Download "proxy.cgi" from
http://trac.osgeo.org/openlayers/browser/trunk/openlayers/examples/proxy.cgi
4. Go to or create tomcat/webapps/your-application/WEB-INF/cgi
5. Move downloaded proxy.cgi to this directory
6. Add your domain to allowed hosts in proxy.cgi . This is the service you
are trying to allow access.
7. Include the following code in your OL map:
OpenLayers.ProxyHost = "/your-application/cgi-bin/proxy.cgi?url=";
8. Go to or create tomcat/webapps/your-application/META-INF
9. Create a context.xml in that directory
10. Add the following to that xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true"
antiJARLocking="false"/>
11. Restart Tomcat
Here are the instructions I use for Apache:
1. Download proxy.cgi from
http://trac.osgeo.org/openlayers/browser/trunk/openlayers/examples/proxy.cgi
2. Move proxy.cgi to Apache\cgi-bin folder
3. Change the first line from #!/usr/bin/env python to #!C:/Python27/python
(assumed here that the Python is/will be installed in C:\Python27 folder)
4. Modify the allowHosts array in the script as needed
5. Restart Apache
6. Add to openlayers map js
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
_______________
Note change any paths or versions to your paths and your versions i.e.
C:\Python27 or C:\python25\python.exe
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Open-layers-proxy-problem-tp5090987p5092203.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list