Skip to content

mapuse.net

Sections
Personal tools
You are here: Home » Software » AppForMap the wms client » Installation

Installation

Here you can read how to set up AppForMap and the needed software on different platforms.

The recommended set up for AppForMap is Apache web server, MapServer and PostGreSQL with the PostGIS extension.

You can use MapServer as WMS or through php/mapscript. Using mapscript will utilize MapServer functions such as scale bar, legend and reference map. It’s also possible to combine the two flavours, e.g. using mapscript for locally stored data and WMS for remote stored data.

Using PostGIS as backbone for spatial data will enable the advanced spatial query functions (query based on point, linestring or polygon). Also the insert, update and delete editing functions will be enabled.

The recommend software runs on many different platforms and architectures. It has become very easy to make a setup on the Microsoft Windows platform. The MS4W project at

http://www.maptools.org/ms4w/index.phtml

is a package with Apache and MapServer both cgi and mapscript all preconfigured. Just unzip and double click on one exe-file. Really nice and easy!

You can of cause also install the components separately. But the problem with MapScript is that it needs php as cgi. The popular EasyPHP will install it as an Apache module. If you want to use EasyPHP you will need to get php as cgi and then alter your httpd.conf. Insert these lines:

 AddType application/x-httpd-php-cgi .phtml
 Action application/x-httpd-php-cgi /cgi-bin/php.exe

and remove .phtml from:

 AddType application/x-httpd-php .pwml .php3 .php4 .php2 .inc .php

Make sure that the action module is being loaded with this line (some times it’s commented out):

 LoadModule action_module /usr/lib/apache/1.3/mod_actions.so

But I really recommend you to take a look at MS4W!

For the installation of Postgis take a look at

http://pginstaller.projects.postgresql.org/

and download the installer from

http://www.postgresql.org/ftp/win32/

This is a windows installer for PostGreSql. During the install process you can check PostGIS and it’ll be installed. Also check ‘enable PostGIS in template1’ and all new databases will be spatial enabled. Really, really nice! To load data into a database you can use a GUI for shp2pgsql called S2Pface at http://s2pface.epinoy.com/.

For Linux you can choose from compiling the software or use some package system. If you are a Debian user you are in luck. All the software is available as deb-packages. Take a look at the Debian GIS distribution at

http://pkg-grass.alioth.debian.org/cgi-bin/wiki.pl

About the version of php_mapscript: I’ve not yet a configuration option for this in the AppForMap conf-file (it’ll be there in the next version). But for now open ‘functions.php’ in a text editor and go to line 2400 or there about, find the line ‘dl(“php_mapscript_44.dll”);’ and alter ‘44’ to your version. This is only necessary on Windows servers.

Install instructions for AppForMap package

  • Unzip the archive somewhere in your www root
  • Open maplinkconfig.php with your favorite text editor and type in the workingDir and imageUrl values. Make sure that the directory exist and the web server have read- and write permission.
  • (Optional) Load the PostGreSQL or MySQL dump script in ‘databases/’ into a PostGreSQL or MySQL database, (The default is to use the same PostGreSQL db which also holds the spatial data. If you use AppForMap for pure WMS and like MySQL then edit ‘includes/db_fns.php’). This database comprises information about EPSG Coordinate Reference Systems (csr) definitions which AppForMap will query for information about name of crs and if crs is projected in ‘xy’ or ‘degrees’.
  • Load client_classic.phtml or client_bleed.phtml from IE or Mozilla based browser
  • For further configuration take a look in maplinkconfig.php

Note on PHP

  • AppForMap is tested with v. 4.3.3 of php. Better switch of ‘notice’ in error handling.
  • Set “Register EGPCS variables as globals” to on in php.ini. This is NOT longer default in php.

Note on PHP/Mapscript interface

  • If you want to switch layers on and off using the PHP/Mapscript interface, you need to write an xml-file representing a layer tree (or have some script that dynamical creates it). Take a look at the example file browserconfig.xml. Set the layers to off in the map file.
Created by mh
Last modified 2006-01-06 09:16 AM
 

Powered by Plone

This site conforms to the following standards: