MapServer

AVH3

This document assumes you are installing on Centos 4.4 server. The mapserv cgi program can be placed in apache or tomcat.

1. Install the following packages as root

yum install gcc yum install gcc-c++ yum install python yum install freetype-devel yum install libpng-devel yum install libpng10 yum install libpng10-devel yum install libtiff-devel yum install zlib-devel yum install libjpeg yum install libjpeg-devel yum install curl-devel yum install gd  yum install gd-devel yum install subversion

2. Download and install proj-4.6.0.tar.gz from ftp://ftp.remotesensing.org/proj

tar xzfv proj-4.6.0.tar.gz  cd proj-4.6.0 ./configure make make install

3. Download and install gdal-1.3.1.tar.gz from ftp://ftp.remotesensing.org/pub/gdal

tar xzf gdal-1.3.1.tar.gz  cd gdal-1.3.1 ./configure --with-ogr --with-png --with-libtiff --with-jpeg --with-gif make make install

4. Download and install mapserver 5.0.2

tar xfvz mapserver-5.0.2.tar.gz  ./configure --with-threads --with-proj --with-gdal=/usr/local/bin/gdal-config --with-ogr --with-gd --with-freetype make cp mapserv /var/www/cgi-bin/mapserv

5. run the following commands as root,

echo "/usr/local/lib" >/etc/ld.so.conf.d/local.conf ldconfig

Put mapserver files in here:

cd /var/www/html svn co https://www.sapac.edu.au/svn/sapac/avh/trunk/mapserver avh

Or copy from the binary distribution. 6. test map server and make sure you get the same output as the one below to verify that map server works

/var/www/cgi-bin/mapserv -v MapServer version 4.6.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=THREADS INPUT=EPPL7 INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

7. Alternatively, you can put the mapserv cgi into tomcat. Ref: http://tomcat.apache.org/tomcat-5.5-doc/cgi-howto.html

7.1 Enable cgi config in $TOMCAT_HOME/conf/web.xml by de-commenting the CGI section

cgi org.apache.catalina.servlets.CGIServlet  debug 0   cgiPathPrefix WEB-INF/cgi  <load-on-startup>5</load-on-startup>

7.2 Put mapserv in $TOMCAT_HOME/webapps/ROOT/WEB-INF/cgi