What is a wrapper script?

Fawcett, David David.Fawcett at STATE.MN.US
Thu Jan 26 12:07:47 EST 2006


This would be a great HowTo for the MapServer site.  

If you can, please submit this to http://mapserver.gis.umn.edu/docs/howto

David.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Steven Monai
Sent: Thursday, January 26, 2006 11:03 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] What is a wrapper script?


Liang:

I haved used the following shell script on a Linux box (although it should be generic enough to run on any OS with /bin/sh):

#!/bin/sh
MAPSERV="/path/to/my/mapserv"
MAPFILE="/path/to/my/mapfile.map"
if [ "${REQUEST_METHOD}" = "GET" ]; then
  if [ -z "${QUERY_STRING}" ]; then
    QUERY_STRING="map=${MAPFILE}"
  else
    QUERY_STRING="map=${MAPFILE}&${QUERY_STRING}"
  fi
  exec ${MAPSERV}
else
  echo "Sorry, I only understand GET requests."
fi
exit 1
# End of Script

You should set the MAPSERV and MAPFILE variables as appropriate for your configuration. Then put the script in your web server's cgi-bin directory, and make it executable.

I haven't ever needed POST capability, so I can't tell you offhand how to modify the script to handle POST requests. Maybe someone else can chime in with the solution.

Hope this helps,
-SM
--



On Thu, 26 Jan 2006 02:13:36 +0800, =?gb2312?B?194gwcE=?= <lltous at MSN.COM>
wrote:

>hi everyone,
>
>I don't know how to create a simple wrapper script to hide the map= 
>parameter. Would you please give me some clues about the wrapper 
>script? How can I create one? Is there a tool to create it?
>
>Thank you very much.
>
>Liang
>
>_________________________________________________________________
>Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn



More information about the mapserver-users mailing list