MapServer at AdhocVM

From OSGeo
Jump to navigation Jump to search


Server Overview

  • AdhocVM
    • actually a container on osgeo7 (as of 2019-05-11)


  • 2019-05-11 url not accessible, as old machine shut down.
    • robe opened the domain through nginx
    • jmckenna restarted FGS Apache service
  • 2014-05-28 changed postgres port from 5432 to 5433
  • 2010-09-28 mapserver tutorial configured
  • 2010-09-23 mapserver installed through FGS


MapServer Installation on AdhocVM

  • MapServer 5.6.5 through FGS
  • home: /osgeo/mapserver/fgs/

Apache Configuration

A virtualhost is setup for, through:

  • /etc/apache2/sites_available/
    • to enable the virtualhost, the following command was used:

Note that a proxy is setup to point to the FGS Apache which is running on port 8080

  • server logfiles live at:
   ErrorLog /var/log/apache2/
   CustomLog /var/log/apache2/ combined
  • mapserv and other CGI binaries are in the FGS environment: /osgeo/mapserver/fgs/www.cgi-bin

Restarting FGS Apache

  • set the FGS environment, in /osgeo/mapserver/fgs/ execute the command:
  • then execute:
   fgs stop ; fgs start

(you may get 'pg_ctl: Permission denied' errors that you can ignore, as Apache should start anyway)

Adding Apache Aliases

  • see examples in /osgeo/mapserver/fgs/www/conf.d/

Services on the AdhocVM

For each service you configure on, please edit /osgeo/mapserver/fgs/www/htdocs/index.html and list your new service.

MapServer Tutorial (v5.x)

World Blue Marble

WMS Service (for Documentation)

  • Small mapfile serving a raster file, and a single point, line, and poly file. Used in the MapServer docs.
  • On Disk: /osgeo/mapserver/ogc-demos/map/
  • On Web:
  • Administrator: jmckenna

WMS Landsat7 Service (for Documentation)

WFS Service (for Documentation)

  • Small mapfile serving a point and polygon shapefile. Used in the MapServer docs.
  • On Disk: /osgeo/mapserver/ogc-demos/map/
  • On Web:
  • Administrator: jmckenna

WCS Service (for Documentation)

  • Minnesota DNR demo, includes MODIS and NDVI imagery. Used in the MapServer docs.
  • On Disk: /osgeo/mapserver/ogc-demos/map/
  • On Web:
  • Administrator: jmckenna

OGR Examples (for Documentation)

  • Small examples of OGR formats used in MapServer. Used in the MapServer docs.
  • On Disk: /osgeo/mapserver/ogr-demos/
  • On Web:
  • Administrator: jmckenna

WMS OpenStreetMap Service (for Documentation)

  • OSM data for Colorado loaded into PostgreSQL database, served by MapServer. Used in the MapServer OpenLayers app on main site.
  • On Disk: /osgeo/mapserver/osm/map/
  • Port: 5433
  • On Web:
  • Administrator: jmckenna
  • mapfile styling comes from the 'mapserver-utils' project
    • '' was used because there were errors with ''
  • To log into the 'osm' database:
    • cd /osgeo/mapserver/fgs
    • .
    • psql -U postgres -d osm -p 5433
      • password for postgres user is postgres

Caching for OpenLayers viewer

  • geocache.xml lives in:
   sudo /osgeo/mapserver/httpd/bin/apachectl restart
  • mapfile:
  • seed command:
   sudo geocache_seed -c geocache.xml -t osm-denver -g osmgrid -z 0,13
  • cache directory:

HTML Legend Examples (for Documentation)

MapServer 7.x CGI

current version installed: 7.0.6

  • A statically compiled "mapserv70" CGI has been compiled to support the V7+ tutorial. This is a static build so it has no external dependency.
  • Web URL:
  • Source build in /osgeo/mapserver/mapserver-git-branch-7-0/build
  • Note that this binary has to be installed under the FGS server's /osgeo/mapserver/fgs/www/cgi-bin/ directory since that's where the points to
  • Administrators: dmorissette / jmckenna
  • build instructions for reference:
$ cd /osgeo/mapserver/
$ git clone mapserver-git
$ cd mapserver-git/
$ git checkout branch-7-0
$ mkdir build
$ cd build
$ make
$ cp /osgeo/mapserver/mapserver-git-branch-7-0/build/mapserv /osgeo/mapserver/fgs/www/cgi-bin/mapserv70