Mobile Maps
Home - Download
Developers - News
Services - Contacts

Mobilemaps Nearby-Engine: Mapserver Installation


  1. Introduction
  2. Dependencies
  3. FreeType 2
  4. Jpeg
  5. Libpng
  6. GD
  7. Proj
  8. Mapserver
  9. Making directories
  10. Upload sample data and fonts
  11. Sanity Check
  12. If it isn't working
  1. Introduction
  2. Mobilemaps Nearby-Engine can be made to work with most any mapserver, or Web service conforming to the Open GIS Consortium standard. However, our favoured configuration uses the open source MapServer from the University of Minnesota. The hcslmap script is custom to the High Country Mapserver, and uses the rendering engine of MapServer (shp2img) for displaying a single image, but provides it's own map caching mechanism.

    It has preconfigured layers for street-level through world-wide level maps, and these layers can be added or subtracted. Much of this document is an extension on MapServer's own installation files, so please refer to the MapServer website for further information.

    This document may be somewhat out of date because MapServer is under continual development. We recommend getting the latest stable version of each of the libraries rather than those shown in these installation notes:

  3. Dependencies
  4. To be installed in this order: (library version numbers will differ)


  5. FreeType 2 (2.x works the others don't seem to)
  6. $ tar -zxvf freetype-2.4.tar.gz (or whatever version)
    $ cd freetype
    $ cd lib

    #For a .o file: gcc -c -Iarch/ansi -I. arch/ansi/freetype.c
    #For ansi static library
    $ gcc -c -Iarch/ansi tt*.c
    $ ar -r libfreetype.a tt*.o
    $ cp libfreetype.a /usr/lib

    #Note: there are some ways to speed up the fonts for unix by
    #keeping them in memory.
    #See the INSTALL file with FreeType

    #The rest may not be necessary?
    $ cd ..
    $ ./configure
    $ make
    #Edit out the line which builds the test case on a 'make install' in Makefile
    #It requires X to be installed.
    $ make install

    #Notes for Redhat 7.2:
    $ cp libfreetype.a /usr/local/lib
    $ cp ft2build.h /usr/include
    $ cp -R freetype /usr/include
    $ cp -R /usr/include/freetype /usr/include/freetype2

    - Go to the `freetype2' directory.
    - Unix (any C compiler should work):
    $ make setup (don't worry, this will invoke a configure script)
    $ make
    $ make install

    Alternatively, you can pass parameters to the configure script within the CFG variable, as in:

    $ make setup CFG="--prefix=/usr"
    $ make
    $ make install

    -Make version 3.78.1 or newer is needed.

  7. Jpeg
  8. $ tar -zxvf jpegsrc.v6b.tar.gz
    $ cd jpeg-6b
    $ ./configure
    $ make
    $ make install #puts into /usr/local/bin. But also want the .h files in /usr/include
    $ cp *.h /usr/include
    $ cp *.a /usr/lib #Gets static library into machine library file

  9. Libpng
  10. $ tar -zxvf libpng-1.2.1.tar.gz
    $ cd libpng-1.2.1
    $ cp scripts/makefile.gcc Makefile #Read INSTALL for other makefiles on different platforms

    #This creates the static file
    $ make
    $ cp *.a /usr/lib
    $ cp *.h /usr/include

  11. GD
  12. $ tar -zxvf gd-1.8.4.tar.gz
    $ cd gd-1.8.4
    #Modify the Makefile: must be compiled with HAVE_LIBFREETYPE to include fonts
    #Also ensure the lib settings and include settings are correct

    #This may be necessary for the include files too:
    #cp libfreetype.a /usr/local/lib

    $ make
    $ make install

  13. Proj
  14. $ tar -zxvf proj-4.4.4.tar.gz
    $ cd proj-4.4.4
    $ ./configure
    $ make
    $ make install

    #This may be needed if /usr/local/lib is not on path
    #>>> Paul Ramsey 10/26/01 11:25AM >>>
    #A more elegant solution is to edit /etc/ and add
    #/usr/local/lib to the list of directories. Then run 'ldconfig' to bring
    #all the library information up to date. Things should then work. (For
    #some reason, distributions do not have /usr/local/lib in by
    #default, even though the directory exists by default in their
    #distributions. Must be to keep the newbies down.).
    #Note: this option seems to require a reboot to function.

    #Or possibly:
    #cp /usr/local/include/nad_list.h /usr/include
    #cp /usr/local/include/pro* /usr/include
    #cp /usr/local/lib/libproj.a /usr/lib

    #Warning: after doing a ldconfig, the g++ links can be mislaid and you must
    #ln -s /lib/
    #ln -s /lib/
    #However, do so at your own risk! This could disable your whole machine.

  15. Mapserver
  16. $ tar -zxvf ms_3.5.tar.gz
    $ cd mapserver_3.5/
    $ ./configure --with-proj --with_freetype=/usr/local/lib #proj option is needed for projections
    #freetype option is if having problems
    #detecting where freetype library was installed (your
    #directory may be different!)
    #Also: On one occasion I needed to rename /usr/local/lib/ to something else
    #so that the static libraries would be used. It was due to a different version of glibc.

  17. Making directories
  18. $ cd cgi-bin
    $ mkdir hcslmap
    $ cd hcslmap
    $ cp [your MapServer path]/mapserver/mapserver_3.5/shp2img .
    $ chmod 755 shp2img

    $ mkdir temp
    $ mkdir data
    $ mkdir fonts

    $ cp [your hcsl path]/hcslmap .
    $ cp [your hcsl path]/hcslmap_test .
    $ chmod 755 hcslmap
    $ chmod 755 hcslmap_test
    $ chmod 766 temp #make temp folder writeable
    $ chown nobody temp #ownership to webserver

  19. Upload sample data and fonts
  20. To test the map-server is working Download esriworldmap.tar.gz from into hcslmap/data/esriworldmap/

    $ cd hcslmap/data/esriworldmap
    $ tar -zxvf esriworldmap.tar.gz

    $ cd hcslmap/data
    $ cp [your MapServer path]/mapserver/mapserver_3.5/tile4ms .
    $ ./

    Please refer to HOWTO_US_STREETS.txt Section 2. Street-level maps for information on downloading and installing street-level US data.

  21. Sanity Check
  22. $ su nobody #Or su httpd, whichever is web server's user
    $ ./hcslmap_test n=90 s=0 #or ./hcslmap n=90 s=0 when all US layers are present.

    #Should display a half screen of gobbledegook - ie. a .gif or .png being printed
    #to stdout.

  23. If it isn't working
  24. * Check the paths at the top of hcslmap script
    * Check the permissions of the directories and files in temp, data

Home | Download | Developers | News | Services | Contacts is Copyright 2003 High Country Software Ltd.