Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapServer QuickStart Updates #869

Merged
merged 5 commits into from
Oct 22, 2024
Merged

Conversation

geographika
Copy link
Contributor

Following testing the quick start MapServer guide on osgeolive-nightly-build84-amd64-50c0fd6-master.iso a few updates:

  • The STYLES= parameter needs to be added to WMS requests or the following error is returned - msWMSLoadGetMapParams(): WMS server error. Missing required parameter STYLES
  • Changed the location to save the Mapfile from /home/user/mapserver_quickstart.map to /usr/local/share/mapserver/mapserver_quickstart.map. The mapserver.conf file only allows MapServer to read Mapfiles in /usr/local (see OSGeo/OSGeoLive@f88c2fc). Without the path change there are errors - msLoadMap(): Unable to access file. (/home/user/mapserver_quickstart.map). I'm not sure if this was the case for OSGeoLive 16.0 as well - I did run through the QuickStart when testing with MapServer 8.0...
  • Updated SHAPEPATH as getting errors - msShapefileOpen(): Unable to access file. (/usr/local/share/mapserver/ne_10m_admin_0_countries)
  • Added a Docker link, and my name to reviewers for the page
  • shp2img is now map2img

doc/quickstart/mapserver_quickstart.rst Show resolved Hide resolved
doc/quickstart/mapserver_quickstart.rst Outdated Show resolved Hide resolved
@geographika
Copy link
Contributor Author

@kalxas I can switch back to /home/user/ but there are 2 issues.

  1. The current MS_MAP_PATTERN MS_MAP_PATTERN "^\/usr\/local\/((\.\/)?|([^\.][-_A-Za-z0-9\.]*\/{1}))*([-_A-Za-z0-9\.]+\.(map))$"
    causes the quickstart to return msCGILoadMap(): Web application error. CGI variable "map" fails to validate. mapserver.conf could be updated to use the following MS_MAP_PATTERN "^.*\.map$"

  2. There are not sufficient permissions for Apache to read the Mapfiles from /home/user/. http://localhost/cgi-bin/mapserv?map=/home/user/mapserver_quickstart.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=Countries&STYLES=&SRS=EPSG:4326&BBOX=-137,29,-53,88&FORMAT=PNG&WIDTH=800&HEIGHT=600 currently returns msLoadMap(): Unable to access file. (/home/user/mapserver_quickstart.map).

@kalxas
Copy link
Member

kalxas commented Oct 4, 2024

Thanks @geographika
Yes, lets update the regex to accept the path in /usr/local

@cvvergara cvvergara marked this pull request as draft October 14, 2024 01:35
@cvvergara
Copy link
Contributor

@geographika
How is this going?

@geographika
Copy link
Contributor Author

Thanks @geographika Yes, lets update the regex to accept the path in /usr/local

@kalxas - should this comment be update the regex to accept /home/user/?
If so, I'll probably set it to accept any *.map file
I will also need to update some permissions so that Apache can read Mapfiles in /home/user/.

@kalxas
Copy link
Member

kalxas commented Oct 14, 2024

@geographika yes, let's update the regex to accept /home/user/

@geographika geographika marked this pull request as ready for review October 17, 2024 14:19
@geographika
Copy link
Contributor Author

@geographika How is this going?

@cvvergara I've switched to the paths suggested by @kalxas, and opened a pull request at OSGeo/OSGeoLive#400 which gets the MapServer Quickstart working again. Good to go from my side.

@kalxas kalxas merged commit 6fb8f79 into OSGeo:master Oct 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants