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 <[email protected]> wrote:

From: Nicolas BOUTET <[email protected]>
Subject: [mapserver-users] Parameterized MapFile using CGI variable
To: [email protected]
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
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to