OpenLayers Proxying in IIS

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

OpenLayers Proxying in IIS

Jeff Dege
OpenLayers uses AJAX, and AJAX has a problem with cross-domain http
requests.  So OpenLayers has a mechanism by which a proxy prefix can be
prepended to every request, directing the request to a proxy site on the
host domain.

The issue has always been how to set up such a proxy site.

If your website is hosted by Apache, it's easy.  Apache ships with tools
that make creating such a proxy easy.

If your website is IIS, it has not been.  I, at least, have been unable
to find either public domain code, or understandable instructions, on
how to create a proxying site for IIS.

I've asked on OpenLayers-Users, and had no answers.  I've asked
elsewhere, and had no answers.

Eventually, I found a discussion of the issue:
 
http://blogs.msdn.com/david.wang/archive/2005/08/01/HOWTO_Common_URL_Red
irection_Techniques_for_IIS_Summary.aspx

The relevant quote:

   No one seems to provide modules to do Server-Side Redirection or
Server-Side
   Forwarding on IIS for free. At least, I am not aware of any
free/open-source
   add-on IIS modules which implement those Server-Side behaviors; I
only know
   of for-fee modules like ISAPIRewrite.

Which got me looking for ISAPIRewrite.  This I found at:

    http://www.helicontech.com/isapi_rewrite/

This is a commercial, but reasonably priced ($99), ISAPI filter DLL that
implements the functionality of Apache's mod_rewrite and mod_proxy.  And
with it, creating a forwarding proxy for OpenLayers is simple.

ISAPI_Rewrite has a "lite" version that is free, but the lite version
doesn't do proxying.  The commercial version is available for download
on a 45-day free trial.  I downloaded it yesterday morning, and had a
proxy working before lunchtime.

I know there are others who have had the same problem.  This may be of
help.

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

Re: OpenLayers Proxying in IIS

Christopher Schmidt-2
On Fri, Oct 05, 2007 at 09:56:41AM -0500, Jeff Dege wrote:
> If your website is IIS, it has not been.  I, at least, have been unable
> to find either public domain code, or understandable instructions, on
> how to create a proxying site for IIS.

Users have successfully configured Python-as-CGI under IIS: the
TileCache readme has information that users have provided on getting
TileCache set up in this way:

http://svn.tilecache.org/trunk/tilecache/README

If you can get TileCache running under IIS, it should be equally
possible to get the proxy.cgi shipped with OpenLayers to run under CGI
-- they are both just Python CGI scripts. (The proxy.cgi is actually way
simpler.)

http://svn.openlayers.org/trunk/openlayers/examples/proxy.cgi

Is there a free version of IIS? I have a Windows XP desktop sitting on
my machine: I could see if it's possible to set this up.  

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

Re: OpenLayers Proxying in IIS

John Cole X
In reply to this post by Jeff Dege
Search the mailing list, I posted a WFS proxy in asp.net a while back.

John

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Jeff Dege
Sent: Friday, October 05, 2007 9:57 AM
To: [hidden email]
Subject: [OpenLayers-Users] OpenLayers Proxying in IIS

OpenLayers uses AJAX, and AJAX has a problem with cross-domain http
requests.  So OpenLayers has a mechanism by which a proxy prefix can be
prepended to every request, directing the request to a proxy site on the
host domain.

The issue has always been how to set up such a proxy site.

If your website is hosted by Apache, it's easy.  Apache ships with tools
that make creating such a proxy easy.

If your website is IIS, it has not been.  I, at least, have been unable
to find either public domain code, or understandable instructions, on
how to create a proxying site for IIS.

I've asked on OpenLayers-Users, and had no answers.  I've asked
elsewhere, and had no answers.

Eventually, I found a discussion of the issue:
 
http://blogs.msdn.com/david.wang/archive/2005/08/01/HOWTO_Common_URL_Red
irection_Techniques_for_IIS_Summary.aspx

The relevant quote:

   No one seems to provide modules to do Server-Side Redirection or
Server-Side
   Forwarding on IIS for free. At least, I am not aware of any
free/open-source
   add-on IIS modules which implement those Server-Side behaviors; I
only know
   of for-fee modules like ISAPIRewrite.

Which got me looking for ISAPIRewrite.  This I found at:

    http://www.helicontech.com/isapi_rewrite/

This is a commercial, but reasonably priced ($99), ISAPI filter DLL that
implements the functionality of Apache's mod_rewrite and mod_proxy.  And
with it, creating a forwarding proxy for OpenLayers is simple.

ISAPI_Rewrite has a "lite" version that is free, but the lite version
doesn't do proxying.  The commercial version is available for download
on a 45-day free trial.  I downloaded it yesterday morning, and had a
proxy working before lunchtime.

I know there are others who have had the same problem.  This may be of
help.

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release Date: 10/4/2007
8:59 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release Date: 10/4/2007
8:59 AM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers Proxying in IIS

Jeff Dege
When I asked Erik whether it would be appropriate to suggest a
commercial package on the list, he said yes, it might be of help to
others with the same problem, and it would probably encourage others to
offer their own solutions, which would also be of help to others with
the same problem.
 

> -----Original Message-----
> From: John Cole [mailto:[hidden email]]
> Sent: Friday, October 05, 2007 10:56 AM
> To: Jeff Dege; [hidden email]
> Subject: RE: [OpenLayers-Users] OpenLayers Proxying in IIS
>
> Search the mailing list, I posted a WFS proxy in asp.net a while back.
>
> John
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Jeff Dege
> Sent: Friday, October 05, 2007 9:57 AM
> To: [hidden email]
> Subject: [OpenLayers-Users] OpenLayers Proxying in IIS
>
> OpenLayers uses AJAX, and AJAX has a problem with cross-domain http
> requests.  So OpenLayers has a mechanism by which a proxy
> prefix can be
> prepended to every request, directing the request to a proxy
> site on the
> host domain.
>
> The issue has always been how to set up such a proxy site.
>
> If your website is hosted by Apache, it's easy.  Apache ships
> with tools
> that make creating such a proxy easy.
>
> If your website is IIS, it has not been.  I, at least, have
> been unable
> to find either public domain code, or understandable instructions, on
> how to create a proxying site for IIS.
>
> I've asked on OpenLayers-Users, and had no answers.  I've asked
> elsewhere, and had no answers.
>
> Eventually, I found a discussion of the issue:
>  
> http://blogs.msdn.com/david.wang/archive/2005/08/01/HOWTO_Comm
> on_URL_Red
> irection_Techniques_for_IIS_Summary.aspx
>
> The relevant quote:
>
>    No one seems to provide modules to do Server-Side Redirection or
> Server-Side
>    Forwarding on IIS for free. At least, I am not aware of any
> free/open-source
>    add-on IIS modules which implement those Server-Side behaviors; I
> only know
>    of for-fee modules like ISAPIRewrite.
>
> Which got me looking for ISAPIRewrite.  This I found at:
>
>     http://www.helicontech.com/isapi_rewrite/
>
> This is a commercial, but reasonably priced ($99), ISAPI
> filter DLL that
> implements the functionality of Apache's mod_rewrite and
> mod_proxy.  And
> with it, creating a forwarding proxy for OpenLayers is simple.
>
> ISAPI_Rewrite has a "lite" version that is free, but the lite version
> doesn't do proxying.  The commercial version is available for download
> on a 45-day free trial.  I downloaded it yesterday morning, and had a
> proxy working before lunchtime.
>
> I know there are others who have had the same problem.  This may be of
> help.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release
> Date: 10/4/2007
> 8:59 AM
>  
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release
> Date: 10/4/2007
> 8:59 AM
>  
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity
> to whom they are addressed. If you have received this email
> in error please notify the sender. This message contains
> confidential information and is intended only for the
> individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail.
>
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers Proxying in IIS

Richard Duivenvoorde
In reply to this post by Christopher Schmidt-2
Christopher Schmidt wrote:

> Is there a free version of IIS? I have a Windows XP desktop sitting on
> my machine: I could see if it's possible to set this up.  

If you have Windows XP Professional, it's available in 'Add or Remove
Programs/ and the 'Add Remove Windows Components'. I'm not sure if it's
available in other Windows XP versions though?

Below is some part of a mail I wrote trying to help somebody with
IIS5(==IIS in XP, IIS6 is in WindowsServer) and tilecache. Maybe it's
helpfull here?

 >>>>

First to check: can you run python as cgi's in your IIS?
- I've been looking for metabase.xml also, but I think it's IIS6 only??
- You either have to move stuff to the 'Scripts' directory, OR give the
right properties to your tilecache-virtual directory. The most important
one: tell IIS to use python.exe when called a *.cgi or *.py file:
- in the Internet Information Services window, right-clicking on your
python (or tilechache) virtual directory, and see the properties:
In my config it shows:
- in Execution Permissions: 'Scripts and Executables'
AND I added (via button Configuration) the right 'handler' for *.py
files in that dir by adding: the extension
.cgi
and executable path ( mind the %s !! and the quotes because of the spaces)
"C:\Program Files\Python25\python.exe" %s
AND the extension
.py
and the same executable path (to be able to call *.py files and
*.cgi-files in this directory (because tilecache uses cgi-extension).

now put a test python file (call it test.cgi or test.py) in your
directory, and check IF it's called as a python script. Eg. save the
following in the dir (by the way: don't bother the #! line with the
wrong python path: IIS ignores that apparently??):

#!/usr/bin/env python
print "Content-Type: text/html"
print
print """\
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
"""

If that is working (aka: you see Hello World!) in you browser, you can
move on to the next level: configuration of Tilecache. Which looks fine
to me actually.

Some checkpoints:
- look in you mapserver (or IIS) logfiles IF the tilecache cgi is
calling your mapserver in the right way (by the way your IIS logfiles
are somewhere like: C:\WINDOWS\system32\LogFiles\W3SVC1\... )
- taking the mapserver url's from your logs: is mapserver serving the
right images if called directly?

<<<<<

Grtz
Richard Duivenvoorde


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

Re: OpenLayers Proxying in IIS

mike-326
In reply to this post by Jeff Dege

I don't know about python, but it is possible to run perl with IIS - simply install ActivePerl and follow the instructions.

Perl has lots of free libraries that extend IIS in ways only otherwise available with proprietary packages, e.g. http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/LWP/Simple.html

Similarly, php will run with IIS and provide you with suitable functions.

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users