[mapserver-users] CGI-wrapper script on windows / openlayers wmsgetfeatureinfo

Morten Sickel Morten.Sickel at nrpa.no
Thu Feb 11 07:41:01 EST 2010


I found another answer myself, guess this counts as a bit more elegant than a cgi-wrapper script ;-)

I use the mod_rewrite in apache, following these three steps:

1) Comment out the mod_rewrite line in httpd.conf

2) Enable mod_rewrite for the actual document root. I am using virtual servers and added the following lines in the actual <VirtualHost > section:

<Directory "c:\documents and settings\vserver\radioecology">
Options FollowSymLinks
AllowOverride All
</Directory>

(where "c:\documents and settings\vserver\radioecology" is the htdocs directory for the relevant virtual server)

2.5 Restart apache

3 make a .htaccess file in the actual directory:

RewriteEngine on
RewriteRule ^wmsmap?(.*) /cgi-bin/mapserv.exe?map=/documents+and+settings/vserver/radioecology/mobilweb/mobilwms.map&$1

The rewriteRule says: given a webpage starting with wmsmap, pick out the query parameters, make a new page request starting with /cgi-bin/mapserv.exe?map=(...)? and add on whatever was the query parameter in the original page request. ie, 
/wmsmap?mode=map will be rewritten to 
/cgi-bin/mapserv.exe?map=/documents+and+settings/vserver/radioecology/mobilweb/mobilwms.map&mode=map 

Quite simple when one just knows how to do it. I would propose to add something like the text above to chapter 12.6 A Simple CGI Wrapper Script in the manual - that would at least have saved me quite some time..

-- 
Morten Sickel
Norwegian Radiation Protection Authority





-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Morten Sickel
Sent: Wednesday, February 10, 2010 6:17 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] CGI-wrapper script on windows / openlayers wmsgetfeatureinfo

I have mapserver up and running, now I'm trying to use openlayers. Some simpler pars work fine, but when I get to OpenLayers.Control.WMSGetFeatureInfo I need to use a wrapper script to hide the map= parameter, but how to do that on windows? Or, is there some way to add the parameter? I have tried

querier = new OpenLayers.Control.WMSGetFeatureInfo({
			url: url,
			title: "Test",
			map:wmsfile,
			layers: [mobile],
			queryVisible: true
		});

where the wmsfile is a pointer to the wmsfile in the filesystem (works fine in OpenLayers.Layer.WMS) but when the query is sent, the map-parameter has not been taken into account.

Do I need a wrapper script, or have I overlooked something in openlayers?

Morten Sickel
Norwegian Radiation Protection Authority

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list