WFS Proxy Issue

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

WFS Proxy Issue

JoCook
Hi All,
 
I have been trying to implement a wfs layer in Open Layers 2.2, and am struggling with the proxy settings. Currently this is all working on my local machine, so initially I didn't think I needed any setting for ProxyHost, but the layer simply didn't display (I've checked that it works in a different wfs reader). I then tried to add the line
 
OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";
 
(along with adding a proxy.cgi file in my cgi-bin folder) as suggested in previous questions, and on the FAQ. However, I get a popup message telling me that I have an internal server error 500. When I try and go to http://locahost/cgi-bin/proxy.cgi this also sends me to a 500 error page. My apache error log tells me that it
 
"couldn't spawn child process: c:/apache/cgi-bin/proxy.cgi"
 
Any other version of the OpenLayers.ProxyHost line seems to give me an unhandled exception error instead.
 
I am using Apache 1.3 on Windows XP Pro, and I'm concerned that my apache setup might not be configured correctly but I don't know where to start looking to find out.
 
Any advice on this would be gratefully received,
 
Thanks
 
Jo
-------------------------------------------
Joanne Cook BSc MLitt AIFA MBCS
Information Systems Coordinator
Oxford Archaeology North
-------------------------------------------


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: WFS Proxy Issue

Christopher Schmidt-2
On Tue, Nov 21, 2006 at 01:37:31PM -0000, joanne cook wrote:

> Hi All,
>  
> I have been trying to implement a wfs layer in Open Layers 2.2, and am struggling with the proxy settings. Currently this is all working on my local machine, so initially I didn't think I needed any setting for ProxyHost, but the layer simply didn't display (I've checked that it works in a different wfs reader). I then tried to add the line
>  
> OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";
>  
> (along with adding a proxy.cgi file in my cgi-bin folder) as suggested in previous questions, and on the FAQ. However, I get a popup message telling me that I have an internal server error 500. When I try and go to http://locahost/cgi-bin/proxy.cgi this also sends me to a 500 error page. My apache error log tells me that it
>  
> "couldn't spawn child process: c:/apache/cgi-bin/proxy.cgi"
>  
> Any other version of the OpenLayers.ProxyHost line seems to give me an unhandled exception error instead.

The proxy.cgi script that OpenLayers distributes is designed for use on
Linux machines with Python installed. In order to have it work under
Windows, you will probably need to change the first line of the script
to read:

#!c:/Python/python.exe -u

or something similar.

More information is available on this topic on
http://www.imladris.com/Scripts/PythonForWindows.html -- if you can't
get it working, you might try there for more tips/tricks for setting up
Python CGI under Windows.

Alternatively, you might want to write some other kind of proxy script,
if you have an environment set up for other scripting languages. I don't
know what you might have set up, but you could write a script in PHP,
for example, if you have your system set up to run PHP.

Do you have other scripting support set up already?  Do you have a
preferred programming language?

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: WFS Proxy Issue

JoCook
In reply to this post by JoCook
Hi Christopher,
 
Many thanks for the pointer there! The instructions below have worked up to a point, except that I can only seem to get a response if my proxy.cgi is actually called proxy.py, despite adding the appropriate lines in my apache httpd.conf file to use python for cgi. I ended up following these instructions here:
http://www.python.org/infogami-faq/windows/how-do-i-use-python-for-cgi/
 
If I now go to http://localhost/cgi-bin/proxy.py I get to the OpenLayers homepage. However, having modified my Map page to set OpenLayers.ProxyHost = "/cgi-bin/proxy.py?url="
 
I now get an error message that says "Unhandled Request Return Bad Gateway".
 
Any thoughts?
 
Thanks
 
Jo
 
-------------------------------------------
Joanne Cook BSc MLitt AIFA MBCS
Information Systems Coordinator
Oxford Archaeology North
-------------------------------------------

________________________________

From: Christopher Schmidt [mailto:[hidden email]]
Sent: Tue 21/11/2006 15:41
To: joanne cook
Cc: [hidden email]
Subject: Re: [OpenLayers-Users] WFS Proxy Issue



On Tue, Nov 21, 2006 at 01:37:31PM -0000, joanne cook wrote:

> Hi All,
>
> I have been trying to implement a wfs layer in Open Layers 2.2, and am struggling with the proxy settings. Currently this is all working on my local machine, so initially I didn't think I needed any setting for ProxyHost, but the layer simply didn't display (I've checked that it works in a different wfs reader). I then tried to add the line
>
> OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";
>
> (along with adding a proxy.cgi file in my cgi-bin folder) as suggested in previous questions, and on the FAQ. However, I get a popup message telling me that I have an internal server error 500. When I try and go to http://locahost/cgi-bin/proxy.cgi this also sends me to a 500 error page. My apache error log tells me that it
>
> "couldn't spawn child process: c:/apache/cgi-bin/proxy.cgi"
>
> Any other version of the OpenLayers.ProxyHost line seems to give me an unhandled exception error instead.

The proxy.cgi script that OpenLayers distributes is designed for use on
Linux machines with Python installed. In order to have it work under
Windows, you will probably need to change the first line of the script
to read:

#!c:/Python/python.exe -u

or something similar.

More information is available on this topic on
http://www.imladris.com/Scripts/PythonForWindows.html -- if you can't
get it working, you might try there for more tips/tricks for setting up
Python CGI under Windows.

Alternatively, you might want to write some other kind of proxy script,
if you have an environment set up for other scripting languages. I don't
know what you might have set up, but you could write a script in PHP,
for example, if you have your system set up to run PHP.

Do you have other scripting support set up already?  Do you have a
preferred programming language?

Regards,
--
Christopher Schmidt
MetaCarta







This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: WFS Proxy Issue

Christopher Schmidt-2
On Tue, Nov 21, 2006 at 04:27:51PM -0000, joanne cook wrote:
> Hi Christopher,
>  
> Many thanks for the pointer there! The instructions below have worked up to a point, except that I can only seem to get a response if my proxy.cgi is actually called proxy.py, despite adding the appropriate lines in my apache httpd.conf file to use python for cgi. I ended up following these instructions here:
> http://www.python.org/infogami-faq/windows/how-do-i-use-python-for-cgi/
>  
> If I now go to http://localhost/cgi-bin/proxy.py I get to the OpenLayers homepage. However, having modified my Map page to set OpenLayers.ProxyHost = "/cgi-bin/proxy.py?url="
>  
> I now get an error message that says "Unhandled Request Return Bad Gateway".

"Bad Gateway" is returned if proxy.cgi / proxy.py is loading a URL which
is not in its list of allowed hosts. The default is:


allowedHosts = ['www.openlayers.org', 'openlayers.org',
                'octo.metacarta.com',
                'merrimack.metacarta.com',
                'labs.metacarta.com', 'world.freemap.in']

If you edit this line inside proxy.py, you can add your own host to the
list. The reason for this is to prevent your server from being used as
an open proxy to any host on the web.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users