[mapserver-users] Parameterized MapFile using CGI variable

pcreso at pcreso.com pcreso at pcreso.com
Fri Apr 29 15:23:17 EDT 2011


Yes.

Just as you have suggested. Have a CGI wrapper script, which determines the variable's value based on hostname (or whatever), then append this (to the QUERY_STRING prior to executing mapserver.

See: http://mapserver.org/cgi/wrapper.html

As shown in the link below, both the CONNECTION & DATA strings in the mapfile are supported by the preprocessor for variable substitution.

http://mapserver.org/mapfile/variable_sub.html


Cheers,

Brent Wood



--- On Sat, 4/30/11, Nicolas BOUTET <nicolas.boutet at geosys.com> wrote:

From: Nicolas BOUTET <nicolas.boutet at geosys.com>
Subject: [mapserver-users] Parameterized MapFile using CGI variable
To: mapserver-users at lists.osgeo.org
Date: Saturday, April 30, 2011, 1:56 AM

Dear All,  I have 2 MapServer servers. One for Production use, and the other for Validation use.The MAP files placed on those servers are similar except that each server has a different Oracle database as datasource.For now, I have some different CONNECTION values depending if the map file is on the Production or on the Validation server. So finally I must have different MAP files.  Is there a way to have exactly the same map files on the 2 servers, and to use a variable to parameterize the CONNECTION.  For example, I would like to set the CONNECTION of my layers to “%ORACLECONNECTIONSTRING%” and to set a CGI Environment variable named ORACLECONNECTIONSTRING to the correct value on each server.   Nicolas  
-----Inline Attachment Follows-----

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110429/98dfd7a5/attachment.html


More information about the mapserver-users mailing list