In SuSE-Doku einarbeiten!


Änderungen:

Z.B. Bietet die 9.2 nur noch den 2er Apache

Auf HT-Prozessoren mit SLES9 oder 9.2 Pro muß noch Apache-Prefork installiert werden (MultiThreading), bleibt einem aber auch ohnein nichts anderes übrig

Auf dem 9SLES und 9.2 Pro müssen nun einige php4-Module installiert werden, die vorher fest einkompiliert waren.



(October 2004)


Authors:

Till Adams, terrestris GbR Bonn (Geo-Consortium)

Ben Thelen, CCGIS GbR Bonn (Geo-Consortium)


This How-To describes the required installation steps to have a UMN-MapServer 4 with PostGIS support on SuSE Linux 9 Professional running, as well as using Mapbender as a WMS client.


A How-To for the installation of UMN-MapServer 3 on SuSE Linux 8.0 can be found here: http://mapserver.gis.umn.edu/cgi-bin/wilma_hiliter/mapserver-users/0208/msg00285.html


Detailed information how to install Mapbender WMS Client Suite can be found on http://www.mapbender.org.


I. Required Software

SuSE Linux 8.x, 9.x Professional, SuSE Linux Enterprise Server 8 / United Linux 1.0 or SuSE Linux Enterprise Server 9


The rpm-packages listed below, are chosen from SuSE 9.0.


Because of missing rpm-packages, it is necessary to install some software by compiling source code. In this case dependencies have to be checked, before doing so.


Available rpm packages

General software packages

apache-1.3.28 http://httpd.apache.org/

Apache2

apache2-mod_php4

apache2-prefork

libapr0

mod_php4 http://www.php.net

postgresql-7.3.4 http://www.postgresql.org

postgrsql

postgrsql-devel

postgrsql-server

postgrsql-libs

mysql-Max http://www.mysql.org

mysql-devel- 4.0.15

mysql

perl-DBD-mysql

mysql-shared

mysql-devel

mysql-client

mysql-MAX

php4-mysql

bzip2 Extracting source code

unzip Extracting source code

gcc-c++ Compiling source code

make Compiling source code

openssl-devel Required by MapServer

openssl

openssl-devel

Libraries

http://mapserver.gis.umn.edu/doc36/unix-install-howto.html

http://mapserver.gis.umn.edu/doc40/unix-install-howto.html


curl-devel-7.10.5 http://curl.haxx.se/libcurl/

curl

curl-devel

php4-curl

gd-devel- 2.0.15 http://www.boutell.com/gd/

gd

gd-devel

gdb

syslogd

gdbm

php4-gd

freetype2-devel- 2.1.4 http://www.freetype.org/

freetype2

freetype2-devel

libjpeg-6.2.0 http://www.ijg.org/

libjpeg

libjpeg-devel

libtiff-3.5.7 http://www.libtiff.org/

libtiff

libtiff-devel

libpng-devel-1.2.5 http://www.libpng.org/pub/png/

libpng

libpng-devel

yacc-91.7.30

fehlt nicht notwendig?

flex-2.5.4a

flex

bison-1.75 (MapServer > 4.0)

bison


The -devel (developer) packages are required, in order to have the required header-files on the system for compiling UMN-MapServer. The main packages will be installed as a dependency at the same time.

Not available as rpm package:

General software packages

PostGIS 0.7.5/0.8.1/0.9.0 http://postgis.refractions.net

UMN MapServer 4.x http://mapserver.gis.umn.edu

php 4.3.4 http://www.php.net

Libraries

gdal 1.2.1 http://www.remotesensing.org/gdal/

proj-4.4.8 http://www.remotesensing.org/proj/

libwww-5.4.0 http://www.w3.org/Library/

libiconv-1.9.1 http://www.gnu.org/software/libiconv/

GEOS-2.0.1 http://geos.refractions.net/


Other optional libraries

LibGeoTIFF http://www.remotesensing.org/geotiff/geotiff.html

Oracle Spatial Client Librairies http://www.oracle.com

These libraries are provided with Oracle product, and used to interface with an Oracle Spatial warehouse.

SDE Client Librairies http://www.esri.com

These libraries are provided with ESRI's Spatial Data Warehouse ArcSDE.

II. Systems installation

It is recommended to change the default partition suggestions.


For example:


/dev/hda1 swap 2x RAM

/dev/hda2 / 1.0GB

/dev/hda3 Extended

/dev/hda5 /var 251 MB

/dev/hda6 /tmp 251 MB

/dev/hda7 /usr 2.0GB

/dev/hda8 /data rest


This should be enough for a later X installation, if desired. But I recommend to choose Minimal Installation, which is without any graphical interface.

III. Software installation

General instructions

Yast2

Yast2 is a graphical frontend based on rpm-packages which is able to solve dependency confilicts.


rpm

Rpm-packages can be installed within a shell of course, too.


rpm -i URL (i.g. rpm -i ftp://ftp.suse.com/pub/suse/…/mod_php4-4.3.1-52.i586.rpm)

rpm -i .rpm (i.g. rpm -i /tmp/mod_php4-4.3.1-52.i586.rpm)


directly from source

The sources can be downloaded from the websites listed in section I. Required Software.


First the archive has to be extracted:


# tar -xzf filename.tgz or

# gzip -d -c filename.tgz | tar xvf -


After extraction, the ./configure-skript needs to be executed. This script builds a system-specific makefile.

Change into the folder which was just created by the extraction-process and type:


./configure [optional: --with-option / usually –h or --help prints out all available options]


The source code can then be built via make and after finishing, installed via make install


# ./configure

# make

# make install

# ldconfig


Installation Procedure


Just start YAST, skim through the list above and install these packages.


Before you start


Before starting check /etc/hosts, if your hostname is correctly configured:


[your.ip.add.ress] [your.host.name]*


*Checkout with the command hostname.

´



PostgreSQL

PostgreSQL 7.2 is supported by UMN-MapServer, but version 7.3 is really recommended and since PostGIS 0.8 also PostgreSQL 7.4 is supported.


The source code is needed for building PostGIS against the PostgreSQL source tree later on. It is installed into /usr/src/packages/SOURCES/ and needs to be extracted and compiled.


# bunzip2 postgresql-7.3.4.tar.bz2

# tar -xf postgresql-7.3.4.tar

# cd postgresql-7.3.4/

# ./configure --without-readline (if not installed on the system)

# make


To start postgresql manually type /etc/init.d/postgresql start on the command line. To start postgresql (or any other daemon) on boot, call the Runlevel Editor within Yast2.


To have PostgreSQL accepting Internet connections /var/lib/pgsql/data/postgresql.conf needs to be edited. 'tcpip_socket=false' or 'tcpip_socket=0 needs to be uncommented and set to true ( or '1' for pgsql 7.2.x).

It is also required to configure the pg_hba.conf, which contains the list of allowed hosts.


MySQL

MySQL is required by Mapbender-2 wms client suite. MySQL 4 is mandatory.


SuSE Linux requires the rpm-package mysql-Max to be installed, as the standard mysql-server package does not support innodb tables.


Right after mysql installation the following needs to be uncommented /etc/my.cnf. “skip-innodb” just needs to be commented out. Restart mysql by typing '/etc/init.de/mysql restart'


#skip-innodb


# Uncomment the following if you are using InnoDB tables

innodb_data_home_dir = /var/lib/mysql/

innodb_data_file_path = ibdata1:10M:autoextend

innodb_log_group_home_dir = /var/lib/mysql/

innodb_log_arch_dir = /var/lib/mysql/


# You can set .._buffer_pool_size up to 50 - 80 %

# of RAM but beware of setting memory usage too high

innodb_buffer_pool_size = 16M

innodb_additional_mem_pool_size = 2M


# Set .._log_file_size to 25 % of buffer pool size

innodb_log_file_size = 5M

innodb_log_buffer_size = 8M

innodb_flush_log_at_trx_commit = 1

innodb_lock_wait_timeout = 50


The developer-package is only required if php4MapScript support is required. Otherwise just install mysql-Max, without the dev-package.



PHP4

phpMyAdmin

php4

php4-bz2

php4-curl

php4-dbase

php4-gd

php4-mysql

php4-pgsql

php4-session

php4-zlib

apache2-mod_php4

It is recommended for security reasons to install PHP4 as an apache module. However if UMN-MapServer needs to be compiled with PHP4 to support phpMapScript, then PHP4 needs to be compiled as a cgi.

The usage of suexec or suphp (www.suphp.org) for security reasons should be taken into account (See http://www.php.net/manual/en/security.cgi-bin.php for more information on this security issue)!


- Required opitions for php4


--enable-dbase

--enable-force-cgi-redirect

--with-jpeg-dir[=DIR]

--with-mysql[=DIR]

--with-pgsql[=DIR]

--with-png-dir[=DIR]

--with-tiff-dir[=DIR]

--with-freetype-dir[=DIR]

--with-xml

--with-zlib=yes

--with-gd

--with-curl[=DIR]

--with-regex=system


Installation as a apache module --> without phpMapScript support

Install mod_php4.


Installation as a cgi for phpMapScript support


PHP4 must explicitely be compiled as a cgi and with the --with-system-regex option (Default: --with-regex=php) , if phpMapScript support is required.


Further information:

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0208/msg00354.html

http://old-mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScript

http://old-mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI

Configure options for php4:


./configure --prefix=/usr/share --datadir=/usr/share/php --bindir=/usr/bin --libdir=/usr/share --includedir=/usr/include --with-_lib=lib --with-config-file-path=/etc --with-exec-dir=/usr/lib/php/bin --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-dbase --enable-exif --enable-filepro --enable-force-cgi-redirect --enable-ftp --enable-gd-imgstrttf --enable-gd-native-ttf --enable-inline-optimization --enable-magic-quotes --enable-mbstr-enc-trans --enable-mbstring --enable-mbregex --enable-memory-limit --enable-safe-mode --enable-shmop --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-versioning --enable-wddx --enable-yp --with-bz2 --with-dom=/usr/include/libxml2 --with-gettext --with-jpeg-dir=/usr --with-mysql=/usr --with-pgsql=/usr --with-png-dir=/usr --with-tiff-dir=/usr --with-ttf --with-freetype-dir=yes --with-xml --with-zlib=yes --with-gd --with-curl=/usr/local --with-iconv --with-regex=system



After finishing the installation, the PHP4 binary (/data/src/php-4.3.4/sapi/cgi), needs be copied into the server's cgi-bin directory (SuSE default: /srv/www/cgi-bin), /path/to/src-code/php.ini-dist needs to be copied to /etc/php.ini and the following lines have to be added to the apache configuration-file httpd.conf beneath AddType application/x-tar .tgz:


AddType application/x-httpd-php .php

Action application/x-httpd-php /cgi-bin/php


A directory alias for apache has to be configured to allow web access to the directory, which is referenced in a map-file as “IMAGEURL”. For instance:


Alias /umn/ "/data/umn/umn-www"


<Directory "/data/umn/umn-www">

Options All

AllowOverride None

Order allow,deny

Allow from all

</Directory>



Apache needs to be restarted in order to load the changed httpd.conf. This can be accomplished either by typing /etc/init.d/apache restart or by typing apachectl graceful.


libiconv-1.9.1

Required by UMN-MapServer 4 and gd2.


No rpm-package available. Installation via source code compiling.


proj-4.4.8

No rpm-package available. Installation via source code compiling


UMN-MapServer expects an epsg-file in capitel letters. The easiest way is to create a symbolic link in /usr/local/share/proj:

ln –s epsg EPSG


gdal-1.2.1

Requires g++.


No rpm-package available. Installation via source code compiling.


If UMN-MapServer failes to run with the appropriate gdal error-message, the following needs to be done:


# vi /etc/ld.so.conf (add /usr/local/lib)

# ldconfig -v (check for entry)





libwww-5.4.0

Required only by UMN-MapServer 3


No rpm-package available. Installation via source code compiling.


gd-1.8.4

UMN-MapServer requires a installed gd. UMN-MapServer 3 builds with gd1 or gd2.

SuSE 8.1 ships with gd-1.8.4, SuSE 8.2 ships with gd-2.0.11. For UMN-MapServer 4 gd-2.0.12 or higher is required, which is available on SuSE 9


Yast: gd-devel-1.8.4

Yast: gd-1.8.4


gd2-2.0.15

Required by UMN-MapServer 4


Yast: gd-2.0.15-devel

Yast: gd-2.0.15



For earlier releases than SuSE 9, there is no rpm-package available. Installation via source code compiling. Attention! gd-1.8.4 needs to be deinstalled!


GEOS


No rpm-package available. Installation via source code compiling.


PostGIS 0.7.5/0.8.1/0.9.0


PostGIS needs to be uncompressed and untared in the archive in the "contrib" directory of the PostgreSQL source tree.


# cd /sourc-tree-of/postgresql-7.3.4/contrib

# gzip -d -c postgis-0.7.5.tar.gz | tar xvf -


Either the just created directory has to be renamed

# mv postgis-0.7.5 postgis

or the Makefile has to be edited. For projection support leave the value for USE_PROJ and additionally since PostGIS 0.8 for geos support leave the value for USE_GEOS (Requires a geos-installation), otherwise change it to “0”.


# cd postgis

# make

# make install


Load PostGIS functions and objects into PostgreSQL

The file postgis.sql uses the variable $libdir. This variable contains the path to the PostGIS libraries. On some systems it contains a wrong value and executing postgis.sql fails.

To correct this either the string '$libdir' can be changed into the absolute path, which can be found out via pg_config --pkglibdir or the libraries can be copied to to the apropriate location.


The libraries can be found in /usr/local/pgsql/lib/.

pg_config --pkglibdir shows /usr/lib/postgresql.


ln -s /usr/local/pgsql/lib/libpostgis.so.0.7 /usr/lib/postgresql


# cp /usr/local/pgsql/lib/libpostgis.a /usr/lib/postgresql (PostGIS 0.7)

# cp /usr/local/pgsql/lib/libpostgis.so.0.7 /usr/lib/postgresql (PostGIS 0.7)


# cp /usr/local/pgsql/lib/libpostgis.so.0.8 /usr/lib/postgresql (PostGIS 0.8/0.9)


In pg_config --pkglibdir (/usr/lib/postgresql) two symbolic links have to be created.



# ln –s libpostgis.so.0.7 libpostgis.so (PostGIS 0.7)

# ln –s libpostgis.so.0.7 libpostgis.so.0 (PostGIS 0.7)


# ln -s libpostgis.so.0.8 libpostgis.so (PostGIS 0.8/0.9 )

# ln -s libpostgis.so.0.8 libpostgis.so.0 (PostGIS 0.8/0.9)





The following is necessary to add PostGIS support into a new or existing, but empty postgressql database. It has to be done as a known database user. On SuSE systems the pgsql-user is called postgres.


# su PG-SQL_USER

# createdb mydb (pgSQL-command to create a new database)


# createlang plpgsql mydb (there’ll be no output)

# psql -d mydb -f /usr/local/pgsql/share/contrib/postgis.sql (psql the SQL console)

# psql -d mydb -f /usr/local/pgsql/share/contrib/spatial_ref_sys.sql



The following output can be seen after executing postgis.sql. This is not an error!


> psql -d test2 -f /root/postgresql/postgresql-7.3.2/contrib/postgis-0.7.4/postgis.sql > /tmp/output.txt

psql:/root/postgresql/postgresql-7.3.2/contrib/postgis-0.7.4/postgis.sql:18: NOTICE: ProcedureCreate: type histogram2d is not yet defined

psql:/root/postgresql/postgresql-7.3.2/contrib/postgis-0.7.4/postgis.sql:23: NOTICE: Argument type "histogram2d" is only a shell

.

.

psql:/root/postgresql/postgresql-7.3.2/contrib/postgis-0.7.4/postgis.sql:154: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'spatial_ref_sys_pk

ey' for table 'spatial_ref_sys'

psql:/root/postgresql/postgresql-7.3.2/contrib/postgis-0.7.4/postgis.sql:174: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'geometry_columns_p

k' for table 'geometry_columns'


UMN-MapServer

General Instructions

If compiling of mapserver fails (first occured on SuSE 8.2) with an error regarding gdal (e.g. cannot find gdal-config), then supply the full path to gdal-config after --with-ogr!


To support phpMapScript supply the as the value of --with-php the path to the source tree of PHP4 : --with-php=/data/src/php-4.3.4


UMN-MapServer 3.6
UMN-MapServer 4.6 verwenden!!!!!!!

Obviously it is not necessary to supply the graphics libraries, so the following is enough:


./configure --with-gd=/usr \

--with-gdal \

--with-ogr \

--without-tiff \

--without-png \

--with-proj=/usr/local \

--with-wmsclient \

--with-postgis



Because there are incompatibilities between mapserver 3.6 and pgsql 7.3.2 a new mappostgis.c has to be used. See http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0304/msg00305.html



Finally compile the code with make (DO NOT make install!!) and copy the mapserv binary to /srv/www/cgi-bin!


UMN-MapServer 4.0


./configure --with-proj \

--without-tiff \

--without-png \

--with-wmsclient \

--with-wfs \

--with-wfsclient \

--with-postgis \

--with-ogr \

--with-gdal

Finally compile the code with make (DO NOT make install!!) and copy the mapserv binary to /srv/www/cgi-bin!



Aus YAST SuSE9.2 installierte Pakete

geänderte Pfade




UMN-MAP-Server in /opt/mapserver2 installiert,-->>

in /etc/apache2/default-server.conf



Alias /mapbender2 "/opt/mapbender2/http"


<Directory "/opt/mapbender2/http">

Options MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>


eingefügt.