<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
I setup <a moz-do-not-send="true"
href="https://demo.geomoose.org/3.x/gm3-demo-data/"
class="moz-txt-link-freetext">https://demo.geomoose.org/3.x/gm3-demo-data/</a>
according to my preference for running MapServer.<br>
<br>
So the following should work:<br>
<br>
<font face="monospace"><span style="box-sizing: border-box;">
<map-source name="wfs-polygons" type="wfs" title="Parcel
Polygons"><br id="isPasted" style="box-sizing: border-box;">
<url></span></font><span style="font-family:
courier new; box-sizing: border-box;"><font face="monospace"><a class="moz-txt-link-freetext" href="https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map">https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map</a>?</url><br
style="box-sizing: border-box;">
...<br>
</map-source></font><br>
<br>
<br>
And the GetCapabilities is:<br>
<br>
<a moz-do-not-send="true"
href="https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities"><font
face="monospace">https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities</font></a><br>
<br>
Apache Setup (on Linux) to make this happen:<br>
</span><br>
<span style="font-family: courier new; box-sizing: border-box;"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#18b2b2;background-color:#ffffff;">ScriptAlias</span><span
style="color:#000000;background-color:#ffffff;"> /cgi-bin/
/usr/lib/cgi-bin/
</span><br>
<span style="color:#af5f00;background-color:#ffffff;"><Directory</span><span
style="color:#b21818;background-color:#ffffff;">
"/usr/lib/cgi-bin"</span><span
style="color:#af5f00;background-color:#ffffff;">></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">AllowOverride</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">None</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Options</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">+ExecCGI</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">-MultiViews</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">+SymLinksIfOwnerMatch</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Require</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">all</span><span
style="color:#000000;background-color:#ffffff;"> denied
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Header</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">set</span><span
style="color:#000000;background-color:#ffffff;">
Access-Control-Allow-Origin </span><span
style="color:#b21818;background-color:#ffffff;">"*"</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#000000;background-color:#ffffff;"></span><br>
<br>
<span style="color:#1818b2;background-color:#ffffff;"> #
For Action mapserver /gm3-demo-data/.../XX.map mode</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#af5f00;background-color:#ffffff;"><Files</span><span
style="color:#b21818;background-color:#ffffff;"> "mapserv"</span><span
style="color:#af5f00;background-color:#ffffff;">></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Require</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">all</span><span
style="color:#000000;background-color:#ffffff;"> granted
</span><br>
<br>
<span
style="color:#18b2b2;background-color:#ffffff;">SetEnv</span><span
style="color:#000000;background-color:#ffffff;">
MS_MAP_NO_PATH </span><span
style="color:#b21818;background-color:#ffffff;">"true"</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteEngine</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">on</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteCond</span><span
style="color:#000000;background-color:#ffffff;">
%{env:REDIRECT_HANDLER} ^mapserver
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteCond</span><span
style="color:#000000;background-color:#ffffff;"> %{PATH_INFO}
^/3.x/gm3-demo-data/(.*)
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteRule</span><span
style="color:#000000;background-color:#ffffff;"> .* -
[C,env=MS_MAP</span><span
style="color:#b21818;background-color:#ffffff;">FILE:</span><span
style="color:#000000;background-color:#ffffff;">/srv/demo/src/3.0/gm3-demo-data-2/%1]
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteRule</span><span
style="color:#000000;background-color:#ffffff;"> .* - [L]
</span><br>
<br>
<span
style="color:#18b2b2;background-color:#ffffff;">RewriteRule</span><span
style="color:#000000;background-color:#ffffff;"> .* - [F]
</span><br>
<span
style="color:#af5f00;background-color:#ffffff;"></Files></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#af5f00;background-color:#ffffff;"></Directory></span><br>
<span style="color:#000000;background-color:#ffffff;">
</span><br>
</span></span><font face="monospace"><br>
</font><span style="font-family: courier new; box-sizing:
border-box;"><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#af5f00;background-color:#ffffff;"><Directory</span><span
style="color:#b21818;background-color:#ffffff;">
"/srv/demo/src/3.0/gm3-demo-data-2"</span><span
style="color:#af5f00;background-color:#ffffff;">></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Require</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">all</span><span
style="color:#000000;background-color:#ffffff;"> denied
</span><br>
<br>
<span
style="color:#18b2b2;background-color:#ffffff;">Action</span><span
style="color:#000000;background-color:#ffffff;"> mapserver
/cgi-bin/mapserv
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">AddHandler</span><span
style="color:#000000;background-color:#ffffff;"> mapserver .</span><span
style="color:#b21818;background-color:#ffffff;">map</span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#af5f00;background-color:#ffffff;"><Files</span><span
style="color:#b21818;background-color:#ffffff;"> "*.map"</span><span
style="color:#af5f00;background-color:#ffffff;">></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span
style="color:#18b2b2;background-color:#ffffff;">Require</span><span
style="color:#000000;background-color:#ffffff;"> </span><span
style="color:#b21818;background-color:#ffffff;">all</span><span
style="color:#000000;background-color:#ffffff;"> granted
</span><br>
<span
style="color:#af5f00;background-color:#ffffff;"></Files></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#af5f00;background-color:#ffffff;"></Directory></span><span
style="color:#000000;background-color:#ffffff;">
</span><br>
<span style="color:#18b2b2;background-color:#ffffff;">Alias</span><span
style="color:#000000;background-color:#ffffff;">
/3.x/gm3-demo-data/ /srv/demo/src/3.0/gm3-demo-data-2/</span><br>
<br>
</span><br>
<br>
The gotcha with this setup is when running an unpatched mapserver
[1], the user visible URL to the mapfile needs to be set in every
mapfile, which is extremely annoying and error prone. With the
patch, mapserver will pickup the user visible URL directly from
Apache.<br>
<br>
<font face="monospace">MAP<br>
METADATA<br>
'ows_onlineresource'
'<a class="moz-txt-link-freetext" href="https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map">https://demo.geomoose.org/3.x/gm3-demo-data/demo/parcels/parcels.map</a>?'<br>
END<br>
END</font><br>
<br>
[1] <a moz-do-not-send="true"
href="https://github.com/klassenjs/mapserver/commit/2d69a4bd27e668fa5e8fad6b43d3f81e3e1dea56"
class="moz-txt-link-freetext">https://github.com/klassenjs/mapserver/commit/2d69a4bd27e668fa5e8fad6b43d3f81e3e1dea56</a><br>
<br>
<br>
<br>
<br>
</span>
<div class="moz-cite-prefix">On 1/4/23 10:21, Brent Fraser wrote:<br>
</div>
<blockquote type="cite"
cite="mid:73f62a2279f94565a7195820e58109da@geoanalytic.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: arial; font-size: 14px;">
<div fr-original-style="" style="box-sizing: border-box;">Hi
Jim,</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"> In
my efforts to add WFS mapsources to our
mapbook-test-servers.xml, I see that previously I had used</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"><span
fr-original-style="font-family: courier new;"
style="font-family: courier new; box-sizing: border-box;">
<map-source name="wfs-polygons"
type="wfs" title="Parcel Polygons"><br id="isPasted"
fr-original-style="" style="box-sizing: border-box;">
<url><a class="moz-txt-link-freetext" href="http://localhost/cgi-bin/mapserv.exe">http://localhost/cgi-bin/mapserv.exe</a></url><br
fr-original-style="" style="box-sizing: border-box;">
<param name="map"
value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/></span><br
fr-original-style="" style="box-sizing: border-box;">
<br fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">which
is not very "robust" for testing. It's in our demo at <a
fr-original-style="" href="//demo.geomoose.org"
style="box-sizing: border-box; color: rgb(0, 102, 147);
text-decoration: underline; user-select: auto;"
target="_blank" rel="noopener noreferrer"
moz-do-not-send="true">demo.geomoose.org</a> and will not
work for most people experimenting with </div>
<div fr-original-style="" style="box-sizing: border-box;"><a
fr-original-style=""
href="https://demo.geomoose.org/3.x/desktop/?mapbook=test"
id="isPasted" style="box-sizing: border-box; color: rgb(0,
102, 147); text-decoration: underline; user-select: auto;"
target="_blank" rel="noopener noreferrer"
moz-do-not-send="true" class="moz-txt-link-freetext">https://demo.geomoose.org/3.x/desktop/?mapbook=test</a></div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">I'd
like to change the mapbook-test-servers.xml to use WFS at <a
fr-original-style="" href="https://demo.geomoose.org"
id="isPasted" style="box-sizing: border-box; color: rgb(0,
102, 147); text-decoration: underline; user-select: auto;"
target="_blank" rel="noopener noreferrer"
moz-do-not-send="true">demo.geomoose.org</a> for parcel
polygons, points and pipelines. I guess I would rather not
include a map param for each. How much work do you think it
would be to have the map files handled by the server for our
demo?</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">Thanks!</div>
<div fr-original-style="" style="box-sizing: border-box;">Brent</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"
contenteditable="false"> </div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<hr id="previousmessagehr" fr-original-style=""
style="box-sizing: border-box; clear: both; user-select:
none;">
<div fr-original-style="" style="box-sizing: border-box;"><strong
fr-original-style="" style="box-sizing: border-box;
font-weight: 700;">From</strong>: "Jim Klassen"
<a class="moz-txt-link-rfc2396E" href="mailto:klassen.js@gmail.com"><klassen.js@gmail.com></a><br fr-original-style=""
style="box-sizing: border-box;">
<strong fr-original-style="" style="box-sizing: border-box;
font-weight: 700;">Sent</strong>: 1/3/23 10:51 AM<br
fr-original-style="" style="box-sizing: border-box;">
<strong fr-original-style="" style="box-sizing: border-box;
font-weight: 700;">To</strong>:
<a class="moz-txt-link-abbreviated" href="mailto:geomoose-users@lists.osgeo.org">geomoose-users@lists.osgeo.org</a><br fr-original-style=""
style="box-sizing: border-box;">
<strong fr-original-style="" style="box-sizing: border-box;
font-weight: 700;">Subject</strong>: Re: [GeoMoose-users]
WFS identify is GeoMoose using MapServer</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">I
would guess that it is non-compliant to send/ask for a SRS
that isn't advertised in the GetCapabilities. I think the bug
is that MapServer is working at all.</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">Personally,
I think type="wfs" should be strongly preferred and
type="mapserver-wfs" is the hack. It is a work around for
`/cgi-bin/mapserv?map=/file/system/path&` being ugly.
"mapserver-wfs" really isn't designed to work across multiple
mapserver sites either. IMO MapServer shouldn't be exposing
(full) filesystem paths to the web request at all and
MapServer 7/8 have been making steps to avoid this more. If
it were up to me, I'd remove the "mapserver-*" types entirely.
I'd expect MS_MAPFILE_PATTERN is already set on the server
correctly, otherwise it wouldn't work at all.</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<div fr-original-style="" style="box-sizing: border-box;">I'm
still partial to adding an Apache handler for ".map" so
mapfiles are "run" from within the webroot like a CGI or PHP
file would normally be run, but instead of Apache passing it
to PHP or Perl/Python/whatever for handling, the mapfile gets
passed to MapServer (via environment variables) to run. A
side benefit is Apache sees the path to the mapfile and normal
Apache authentication/authorization can be applied within the
standard <Directory> or <Location> stanzas. I
don't see any reason to want MapServer to implement yet
another authentication/authorization system when Apache is
already there. This works well at least from MapServer 5-7. I
haven't tried it with 8 yet. The catch is that MapServer
doesn't auto detect the server URL correctly when doing this
so "ows_onlineresource" needs to be set to the URL (as seen by
end users) to the mapfile. (I have a patch for MapServer that
lets the auto-detection still work by looking at the
SCRIPT_URI environment variable.)</div>
<div fr-original-style="" style="box-sizing: border-box;"><br
fr-original-style="" style="box-sizing: border-box;">
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>