Anthony T. Holdener, III   <anthony3 at holdener dot com>


Revision History
The original version of this document (formatted nicer), may be found at http://marwp.cla.umn.edu/gis/docs/verbose_install.html

This document describes the installation of MapServer on a Linux distribution with installation and configuration instructions for all related software. It assumes only a rudimentary understanding of Linux.

  Introduction

  About this Document

The installation of MapServer on a Linux distribution is not the most well documented software around, with only hints of "install this, then install that" to be found on the Internet. To simplify and hopefully demystify this process, this document takes a step by step installation approach of every piece of software needed to get MapServer up and running on your Linux distribution.

This document assumes that a Linux Distribution (Fedora Core 4 in all examples) with development tools installed is already up and running. Furthermore, that this distribution does not have Apache, PHP or PostgreSQL installed. If any of these components have been installed, please uninstall them before continuing with this documentation.

This document is based on my own experience and compiled to benefit the community.

  Necessary Software Packages

  Required Software

Apache
Apache is the web server we will be using. At the time of this writing, Apache 2.2.0 is the current stable release.
PHP
PHP is required in order to use PHP/MapScript. PHP 4.3.11 is the current stable release that works with Apache 2.x, however, with certain compile options with Apache (threading), PHP 5.1.2 is also stable and will be the package used in this document.
MapServer
MapServer is what this document is all about! MapServer 4.8.0-RC2 is the current release.
libpng
libpng should already be on your system by default. 1.2.8-2 is the current stable release.
freetype
GD requires freetype version 2.x or above. The current stable release is 2.1.9-2.
GD
libgd is used to actually render images by MapServer. Version 2.0.28 or greater is required, as earlier versions of GD did not support the GIF file format thanks to the UNISYS patent on GIFs. This may already be on your system, but check the version. The current stable version is 2.0.33-2.
Zlib
Zlib should already be on your system by default. 1.2.3 is the current stable release.

  Highly Recommended Software

PostgreSQL
PostgreSQL is an object-relational database that can be used to store data utilizing PostGIS. The current stable release is 8.1.2.
PostGIS
PostGIS "spatially enables" the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. 1.1.0 is the current stable release.
Proj4
The Proj4 library is used to provide coordinate reprojection support within PostGIS and MapServer. 4.4.9 is the current stable release.
GEOS
The GEOS library is used to provide geometry tests within PostGIS. 2.2.1 is the current stable release.
GDAL
GDAL provides access to at least 42 different raster formats, while OGR provides access to at least 18 different vector formats. 1.3.1 is the current stable release and contains both GDAL and OGR libraries.

  Document License

This document, the Verbose Linux Installation: MapServer (and all related software) Installation and Configuration, is distributed under the same Free Software license as the MapServer software. See the MapServer's License and Credits page for the complete text.

Copyright © 2005 - 2006. Anthony T. Holdener, III.

  Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MapServer License for more details.

All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.


  Installing Apache

Download the latest source code from Apache's website (http://httpd.apache.org/) and place the file in /usr/local/. In this document, the source is httpd-2.2.0.tar.gz.

  Unpacking the Source

[anthony3@aragog ~]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf httpd-2.2.0.tar.gz
httpd-2.2.0/
httpd-2.2.0/os/
httpd-2.2.0/os/os2/
.
.
.
httpd-2.2.0/include/util_cfgtree.h
[anthony3@aragog local]$

  Configuring Apache

[anthony3@aragog local]$ cd httpd-2.2.0/
[anthony3@aragog httpd-2.2.0]$ ./configure \
> --prefix=/usr/local/apache2 \
> --enable-deflate \
> --enable-info \
> --enable-mime-magic \
> --enable-rewrite \
> --enable-so \
> --enable-speling \
> --enable-ssl \
> --enable-unique_id \
> --enable-usertrack \
> --with-mpm=prefork 
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i686-pc-linux-gnu
.
.
.
config.status: executing default commands
[anthony3@aragog httpd-2.2.0]$ 

The --enable-so configuration and --with-mpm=prefork configuration are the only configurations you truly need when configuring apache. The rest of the configure options are just nice to have. For more information on these and other options, type ./configure --help or see "Compiling and Installing" in the Apache 2 Documentation, http://httpd.apache.org/.

  Compiling Apache

When compiling and installing Apache, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog httpd-2.2.0]$ make
Making all in srclib
make[1]: Entering directory '/usr/local/httpd-2.2.0/srclib'
Making all in apr
.
.
.
make[1]: Leaving directory '/usr/local/httpd-2.2.0'
[anthony3@aragog httpd-2.2.0]$ make install
Making install in srclib
make[1]: Entering directory '/usr/local/httpd-2.2.0/srclib'
Making install in apr
.
.
.
make[1]: Leaving directory '/usr/local/httpd-2.2.0'
[anthony3@aragog httpd-2.2.0]$

  Starting and Testing Apache

Having completed the above steps, the server now needs to be started, and the server can be tested.

[anthony3@aragog httpd-2.2.0]$ /usr/local/apache2/bin/apachectl start
[anthony3@aragog httpd-2.2.0]$

Open up a web browser, and test the server by going to http://localhost/. You should see the "Test Page for Apache Installaion" web page.

  Configuring Automatic Startup of Apache

[anthony3@aragog httpd-2.2.0]$ cp /usr/local/apache2/bin/apachectl /etc/init.d/.
[anthony3@aragog httpd-2.2.0]$

Edit /etc/init.d/apachectl by inserting the lines that are in bold:

#!/bin/sh
#
# chkconfig: - 85 15
# description: Apache is a Web server used to serve HTML and CGI.
# processname: httpd
# pidfile: /usr/local/apache2/logs/httpd.pid
#
# Copyright 2000 - 2005 The Apache Software Foundation or its licensors, as
# applicable.
.
.
.
[anthony3@aragog httpd-2.2.0]$ /sbin/chkconfig --add apachectl
[anthony3@aragog httpd-2.2.0]$

  Installing PostgreSQL

Download the latest source code from PostgreSQL's website (http://www.postgresql.org/) and place the file in /usr/local/. In this document, the source is postgresql-8.1.2.tar.gz.

  Unpacking the Source

[anthony3@aragog httpd-2.2.0]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf postgresql-8.1.2.tar.gz
postgresql-8.1.2/
postgresql-8.1.2/doc/
postgresql-8.1.2/doc/src/
.
.
.
postgresql-8.1.2/INSTALL
[anthony3@aragog local]$

  Configuring PostgreSQL

[anthony3@aragog local]$ cd postgresql-8.1.2/
[anthony3@aragog postgresql-8.1.2]$ LDFLAGS=-lstdc++ ./configure \
> --prefix=/usr/local/pgsql \
> --with-perl \
> --with-python \
> --with-krb5 \
> --with-openssl
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking which template to use... linux
.
.
.
config.status: linking ./src/makefiles/Makefile.linux to src/Makefile.port
[anthony3@aragog postgresql-8.1.2]$

The --prefix configuration is the only one you actually need. For more information on these and other options, type ./configure --help or see "Installation Procedure" in the PostgreSQL Documentation, http://www.postgresql.org/docs/8.1/static/.

  Compiling PostgreSQL

When compiling and installing PostgreSQL, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog postgresql-8.1.2]$ make
make -C doc all
make[1]: Entering directory '/usr/local/postgresql-8.1.2/doc'
gzip -d -c man.tar.gz | /bin/tar xf -
.
.
.
All of PostgreSQL successfully made. Ready to install.
[anthony3@aragog postgresql-8.1.2]$ make install
make -C doc install
make[1]: Entering directory '/usr/local/postgresql-8.1.2/doc'
mkdir -p -- /usr/local/pgsql/doc/html
.
.
.
PostgreSQL installation complete.
[anthony3@aragog postgresql-8.1.2]$

  Post Compile PostgreSQL Configuration

Once the above steps have been completed, the database needs to be configured with a default user.

[anthony3@aragog postgresql-8.1.2]$ /usr/sbin/adduser postgres
[anthony3@aragog postgresql-8.1.2]$ mkdir /usr/local/pgsql/data
[anthony3@aragog postgresql-8.1.2]$ chown postgres /usr/local/pgsql/data/
[anthony3@aragog postgresql-8.1.2]$ su - postgres
[postgres@aragog postgresql-8.1.2]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
This files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

.
.
.
or
	/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
[postgres@aragog postgresql-8.1.2]$

  Starting and Testing PostgreSQL

[postgres@aragog postgresql-8.1.2]$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data/ -l /usr/local/pgsql/data/logfile start
postmaster starting
[postgres@aragog postgresql-8.1.2]$ /usr/local/pgsql/bin/createdb test
CREATE DATABASE
[postgres@aragog postgresql-8.1.2]$ /usr/local/pgsql/bin/psql test
Welcome to psql 8.1.2, the PostgreSQL interactive terminal.

Type:	\copyright for distribution terms
.
.
.
test=# \q
[postgres@aragog postgresql-8.1.2]$ exit
[anthony3@aragog postgresql-8.1.2]$

  Configuring Automatic Startup of PostgreSQL

As root, create /etc/init.d/postgresql.

[anthony3@aragog postgresql-8.1.2]$ touch /etc/init.d/postgresql
[anthony3@aragog postgresql-8.1.2]$

Then add to the file:

#!/bin/sh
# postgresql    This is the init script for starting up the PostgreSQL
#               server

# chkconfig: - 85 15
# description: Starts and stops the PostgreSQL backend daemon that handles all database requests.
# processname: postmaster
# pidfile: /usr/local/pgsql/data/postmaster.pid
#

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
# Pretty much need it for postmaster.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/local/pgsql/bin/postmaster ] || exit 0

# See how we were called.
case "$1" in
start)
pid=`pidof postmaster`
if [ $pid ]
then
echo "Postmaster already running."
else
echo -n "Starting postgresql service: "
su -l postgres -c '/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data/ -l /usr/local/pgsql/data/logfile start'
sleep 1
echo
exit
fi
;;

stop)
echo -n "Stopping postgresql service: "
killproc postmaster
sleep 2
rm -f /usr/local/pgsql/data/postmaster.pid
echo
;;

restart)
$0 stop
$0 start
;;

*)
echo "Usage: postgresql {start|stop|restart}"
exit 1
esac

exit 0
[anthony3@aragog postgresql-8.1.2]$ chmod 700 /etc/init.d/postgresql
[anthony3@aragog postgresql-8.1.2]$ /sbin/chkconfig --add postgresql
[anthony3@aragog postgresql-8.1.2]$

  Installing PHP

Download the latest source code from PHP's website (http://www.php.net/) and place the file in /usr/local/. In this document, the source is php-5.1.2.tar.gz.

  Unpacking the Source

[anthony3@aragog postgresql-8.1.2]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf php-5.1.2.tar.gz
php-5.1.2/
php-5.1.2/ext/
php-5.1.2/ext/db/
.
.
.
php-5.1.2/buildconf.bat
[anthony3@aragog local]$

  Configuring PHP

[anthony3@aragog local]$ cd php-5.1.2/
[anthony3@aragog php-5.1.2]$ ./configure \
> --prefix=/usr/local/apache2/php \
> --with-apxs2=/usr/local/apache2/bin/apxs \
> --disable-cgi \
> --with-config-file-path=/usr/local/apache2/php \
> --with-openssl \
> --with-kerberos \
> --with-zlib \
> --with-bz2 \
> --with-curl \
> --enable-dbase \
> --with-gd \
> --with-pgsql \
> --with-xsl \
> --with-mysql \
> --with-gettext
> --with-regex=system
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
.
.
.
Thank you for using PHP.

[anthony3@aragog php-5.1.2]$

The --with-apxs2, --with-pgsql, --enable-dbase and --with-config-file configurations are the only ones you need for MapServer. Obviously do not use the --with-mysql configuration if you do not have a MySQL database installed. For more information on these and other options, type ./configure --help or see "Installation" in the PHP Manual, http://www.php.net/docs.php.

  Configure Notes for PHP

When you configure PHP, if you get the following error, or any similar error:

If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

The solution to this and similar errors is to locate and install the matching -devel package. In the case of the example, libpng-devel-1.2.8-2.i386.rpm is what needs to be installed on the machine.

  Compiling PHP

When compiling and installing PHP, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog php-5.1.2]$ make
/bin/sh /usr/local/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext/libxml/ -I/usr/local/php-5.1.2/ext/libxml/ -DPHP_ATOM_INC
-I/usr/local/php-5.1.2/include -I/usr/local/php-5.1.2/main -I/usr/local/php-5.1.2 -I/usr/include/libxml2 -I/usr/kerberos/include -I/usr/local/
php-5.1.2/ext/date/lib -I/usr/include/mysql -I/usr/local/pgsql/include -I/usr/local/php-5.1.2/TSRM -I/usr/local/php-5.1.2/Zend   -I/usr/include -g -O2  
.
.
.
(It is safe to ignore warnings about tempnam and tmpnam).

[anthony3@aragog php-5.1.2]$ make install
Installing PHP SAPI module:		apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtools --mode=install cp libphp5.la /usr/local/apache2/modules/ 
.
.
.
Installing PDO headers:			/usr/local/apache2/php/include/php/ext/pdo/
[anthony3@aragog php-5.1.2]$

  Post Compile PHP Configuration

[anthony3@aragog php-5.1.2]$ cp php.ini-recommended /usr/local/apache2/php/php.ini
[anthony3@aragog php-5.1.2]$

Add the following directives to /usr/local/apache2/conf/httpd.conf and if they are already there, verify that they are correct:

Around line 53:
LoadModule php5_module		modules/libphp5.so

Around line 165:
<IfModule dir_module>
	DirectoryIndex index.php index.html
</IfModule>

Around line 307:
AddType application/x-httpd-php		.php .phtml
AddType application/x-httpd-php-source	.phps

Restart the Apache server.

[anthony3@aragog php-5.1.2]$ /usr/local/apache2/bin/apachectl restart
[anthony3@aragog php-5.1.2]$

  Testing PHP

Create a file called /usr/local/apache2/htdocs/index.php.

[anthony3@aragog php-5.1.2]$ touch /usr/local/apache2/htdocs/index.php
[anthony3@aragog php-5.1.2]$

Then add to the file:

<?php
	echo phpinfo();
?>

Open up a web browser, and test the server by going to http://localhost/. You should see the "phpinfo() " output.

PHP Logo

PHP Version 5.1.2

   System Linux aragog 2.6.14-1.1656_FC4smp #1 SMP Thu Jan 5 22:24:06 EST 2006 i686
   Build Date Jan 23 2006 21:27:57
   Configure Command './configure' '--prefix=/usr/local/apache2/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-cgi'
   '--with-config-file-path=/usr/local/apache2/php' '--with-openssl' '--with-kerberos' '--with-zlib' '--with-bz2'
.
.
.
   If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.

  Installing PostGIS

Download the latest source code from PostGIS's website (http://www.postgis.org/) and place the file in /usr/local/. In this document, the source is postgis-1.1.0.tar.gz.

PostGIS and MapServer can use the Proj4 reprojection library. The Proj4 library is used to provide coordinate reprojection support within PostGIS. Download the latest source code from http://www.remotesensing.org/proj/ and place the file in /usr/local/. In this document, the source is proj4-4.4.9.tar.gz.

PostGIS can alse use the GEOS geometry library. The GEOS library is used to provide geometry tests (Touches(), Contains(), Intersects()) and operations (Buffer(), GeomUnion, Difference()) within PostGIS. Download the latest source code from http://geos.refractions.net/ and place the file in /usr/local/. In this document, the source is geos-2.2.1.tar.bz2.

  Unpacking and Installing Recommended PostGIS Packages

When compiling and installing Proj4 and GEOS, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog php-5.1.2]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf proj-4.4.9.tar.gz
proj-4.4.9/
proj-4.4.9/README
proj-4.4.9/configure.in
.
.
.
proj-4.4.9/jniwrap/org/proj4/Projections.java
[anthony3@aragog local]$ cd proj-4.4.9/
[anthony3@aragog proj-4.4.9]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
.
.
.
config.status: executing depfiles commands
[anthony3@aragog proj-4.4.9]$ make
making all in src
make[1]: Entering directory '/usr/local/proj-4.4.9/src'
make  all-am
.
.
.
make[1]: Leaving directory '/usr/local/proj-4.4.9/'
[anthony3@aragog proj-4.4.9]$ make install
Making install for src
make[1]: Entering directory '/usr/local/proj-4.4.9/src'
make[2]: Entering directory '/usr/local/proj-4.4.9/src'
.
.
.
make[1]: Leaving directory '/usr/local/proj-4.4.9/'
[anthony3@aragog proj-4.4.9]$ cd ..
[anthony3@aragog local]$ bunzip2 geos-2.2.1.tar.bz2
[anthony3@aragog local]$ tar -xvf geos-2.2.1.tar
geos-2.2.1/
geos-2.2.1/doc/
geos-2.2.1/doc/README
.
.
.
geos-2.1.4/VisualStudio/GEOS.vcproj
[anthony3@aragog local]$ cd geos-2.2.1/
[anthony3@aragog geos-2.2.1]$ ./configure
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
.
.
.
config.status: executing depfiles commands
[anthony3@aragog geos-2.2.1]$ make
Making all in source
make[1]: Entering directory '/usr/local/geos-2.2.1/source'
Making all in geom
.
.
.
make[1]: Leaving directory '/usr/local/geos-2.2.1'
[anthony3@aragog geos-2.2.1]$ make install
Making install in source
make[1]: Entering directory '/usr/local/geos-2.2.1/source'
Making install in geom
.
.
.
make[1]: Leaving directory '/usr/local/geos-2.2.1'
[anthony3@aragog geos-2.2.1]$

  Unpacking the Source

[anthony3@aragog geos-2.2.1]$ cd /usr/local
[anthony3@aragog local]$ tar -xvzf postis-1.1.0.tar.gz
postis-1.1.0/
postis-1.1.0/doc/
postis-1.1.0/doc/html/
.
.
.
postis-1.1.0/utils/test_joinestimation.pl
[anthony3@aragog local]$ mv postgis-1.1.0 postgresql-8.1.2/contrib/
[anthony3@aragog local]$

  Configuring PostGIS

[anthony3@aragog local]$ cd postgresql-8.1.2/contrib/postgis-1.1.0
[anthony3@aragog postgis-1.1.0]$ ./configure \
> --with-pgsql=/usr/local/pgsql/bin/pg_config
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
.
.
.
 ----------------------------------------------------
[anthony3@aragog postgis-1.1.0]$ 

  Compiling PostGIS

When compiling and installing PostGIS, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog postgis-1.1.0]$ make
make -C lwgeom
make[1]: Entering directory '/usr/local/postgresql-8.1.2/contrib/postgis-1.1.0/lwgeom'
cpp -P -traditional-cpp -DUSE_VERSION=81 lwpostgis.sql.in | sed -e 's:@MODULE_FILENAME@:\$libdir/liblwgeom.so.1.1:g;s:@POSTGIS_VERSION@:1.1 USE_GEOS=1 USE_PROJ=1
.
.
.
make[1]: Leaving directory '/usr/local/postgresql-8.1.2/contrib/postgis-1.1.0/utils'
[anthony3@aragog postgis-1.1.0]$ make install
make -C lwgeom
make[1]: Entering directory '/usr/local/postgresql-8.1.2/contrib/postgis-1.1.0/lwgeom'
make[1]: Nothing to be done for `all'.
.
.
.
make[1]: Leaving directory '/usr/local/postgresql-8.1.2/contrib/postgis-1.1.0/loader'
[anthony3@aragog postgis-1.1.0]$

Compile Notes for PostGIS

Once PostGIS, Proj4 and GEOS have been compiled, their libraries must be registered with operating system. As root, edit the file /etc/ld.so.conf, adding the following line:

/usr/local/lib/

Then reload:

[anthony3@aragog postgis-1.1.0]$ ldconfig
[anthony3@aragog postgis-1.1.0]$

  Post Compile PostGIS Configuration

Once the above steps have been completed, the PostgreSQL database needs to have PostGIS added. In this example, the "test" database will be used.

[anthony3@aragog postgis-1.1.0]$ su - postgres
[postgres@aragog postgis-1.1.0]$ /usr/local/pgsql/bin/createlang plpgsql test
[postgres@aragog postgis-1.1.0]$ /usr/local/pgsql/bin/psql -d test -f /usr/local/pgsql/share/postgresql/contrib/lwpostgis.sql
BEGIN
psql:/usr/local/pgsql/share/postgresql/contrib/lwpostgis.sql:39 NOTICE:  type "histogram2d" is not yet defined
DETAIL:  Creating a shell type definition.
.
.
.
COMMIT
[postgres@aragog postgis-1.1.0]$ /usr/local/pgsql/bin/psql -d test -f /usr/local/pgsql/share/postgresql/contrib/spatial_ref_sys.sql
BEGIN
INSERT 0 1
INSERT 0 1
.
.
.
VACUUM
[postgres@aragog postgis-1.1.0]$ exit
[anthony3@aragog postgis-1.1.0]$

  Installing MapServer

Download the latest source code from MapServer's website (http://ms.gis.umn.edu/) and place the file in /usr/local/. In this document, the source is mapserver-4.8.0-rc2.tar.gz.

MapServer can and should use the GDAL/OGR library. GDAL provides access to at least 42 different raster formats, while OGR provides access to at least 18 different vector formats. Download the latest source code from http://www.gdal.org/ and place the file in /usr/local/. In this document, the source is gdal-1.3.1.tar.gz.

  Unpacking and Installing the GDAL/OGR library

When compiling and installing GDAL/OGR, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog postgis-1.1.0]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf gdal-1.3.1.tar.gz
gdal-1.3.1/
gdal-1.3.1/alg/
gdal-1.3.1/alg/.cvsignore
.
.
.
gdal-1.3.1/vb6/vb6_support.cpp
[anthony3@aragog local]$ cd gdal-1.3.1/
[anthony3@aragog gdal-1.3.1]$ ./configure \
> --with-png \
> --with-libtiff \
> --with-jpeg \
> --with-gif \
> --with-pg=/usr/local/pgsql/bin/pg_config \
> --with-geos
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
.
.
.

enable OGR building:	yes

[anthony3@aragog gdal-1.3.1]$ make
GNUMakefile:43: warning: overriding commands for target 'libgdal.la'
GNUMakefile:39: warning: ignoring old commands for target 'libgdal.la'
(cd port; make)
.
.
.
make[1]: Leaving directory '/usr/local/gdal-1.3.1/apps'
[anthony3@aragog gdal-1.3.1]$ make install
GNUMakefile:43: warning: overriding commands for target 'libgdal.la'
GNUMakefile:39: warning: ignoring old commands for target 'libgdal.la'
(cd port; make)
.
.
.
/bin/sh ./libtool --mode=finish --silent /usr/local/lib
[anthony3@aragog gdal-1.3.1]$

  Unpacking the Source

[anthony3@aragog gdal-1.3.1]$ cd /usr/local/
[anthony3@aragog local]$ tar -xvzf mapserver-4.8.0-rc2.tar.gz
mapserver-4.8.0-rc2/
mapserver-4.8.0-rc2/rfc/
mapserver-4.8.0-rc2/rfc/ms-rfc-1.txt
.
.
.
mapserver-4.8.0-rc2/mapparser.h
[anthony3@aragog local]$

  Configuring MapServer

[anthony3@aragog local]$ cd mapserver-4.8.0-rc2/
[anthony3@aragog mapserver-4.8.0-rc2]$ ./configure \
> --with-proj=/usr/local \
> --with-geos=/usr/local/bin/geos-config \
> --with-ogr=/usr/local/bin/gdal-config \
> --with-gdal=/usr/local/bin/gdal-config \
> --with-postgis=/usr/local/pgsql/bin/pg_config \
> --with-curl-config=/usr/bin/curl-config \
> --with-httpd=/usr/local/apache2/bin/httpd \
> --with-php=/usr/local/php-5.1.2 \
checking for gcc... gcc
checking for a C compiler default output file name... a.out
checking whether the C compiler works... yes
. . .
config.status: creating mapscript/java/Makefile
[anthony3@aragog mapserver-4.8.0-rc2]$

  Compiling MapServer

When compiling and installing MapServer, make sure that you are root, or have superuser privileges. For all examples in this documentation, user anthony3 has superuser privileges.

[anthony3@aragog mapserver-4.8.0-rc2]$ make
gcc -c -O2 -fPIC  -Wall   -DIGNORE_MISSING_DATA -DNEED_STRLCAT  -DUSE_EPPL -DUSE_PROJ -DUSE_WMS_SVR           -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP
-DUSE_GD_FT -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS    -DUSE_OGR -DUSE_GDAL -DUSE_ICONV       -DUSE_POSTGIS    -DUSE_ZLIB -I/usr/include  -I/usr/local/include
-I/usr/local/include -I/usr/local/pgsql/include   -I/usr/local/include   maptemplate.c -o maptemplate.o
.
.
.
make[1]: Leaving directory '/usr/local/mapserver-4.8.0-rc2/mapscript/php3'
[anthony3@aragog mapserver-4.8.0-rc2]$ cp mapserv /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp legend /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp scalebar /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp shp2img /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp shp2pdf /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp shptree /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp shptreest /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp shptreevis /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp sortshp /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$ cp tile4ms /usr/local/apache2/cgi-bin/.
[anthony3@aragog mapserver-4.8.0-rc2]$

  Testing MapServer

[anthony3@aragog mapserver-4.8.0-rc2]$ /usr/local/apache2/cgi-bin/mapserv
This script can only be used to decode form results and
should be initiated as a CGI process via a httpd server.
[anthony3@aragog mapserver-4.8.0-rc2]$ 

The above output is what you want to see. Once you see this message, you are ready to build your MapServer application. HAPPY MAPPING!