wiki:RedHat9AndMapserver40b

!RedHat9 and !MapServer40b

The following are my build notes for installing MapServer 4.0b on a new installation of RedHat 9. This is based on the RedHat8AndMapserver37 build notes, but modified to include newer libraries and make it fit my style of redhat installation. Some additions to the RedHat8AndMapserver37 page may apply here.

One thing that I do on all redhat installations now is to install the port of "apt" for rpm-based distributions, available at http://freshrpms.net/apt/. When I did the fresh install of RH9 for this mapserver server, I did a fairly minimal install; really just enough to have ssh, httpd, text-based internet, and general development. Then I downloaded apt from http://shrike.freshrpms.net/rpm.html?id=650, installed the rpm and ran:

apt-get update apt-get upgrade

to get all of the RH9 updates. As I run up against libraries or commands that are missing, and available in standard rpms, I then run "apt-get install 'rpmname'" to get things working.

I run all these commands as root, so be careful, particularly if this is anything like a production machine. When I use this, I have the text in window, and I cut-and-paste to my Eterm to run the commands. This could almost be a script, or group of scripts with a menu, similar to http://www.apachetoolbox.com/.

Erich

July 14, 2003, modified to handle the beta2 file of mapserver.

Build Notes

# removed these and dependent rpms
# moved the following to the end:  apt-get remove gd
# Reason:  Too many dependencies on php caused the command to crash if php wasn't removed first  G. Creager 2003-11-16
apt-get remove curl
apt-get remove curl-devel
apt-get remove php
apt-get remove gd

# already have following rpms installed
apt-get install freetype freetype-devel
apt-get install libpng libpng-devel
apt-get install libtiff libtiff-devel zlib zlib-devel
apt-get install libjpeg libjpeg-devel
#
# I'm assuming that you will be providing a non-commercial mapserver
# application, and then can use the PDFlib-Lite under their 
# Alladin-type license. If not, you will need to either 
# purchase the full PDFlib library or disable

#  Doesn't respond to wget anymore:
#wget http://www.pdflib.com/products/pdflib/download/PDFlib-Lite-5.0.1-Unix-src.tar.gz
# So get:  
wget http://www.pdflib.com/products/pdflib/download/PDFlib-Lite-5.0.2-Unix-src.tar.gz
tar xzf PDFlib-Lite-5.0.2-Unix-src.tar.gz
cd PDFlib-Lite-5.0.2-Unix-src
make clean
./configure
make
make install
cd ..

# download and build ming
wget http://www.opaque.net/ming/ming-0.2a.tgz
tar xzf ming-0.2a.tgz
cd ming-0.2a
make clean
make
make static
make install

cd ..

# download and build curl
wget http://curl.haxx.se/download/curl-7.10.5.tar.gz
tar xzf curl-7.10.5.tar.gz
cd curl-7.10.5
make clean
./configure
make
make install

cd ..

# add /usr/local/lib to /etc/ld.so.conf
/sbin/ldconfig

# download and install gd-2 into /usr/local
rm -f /usr/lib/libgd.*     # to remove any potentially conflicts
wget http://www.boutell.com/gd/http/gd-2.0.15.tar.gz
tar xzf gd-2.0.15.tar.gz
cd gd-2.0.15
make clean
./configure
make
make install
cd ..

# download and install gdal-1.1.8
wget --passive-ftp ftp://ftp.remotesensing.org/pub/gdal/gdal-1.1.8.tar.gz
tar xzf gdal-1.1.8.tar.gz
cd gdal-1.1.8
make clean
./configure    --with-libz    --with-png    --with-libtiff=internal    --with-geotiff=internal    --with-jpeg    --without-jasper    --without-python
make
make ogr-all
make install
cd ..

/sbin/ldconfig

# download and build php
wget http://us2.php.net/get/php-4.3.2.tar.gz/from/us3.php.net/mirror
tar xzf php-4.3.2.tar.gz
cd php-4.3.2
make clean
rm -f config.cache
./configure    --enable-force-cgi-redirect    --with-config-file-path=/etc/httpd/    --with-gd=/usr/local    --with-jpeg-dir=/usr/lib    --with-png-dir=/usr/lib    --with-tiff-dir=/usr/lib    --with-zlib-dir=/usr/lib    --with-freetype-dir    --without-ttf    --with-pdflib    --with-mysql    --with-regex=system    --with-ming    --enable-dbase    --enable-dbx    --enable-versioning 

make
cp sapi/cgi/php /var/www/cgi-bin
make install
cp php.ini-dist /etc/httpd/php.ini
# change the following as appropriate
#diff /etc/httpd/php.ini php.ini-dist
#423c423
#< extension_dir = /etc/httpd/php_mods
#---
#> extension_dir = ./
cd ..


# download and build proj libraries
wget --passive-ftp ftp://ftp.remotesensing.org/pub/proj/proj-4.4.7.tar.gz
wget --passive-ftp ftp://ftp.remotesensing.org/pub/proj/proj-nad27-1.1.tar.gz
tar xzf proj-4.4.7.tar.gz
cd proj-4.4.7/nad
tar xzf ../../proj-nad27-1.1.tar.gz
cd ..
./configure
make
make install

/sbin/ldconfig
cd ..


# download and build mapserver
#wget http://mapserver.gis.umn.edu/dist/mapserver-4.0b.tar.gz
wget http://cvs.gis.umn.edu/dist/mapserver-4.0-beta2.tar.gz
tar xzf mapserver-4.0-beta2.tar.gz
cd mapServer-4.0-beta2
rm -f config.cache
./configure    --without-tiff    --without-eppl    --without-jpeg    --with-threads    --with-proj    --with-gdal=/usr/local/bin    --with-php=../php-4.3.2    --with-gd=/usr/local    --with-freetype=/usr/bin    --with-pdf    --with-ogr    --with-gdal    --with-ming    --with-wmsclient    --with-wfs    --with-wfs-client

make clean
make
# DO NOT do a "make install"

cp legend mapserv scalebar /var/www/cgi-bin
mkdir /etc/httpd/php_mods/
cp mapscript/php3/php_mapscript.so /etc/httpd/php_mods/

cd ..

# add to /etc/httpd/conf/httpd.conf

#
# For PHP scripts as CGI-BIN
#
#AddType application/x-httpd-php-cgi .php .php4 .phtml
#Action  application/x-httpd-php-cgi /cgi-bin/php

service httpd restart

# create /var/www/html/ms_info.php
#<?php
#dl("php_mapscript.so");
#phpinfo();
#?>

# check the output of http://yourhost/ms_info.php
# for mapserver support

Erich Schroeder

Last modified 11 years ago Last modified on Jan 26, 2009, 11:50:48 AM