[mapserver-users] ms4w with MapServer Demo...
Brent Fraser
bfraser at geoanalytic.com
Wed Nov 12 07:44:46 PST 2008
tuckeratwork wrote:
> I've made scores of edits to those three sections. This is how I think they
> really should be:
>
> // EDIT THE NEXT 2 LINES TO MATCH YOUR SETUP
> var snippet = "IMAGEPATH '/workshop/tmp/'";
> snippet += " IMAGEURL '/tmp/'";
>
> and
>
> <!-- EDIT THE FORM ACTION -->
> <form name="demo" method="GET" action="/cgi-bin/mapserv.exe"
> onSubmit="configure()">
>
> and
>
> <!-- EDIT THESE HIDDEN VARIABLES -->
> <input type="hidden" name="map" value="/workshop/itasca.map">
> <input type="hidden" name="program" value="/cgi-bin/mapserv.exe">
> <input type="hidden" name="root" value="/workshop">
>
>
> Launching the index.html file produces:
>
> mLoadMap(): Unable to access file. (/workshop/itasca.map)
>
> The file "htdocs/workshop/itasca.map" does exist but it obviously isn't
> going through the Apache path to get there.
>
> What am I doing wrong? This is terribly embarrassing...
No need to be embarassed; this is one of the most difficult things to do with Mapserver (the other is coordinate systems and EXTENT). The Itasca Workshop demo is set up for Linux, so the paths are not very typical for a Windows installation. And some of the variables are relative to the Web Server's Document Root and others are relative to the Windows file system Root. And for MS4W, some paths are "aliased" in Apache's hppd.conf file!
Here are some Windows-style values (I'm doing this from memory, so some tweaking may be required) appropriate for an MS4W install:
IMAGEPATH 'C:\ms4w\tmp\ms_tmp\'
- relative to file system root
- forward or back slashes ok; drive letters ok (but not "mapped" shared drives)
IMAGEURL '/ms_tmp/'
- relative to Apache document root (C:\ms4w\Apache\htdocs)
- for MS4W, this is aliased in Apache's hppd.conf file
map "C:\ms4w\Apache\htdocs\workshop\itasca.map"
- relative to file system root
program "/cgi-bin/mapserv.exe"
- relative to Apache document root
- for MS4W, this is aliased in Apache's hppd.conf file
root "/workshop"
- I'm not sure about this one, my guess is it is relative to Apache document root
And as Jeff M. points out, there are demos available on the MS4W site that are pre-configured to work painlessly with MS4W.
Good luck!
Brent Fraser
More information about the MapServer-users
mailing list