Version 1.6

 MDweb installation and configuration (scripts – databases)

 Linux 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 modifiying the php.ini file. 3

Installing MDweb scripts. 5

Installing the MDweb databases. 6

MDweb configuration. 8

First connection to MDweb. 13

Choosing a publication rule. 14

Advanced configuration of MDweb. 14

 

Components required before installation

 

•   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 php5-pgsql

O php5-xsl

O php5-gd

O php5-curl

O php5-mapscript (4.10)

O php5-zip

 

See the packages depending on the Linux distributions

 

·         PostgreSQL 8.x with its spatial extension PostGIS

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

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

See the packages depending on the Linux distributions

 

·         Mapserver 4 cartographic server

The cartographic server is used in this version to provide map services to MDweb’s cartographic client.

 

- Maptools.org site:

The Maptools site offers the FGS installer that installs on a Linux platform the Mapserver and PHP/Mapscript components as well as all other accessories necessary for their functioning. Find all the details at:  http://www.maptools.org/fgs/  .

Documentation can be found at: http://www.maptools.org/fgs/index.phtml?page=docs.html

 

- Mapserver site:

Mapserver components can, of course, be downloaded from the official 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 configuration of the Apache server is found in the httpd.conf or Apache2.conf files. These configuration files are located in the /etc/Apache2/conf directory (in the case of Debian). Verify that this 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 Apache configuration file. Depending on your installation mode (compilation or packages installation), the following directives will be automatically added to the file or you will have to do so by editing the Apache configuration file. The paths, below, are provided as examples.

 

 #

 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

#

      <Directory /usr/lib/cgi-bin>

            AddHandler cgi-script .cgi

            Options +ExecCGI

            AllowOverride None

            Options None

            Order allow,deny

            Allow from all

      </Directory>

##

 

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=/var/www/mdweb-demo16/mapserver_carto/config/default/carto.map

#

ScriptAlias  /wms /usr/lib/cgi-bin/mapserv

#

Alias /proxy/  /var/www/mdweb-demo16/mapserver_carto/mapbuilder/server/php/

#

<Directory /var/www/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 php5-pgsql

O php5-xsl

O php5-gd

O php5-curl

O php5-mapscript (4.10)

O php5-zip

 

New : the php php5-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 /etc/php5/apache2/php.ini directory (in the case of Debian). 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).

 

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 directory of your Apache server.

2. You have to make the apache user the owner of all MDweb scripts and directories. In the mdweb-demo16 directory, execute the commands:

> chmod –R 775 *

> chown –R apache *

 

2. With a SVN client:

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

 

1. Store the scripts

> svn co http://svn.mdweb-project.org/mdweb1/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

2. You should make the apache user the owner of all MDweb scripts and directories. In the mdweb-demo16 directory, execute the commands:

> chmod –R 775 *

> chown –R apache *

 

This change of owner of the mdweb-demo16 directory is important because it will allow the MDweb application to copy, modify or delete files in the MDweb directory and sub-directories.

 


 

 

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) 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 directory of your choice:

 

·   Creation of the mdweb-demo16 database:

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

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-linux.sh  

http://www.mdweb-project.org/16/bd/geodatabase/geo-demo16-linux-psql81.sql

 

·   Creation of the thesaurus-eng database:

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

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.sh  

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.

 

 

Executing the database installation scripts

 

·         Creation of the mdweb-demo16 DB:

 

Execute the CreationBD16.sh 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.sh 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: /usr/local/pgsql/share/contrib/lwpostgis.sql)

-  the path of the spatial_ref_sys.sql file which holds the properties of the system of projection (by default: /usr/local/pgsql/share/contrib/spatial_ref_sys.sql )

 

 

·         Creation of the thesaurus-eng DB:

 

Execute the CreationBD-thesaurus-eng.sh. script. During execution of this script, you will be asked to provide a name for the thesaurus database (by default, thesaurus-eng).

                   If you want to complement this DB with the GEMET thesaurus, execute the scripts:

 

                   - Insertion-gemet-en.sh (GEMET thesaurus)

 

You will be asked to provide a name of a database. Enter the same name as the one you gave to the thesaurus DB when you created it, above.


 

 

By default, MDweb is configured to work with the following parameters:

 

·         Web address: http://localhost/mdweb-demo16/

·         Scripts path: /var/www/mdweb-demo16/

·         Name of the DB server: localhost

·         Name of the PostgreSQL user: postgres

·         Password of the PostgreSQL user: postgres

·         Name of the MDweb DB: mdweb-demo16

·         Name of the geographic DB: geo-demo16

·         Name of the