<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Hi Marc</DIV>
<DIV>&nbsp;</DIV>
<DIV>Where do you set this? Is it somewhere in httpd.conf?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Many thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson<BR><BR>&gt;&gt;&gt; "marc.monnerat@bluewin.ch" &lt;marc.monnerat@bluewin.ch&gt; 21/10/2008 4:21 a.m. &gt;&gt;&gt;<BR>Hello,<BR><BR>We are using this very basic setting:<BR><BR># Demo WMS<BR>Alias /wms-demo/usr/lib/cgi-bin/mapserver<BR>&lt;Location /wms-demo&gt;<BR>&nbsp; Deny from all<BR>&nbsp;&nbsp; #&nbsp;&nbsp; My network<BR>&nbsp;&nbsp; Allow from&nbsp; 10.133<BR>&nbsp;&nbsp; SetHandler cgi-script<BR>&nbsp;&nbsp; Options ExecCGI<BR>&nbsp;&nbsp; SetEnv MS_MAPFILE /var/www/wms/wms-demo/wms-demo.map<BR>&lt;/Location&gt;<BR><BR>Cheers<BR><BR>Marc Monnerat<BR><BR>----Message d'origine----<BR>De: mgleahy@alumni.uwaterloo.ca<BR>Date: 20.10.2008 11:33<BR>À: &lt;mapserver-users@lists.osgeo.org&gt;<BR>Objet: Re: [mapserver-users] Access control for wms served from mapserver cgi<BR><BR>Hello Rahkonen (and Stephan),<BR><BR>This is an idea that I could make work...I'd have to lock-down mapserv <BR>itself from all connections (otherwise anyone could just replace <BR>wms*.exe in the URL with the original mapserv.exe), though I guess I <BR>should be doing that anyway.<BR><BR>In response to Stephan Holl: I recognize there are other strategies that <BR>involve proxying the WMS requests.&nbsp; I was just hoping for something <BR>quick and easy that could be done with Apache more or less <BR>out-of-the-box using basic config files and/or modules like mod_rewrite. <BR>&nbsp; There have been a few cases where I needed to use mapserver on one <BR>machine to serve data using WMS to another server running mapserver as a <BR>WMS client.&nbsp; I just want to be able to do that with as little work as <BR>possible (i.e., if I can do it in Apache's config, then I can do it <BR>anywhere).<BR><BR>Essentially, my ideal solution would be if I can get something like <BR>mod_rewrite to say "if a request to mapserv contains <BR>'map=/path/to/somefile.map' in the query string, and the client is not <BR>equal to some IP address, return 403, otherwise allow the request".&nbsp; I <BR>just don't quite know how to get mod_rewrite to work like that for me (I <BR>found some promising examples online, but couldn't get them working).<BR><BR>Thanks again,<BR>Mike<BR><BR>Rahkonen Jukka wrote:<BR>&gt; Hi,<BR>&gt; <BR>&gt; If it is easy to limit access to mapserv executable, then how about making a few copies of the executable and tie <BR>each copy to its own mapfile in httpd.conf?<BR>&gt; <BR>&gt; SetEnvIf Request_URI "/cgi-bin/wms1.exe?" MS_MAPFILE=d:/ms4w/apps/wms1.map<BR>&gt; SetEnvIf Request_URI "/cgi-bin/wms2.exe?" MS_MAPFILE=d:/ms4w/apps/wms2.map<BR>&gt; <BR>&gt; Just thinking, I do not know if this is secure at all.&nbsp; <BR>&gt; <BR>&gt; -Jukka Rahkonen-<BR>&gt;&nbsp; <BR>&gt; <BR>&gt;&gt; -----Alkuperäinen viesti-----<BR>&gt;&gt; Lähettäjä: mapserver-users-bounces@lists.osgeo.org <BR>&gt;&gt; [mailto:mapserver-users-bounces@lists.osgeo.org] Puolesta Mike Leahy<BR>&gt;&gt; Lähetetty: 20. lokakuuta 2008 3:58<BR>&gt;&gt; Vastaanottaja: mapserver-users@lists.osgeo.org<BR>&gt;&gt; Aihe: [mapserver-users] Access control for wms served from <BR>&gt;&gt; mapserver cgi<BR>&gt;&gt;<BR>&gt;&gt; Hello list,<BR>&gt;&gt;<BR>&gt;&gt; Does anyone on this list know of a simple strategy for <BR>&gt;&gt; configuring Apache to restrict access to specific mapfiles <BR>&gt;&gt; served as WMS through the cgi mapserv program?&nbsp; I'd like to <BR>&gt;&gt; do is restrict access to specific IPs for URLs like the following: <BR>&gt;&gt; <A href="http://host/cgi-bin/mapserv?map=/path/to/file.map[&amp;...].">http://host/cgi-bin/mapserv?map=/path/to/file.map[&amp;...].</A><BR>&gt;&gt;<BR>&gt;&gt; It's easy enough to limit access to the mapserv executable <BR>&gt;&gt; itself, but I'd rather do it on a per-mapfile basis.&nbsp; I tried <BR>&gt;&gt; a couple things using mod_rewrite in apache, but anything <BR>&gt;&gt; I've tried so far doesn't seem to work.<BR>&gt;&gt;<BR>&gt;&gt; I know that this sort of question has been asked before, but <BR>&gt;&gt; after searching/tinkering for a while, I haven't found a <BR>&gt;&gt; solution that works for me yet.<BR>&gt;&gt;<BR>&gt;&gt; Thanks for any suggestions,<BR>&gt;&gt; Mike<BR>&gt;&gt; _______________________________________________<BR>&gt;&gt; mapserver-users mailing list<BR>&gt;&gt; mapserver-users@lists.osgeo.org<BR>&gt;&gt; <A href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</A><BR>&gt;&gt;<BR>&gt; <BR>_______________________________________________<BR>mapserver-users mailing list<BR>mapserver-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</A><BR><BR><BR><BR>_______________________________________________<BR>mapserver-users mailing list<BR>mapserver-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</A><BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>