Version 1.6

 MDweb installation and configuration (scripts – databases)

 Windows Platform

 

Preamble: This document describes in detail the operations necessary for manually installing scripts and relational databases of MDweb. Not covered is the installation and configuration of components necessary for running MDweb.

 

Contents

 

Components required before installation. 2

Configuring the Apache server and modifying the php.ini file. 3

Installing MDweb scripts. 6

Installing the MDweb databases. 6

MDweb configuration. 8

First connection to MDweb. 14

Choosing a publication rule. 14

Advanced configuration of MDweb. 15

 

 

•   Apache 1.3.x or 2.0.x and PHP 5.x module

The PHP module for Apache should be activated with the following complementary extensions:

O php_zip

O php_pgsql

O php_xsl

O php_curl

o  php_gd or php_gd2

O php-mapscript (4.10)

 

For installing version 1.6 of MDweb, we recommend the use of the MS4W solution, which simultaneously installs the Apache/PHP/MapServer components (see Mapserver 4 cartographic server). Should you want to, you can use the Wampserver 1.7.x solution; during installation it will ask you to install the Mapserver cartographic server independently.

- On our site:

http://www.mdweb-project.org/16/components/wamp5_1.7.2.exe

 

- Wampserver Sourceforge site:

https://sourceforge.net/project/showfiles.php?group_id=116092

 

·         PostgreSQL 8.x with its spatial extension PostGIS

 

- PostgreSQL 8.1 and 8.2 can be downloaded from our site:

http://www.mdweb-project.org/16/components/postgresql-8.1.1-1.zip

http://www.mdweb-project.org/16/components/postgresql-8.2.4-1.zip

 

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

- PostGIS: http://www.postgis.org/

 

·         Mapserver 4 cartographic server

 

The cartographic server is used in this version to provide map services to MDweb’s cartographic client. There are two ways to install Mapserver:

 

1. Using the MS4w solution (recommended) which installs Apache/PHP/Mapserver. For additional information on the versions of these components:

 http://www.maptools.org/ms4w/index.phtml?page=README_INSTALL.html#mapserver-build-environment

- MS4w (zip and installer) can be downloaded from our site:

http://www.mdweb-project.org/16/components/ms4w_2.2.3.zip

http://www.mdweb-project.org/16/components/ms4w-2.2.3-setup.exe  

- Maptools.org site:

 http://www.maptools.org/ms4w/index.phtml?page=downloads.html

The documentation for installing MS4W is available at this address:

http://www.maptools.org/ms4w/index.phtml?page=README_INSTALL.html

 

2. Starting with the installation of Mapserver 4.1

The binaries of MS4W on our site:

http://www.mdweb-project.org/16/components/ms4w_2.2.3.zip

 

On the Mapserver site:

http://mapserver.gis.umn.edu/download for all versions or http://mapserver.gis.umn.edu/download/current/ for the current version.

 

Configuring the Apache server

 

General configuration

 

There are no specific configuration requirements for MDweb. One has only to make sure that the values of certain Apache server directives are consistent. The Apache server is configured using the httpd.conf file. These configuration files are located in the [volume_name]:ms4w\Apache\conf folder.

Verify that the httpd.conf file contains the following directives:

 

#

AddType application/x-httpd-php .php

AddCharset ISO-8859-1 .iso8859-1

DirectoryIndex index.html index.html.var index.php

#

 

Configuration relating to Mapserver use

 

The use of Mapserver necessitates the addition of some directives in the htppd.conf file. If you install the MS4W solution via the installer, this file is modified for Mapserver use. The following directives are added:

 

 #

 ScriptAlias /cgi-bin/ "/ms4w/Apache/cgi-bin/"

 ##

 ## Alias for MapServer tmp directory

 ##

 Alias /ms_tmp/ /ms4w/tmp/ms_tmp/

# set environment vars necessary for MapServer

SetEnv PROJ_LIB /ms4w/proj/nad/

SetEnv PATH /ms4w/bin

SetEnv PATH /ms4w/Apache/cgi-bin/

 

# parse MS4W apache conf files

include /ms4w/httpd.d/httpd_*.conf

 

# set GDAL_DATA environment variable to location of supporting gdal files

SetEnv GDAL_DATA "/ms4w/gdaldata"

 

# set GDAL_DRIVER_PATH environment variable for gdal plugins

SetEnv GDAL_DRIVER_PATH "/ms4w/gdalplugins"

 

# set the TMP environment variable that is necessary for the sqlite php extension

SetEnv TMP "/ms4w/tmp"

 

Configuration relating to Mapserver use in MDweb

 

For the specific use of Mapserver in MDweb, you will have to add to the file:

 

#

# configuration for mapserver in MDweb

#

SetEnvIf Request_URI "/wms" MS_MAPFILE=c:\ms4w\Apache\htdocs\mdweb-demo16\mapserver_carto\config\default\carto.map

#

ScriptAlias /wms "/ms4w/Apache/cgi-bin/mapserv.exe"

#

Alias /proxy/ /ms4w/Apache/htdocs/mdweb-demo16/mapserver_carto/mapbuilder/server/php/

#

            <Directory "/ms4w/Apache/htdocs/mdweb-demo16/mapserver_carto/mapbuilder/server/php/">

                  Allow from all

                  Options Indexes MultiViews

                  AllowOverride None

                        Order allow,deny

            </Directory>

#

# end configuration of mapserver for MDweb

#

 

These directive values should, of course, reflect your installation path.


 

Configuration of the PHP module

 

Use of MDweb requires that 6 PHP extensions be activated. They are:

o    php_xsl

o    php_curl

o    php_gd or php_gd2

o    php_zip

o    php_pgsql

o    php_mapscript

 

New : the php php_gd is now mandatory for version 1.6. It is used to generate thumbnails in a right size in jpeg, gif and png format.

 

The configuration of the PHP module is limited to making some modifications in the php.ini configuration file which is found in the folder [volume_name]:ms4w\Apache\cgi-bin (case of MS4W installation). Several directives have to be changed; they are listed in the following table:

 

PHP Directives

Default value

Value for MDweb

register_globals

Off

On

magic_quotes_gpc

Off

On

max_execution_time

30

180

error_reporting

E_ALL

E_ALL & ~E_NOTICE[1]

short_open_tag

Off

On

file_uploads

Off

On

memory_limit

8M

16M

post_max_size

8M

16M

upload_max_filesize

1M

2M

allow_url_fopen

On

Off[2]

allow_call_time_pass_reference

Off

On

 

To allow the import of large thesauri (accessible from the Thesaurus module in the Administration section), it is advisable to specify a relatively large value for the max_execution_time directive (for example, 5000 for a thesaurus like Agrovoc).

 

To activate the PHP extensions necessary for running MDweb, you have to uncomment the following lines in the PHP file:

 

 

extension=php_xsl.dll

extension=php_curl.dll

extension=php_gd.dll # ou extension=php_gd2.dll

extension=php_zip.dll

extension=php_pgsql.dll

extension=php_mapscript.dll

 

 

It is also recommended that you verify the value of the default_charset directive in the same file. It should be consistent with the character set used in the writing of html pages. For Latin languages (Portuguese, French, Spanish, ...), it should be:

 

default_charset = "iso-8859-1"

 

Ensure that this directive isn’t commented out. If it is, uncomment it.

After saving the changes to the php.ini file, the Apache service has to be restarted for the changes to take effect.

 

 

Testing the Apache and PHP module configurations

 

We recommend that you verify that the modifications made to the Apache server and the PHP module have been taken into account. To do this, connect to this address: http://localhost/phpinfo.php If this don’t exist, you can create it with the following script :

<?

phpinfo();

?>

 

Two ways of installing MDweb scripts

 

1. Download the archive:

 http://www.mdweb-project.org/16/scripts/mdweb-demo16-en.zip

1.  Uncompress the archive in the publication folder of your  Apache server. If you have installed MS4W, your publication folder will be [volume_name]:\ms4w\Apache\htdocs\

2. In Windows Explorer, select the folder created [volume_name]:\ms4w\Apache\htdocs\, and change its properties (right click > Properties), uncheck Read only, and Apply the change to all sub-folders.

 

2. With a SVN client:

Go to the folder in which the MDweb scripts will be used and type the command:

> svn co http://svn.mdweb-project.org/public/scripts/1.6.x/ .

This command will allow you to store the scripts as a working version of the MDweb SVN repository. You will then be able to update your scripts by typing the command:

> svn  update

 

To provide full functionality to version 1.6, it is necessary to create three databases under PostgreSQL:

·   The MDweb database (mdweb-demo16) in which the metadata records will be stored.

·   The geographic database (geo-demo16) in which the geographic information layers used in the cartographic module will be stored. This database contains two vector layers: one layer of boundaries of the countries of the world and one of oceans.

·   The thesaurus database (thesaurus-eng) in which will be stored the reference thesauri (by default, Agrovoc (FAO), a demonstration thesaurus). You will subsequently be able to add GEMET (EIONET). The sample database contains only the English terms of these thesauri.

 

Downloading database installation scripts

Download the files from the following addresses and save them in a folder of your choice:

 

·   Creation of the mdweb-demo16-eng database:

http://www.mdweb-project.org/16/bd/metadata/CreationBD16.bat

http://www.mdweb-project.org/16/bd/metadata/dump-mdweb-demo16.sql  

 

·   Creation of the geo-demo16 database:

http://www.mdweb-project.org/16/bd/geodatabase/CreationBD-geo-demo16.bat

http://www.mdweb-project.org/16/bd/geodatabase/geo-demo16-windows-psql82.sql

 

·   Creation of the thesaurus-eng database:

http://www.mdweb-project.org/16/bd/thesaurus/CreationBD-thesaurus-eng.bat

http://www.mdweb-project.org/16/bd/thesaurus/dump-thesaurus-eng.sql

 

- to complement the thesaurus database with the GEMET thesaurus:

http://www.mdweb-project.org/16/bd/thesaurus/Insertion-gemet-eng.bat

http://www.mdweb-project.org/16/bd/thesaurus/dump-gemet-eng.sql

 

 

Pre-requisites to running the DB creation scripts

 

Modifying the pg_hba.conf file

To simplify the installation, especially the execution of the database installation scripts, it is necessary to modify the postgres server access file pg_hba.conf.

To do this, edit the pg_hba.conf file from the Start menu > Programs > PostgreSQL > Configuration file> Edit pg_hba.conf.

 

Change this line:

host    all         all         127.0.0.1/32          md5

to

host    all         all         127.0.0.1/32          trust

 

Reload the PostgreSQL configuration from the Start menu > Programs > PostgreSQL > Configuration file > Reload configuration.

 

 

Updating the Windows PATH system variable

The paths to the bin and lib folders of postgreSQL should be in the PATH variable of Windows so that the database installation scripts can be run and the database structure modified from within MDweb.

If they are not already in the PATH, you have to update Window’s PATH environment (Control Panel >System > Advanced > Environment variables) to include the paths to the executables and to the PostgreSQL libraries. Normally these paths are [volume_name]:\Program Files\PostgreSQL\8.1\bin and [volume_name]:\Program Files\PostgreSQL\8.1\lib. Restart your server.

 

Executing the database installation scripts

 

·         Creation of the mdweb-demo16 DB:

 

Execute the CreationBD16.bat script. During the execution of this script, you will be asked to provide a name for the MDweb database (by default, mdweb-demo16).

        

 

·         Creation of the geo-demo16 DB:

 

Execute the CreationBD-geo-demo16.bat script. During execution of this script, you will be asked to provide:

-  a name for the geographic database (by default, geo-demo16)

-  the  path of the lwpostgis.sql file necessary for the creation of geographic functions (by default: C:\Program Files\PostgreSQL\8.1\share\contrib\lwpostgis)

-  the path of the spatial_ref_sys.sql file which holds the properties of the system of projection (by default: C:\Program Files\PostgreSQL\8.1\share\contrib\spatial_ref_sys.sql )