Installation guide for MySQL – Windows platform

frightenedfroggeryData Management

Dec 16, 2012 (4 years and 11 months ago)

234 views


Desertification Unit
(US 166)

“Promoting the creation of data catalogs for improved sharing of
environmental information”









Installation guide for MySQL –
Windows platform
Version 1.3









MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
2
-

Contents

WHO IS THIS GUIDE MEANT FOR?............................................................3

1. PREREQUISITES FOR MDWEB INSTALLATION......................................3

1.1

I
NSTALLATION OF SERVICES REQUIRED BY
MD
WEB
............................................3

1.2

I
NSTALLATION AND CONFIGURATION OF SERVICES FOR
MD
WEB
..............................3

1.2.1 Installation and launching the Wamp application...............................3

Installation of the Wamp application........................................................3

1.2.2 Configuration of the Apache server and the PHP module.....................5

Configuring the Apache server................................................................5

Configuring the PHP module...................................................................5

Testing the Apache and PHP module configurations...................................6

2. INSTALLATION OF MDWEB...................................................................7

2.1

C
OPYING OF
PHP
SCRIPTS
........................................................................7

2.2

C
REATION OF THE
MD
WEB DATABASE
........................................................8

2.3

C
ONFIGURATION OF
MD
WEB
......................................................................9

2.3.1 Modifying the config.inc.php file.....................................................9

2.4

F
IRST CONNECTION TO
MD
WEB
................................................................10

2.5

C
ONFIGURATION OF
MD
WEB
....................................................................11

Choosing a validation rule....................................................................11

Declaring a catalog.............................................................................12

3. MDWEB ONLINE DOCUMENTATION.....................................................13

4. USEFUL ADDRESSES FOR MDWEB INSTALLATION..............................14

The PostgreSQL database server...........................................................14

The Apache server..............................................................................14

The PHP module.................................................................................14

PhpPgAdmin: an application for managing PostgreSQL databases..............14

The Wamp Server application...............................................................14


MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
3
-


Who is this guide meant for?

The MDweb installation guide for the Windows platform is meant for a specialist in
charge of managing the system, in other words, the system administrator. The guide
details all the services and procedures necessary to install MDweb on a Windows
(2000/XP) or a Windows server (2000/2003) platform. This guide is comprehensive:
follow all the instructions herein to obtain a working tool at the end. However, detailed
customization of services is not covered in this document.
1. Prerequisites for MDweb installation
1.1 Installation of services required by MDweb
In its standard version, the MDweb application requires implementation of the
following services before it can be installed under Windows:
• Apache and PHP module (Wamp application)
The PHP for Apache module should be activated with the following extensions:
o php-domxml
o php-zip
1.2 Installation and configuration of services for MDweb
1.2.1 Installation and launching the Wamp application
Wamp is an application that installs and activates an Apache server with the PHP module
and the MySQL database server. Additional information on the Wamp application can be
obtained from its official web site:
http://www.wampserver.com/en/index.php

Installation of the Wamp application
Use the following procedure to install the Wamp application (WampServer) with
the help of its installation wizard under Windows 2000/XP.
The steps
1 – Verify that the IIS service (web service) is not running on your
computer. If yes, you have to stop it: Control Panel > Administrative tools > Services.
Find one or more IIS services or web services. Select it, edit its properties and stop the
service permanently.
2 - Install Wamp5. The installation file is located here:
\MDweb\install\windows\wamp5_1.3.exe.
On the third screen, the installation wizard will offer you the option of launching
Wampserver automatically when Windows is started. If you would like to do so, check
the box and click Next.

MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
4
-


3 - Running Wamp
Run Wamp from the Windows Start menu > All Programs > Wampserver > Start
Wampserver.


4 - Test the functioning of your local web server. From the Wampserver menu,
open the local server (localhost). If Wampserver has been installed properly, the home
page of Wamp should appear. (If not or if you have other problems, take recourse to
http://www.wampserver.com/faq.php
where a number of common problems are
discussed.)
If this dialog box appears:
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
5
-


copy the file [volume_name]:\wamp\php4\dlls\iconv.dll to the
[volume_name]:\wamp\Apache folder.
1.2.2 Configuration of the Apache server and the PHP module
Configuring the Apache server
There are no specific configuration requirements for MDweb. One has to only
make sure that the values of certain Apache server directives are consistent. The Apache
server is configured using the plain-text httpd.conf file located in
[volume_name]:\wamp\Apache\conf\.
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

Configuring the PHP module
Use of MDweb requires that 3 PHP extensions be activated. These are:
o php-domxml (XML import/export module)
o php-zip (file attachment and compression)
o php-pgsql (connection to PostgreSQL)
The configuration of the PHP module is limited to making some modifications in
the php.ini configuration file which is found in the [volume_name]:\wamp\Apache\ folder
in most Windows distributions. 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
short_open_tag Off On
file_uploads Off On
memory_limit 8M 120M
post_max_size 8M 120M
upload_max_filesize 1M 30M
allow_url_fopen On Off
allow_call_time_pass_reference Off On
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
6
-

To activate the PHP extensions necessary for MDweb, you have to uncomment the
following lines in the php.ini file:
php_zip.dll
php_domxml.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 the html pages. For Latin languages (Portuguese, French, Spanish,...), it
should be:
default_charset = "iso-8859-1"
For English:
default_charset = "utf-8"

Make sure that this directive isn’t commented out. If yes, uncomment it.

After saving the modifications in the php.ini file, the Apache service has to be restarted
for the changes to take effect. Restart all the services from Wamp:
In the toolbar, click

Then select Apache > Restart Service.

The Apache service will be restarted. All modifications will have been taken into
account.

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 your local
server via Wamp > Localhost.
If the home page has a Tools section, click on the phpinfo() link.
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
7
-


The information page of the PHP module will be displayed. Scroll down this page
to verify that all the necessary extensions have indeed been installed.
2. Installation of MDweb

MDweb can only be installed once all necessary services (Apache, PHP module and
extensions, PostgreSQL) are active and have been restarted after the addition of
extensions, as is the case with PHP or its components.
The installation can be divided into five stages :
1. Copying of scripts into the Web publication folder
2. Database creation
3. Configuration of MDweb
4. First connection to MDweb
5. Customization of MDweb
2.1 Copying of PHP scripts
In this operation, all PHP scripts, css and image files contained in the MDweb
folder are copied to the publication folder of the Apache server. In Windows, this folder is
normally:
[volume_name]:\wamp\www\
1. From the CD-ROM, copy the MDweb folder to the root of the publication folder
of the Apache server (see path above).
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
8
-

2. In Windows Explorer, select the created folder
[volume_name]:\wamp\www\MDweb, and change its properties (right-click >
Properties), uncheck Read Only, and Apply the change to all sub-folders.
2.2 Creation of the MDweb database
This step consists of creating the database containing the structure for the
creation of interfaces and the structure of the metadata storage.
This database is created using a batch script (bat extension) that calls MySQL
functions to create the database and populate it with values. The sample database
included in the MDweb distribution is used for this.
To create the database, execute the CreationBD.bat file; it is found in the
MDweb\install\windows\dump\ folder. The script creates the MDweb-demo database.
Once the batch file finishes running, you can verify the creation of the database
using PhpMyadmin, supplied with the Wamp application.

Note: The CreationBD.bat script assumes the MySQL path for an installation with Wamp:
wamp\mysql\ . If you have installed Wamp in another folder, you will have to change
the two command lines in the bat file.

MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
9
-

2.3 Configuration of MDweb
2.3.1 Modifying the config.inc.php file
The MDweb configuration script has to be adapted for your Apache server and
your database management system.
1. Edit the
[volume_name]:\wamp\www\MDweb\config\config.inc.php
file.

2. Values of the MDweb global variables have to be modified based on your server
configuration. The table below lists the names and default values of the variables in the
config.inc.php file.

PHP variable name

Comments
Default value
General configuration parameters
$type_serveur Specifies the operating syste
m
on which
M
Dweb is installed. Two values are
possible ‘unix’ or ‘windows’.
windows
$url_site
S
pecifies the address at which MDweb will
b
e accessible. Do not specify here the
MDweb folder.
http://127.0.0.1
$alias_appli Allows you to specify the alias of
t
he
i
nstallation folder of MDweb. The default
v
alue corresponds to the case where the
f
older is just below the root of the
publication folder.
/MDweb/
$chemin_appli
S
pecifies the absolute path to the MDweb
folder, without mentioning it
/wamp/www/MDweb/
$lecteur
V
olume name of the hard disk on which
MDweb is installed, C: by default
C :
Parameters for database connection
$serveur
S
erver hosting the database. By default:

localhost’. If the database is not
h
osted on the same machine as the MDweb
application, supply the machine’s IP.
localhost
$db_type
S
pecifies the type of database used for
t
he MDweb database. Two values are
possible: ‘postgres’ or ‘mysql’.
mysql
$db_nom
S
pecifies the name of MDweb’s database.
I
t should correspond to the name given to
the database when it was created in the
previous stage.
MDweb-demo
$user
N
ame of the user who can access the MDweb
data.
root
$password
U
ser’s password. Not required for MySQL
mode.

MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
10
-

Parameters for enrolling users in MDweb
$email_admin MDweb administrator’s e-mail address.
admin-
mdweb@domaine.pays
$smtp_infos
A
ddress of mail server used for sending
e-mails for enrolment.
server-
smtp@domaine.pays
Configuration of the cartographic module
$web_carto
A
ctivation of the cartographic module for
entering data and searching
false
Configuration of the search module
$nb_fiches_consult
N
umber of records displayed on the
screen.
15
$periode
N
umber of days a reference is considered
‘new’ during searches
30

2.4 First connection to MDweb
1. Connect to MDweb using the administrator account from the ‘Manage catalog’
section from the MDweb home page:
Name: admin
Password: yopyop

2. You should immediately change the password of the admin user. Go to the
Administration module to do so.


Then to user management: Users account > Modify.

3. Edit the admin user by clicking on the green check mark at the end of the
admin line.
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
11
-


4. Enter the new password and validate.
5. Log out and reconnect using the admin login with the new password.
For details on user management, take recourse to online documentation – Help >
Administration help.

2.5 Configuration of MDweb
To make MDweb fully operational, two configuration operations are still necessary:
• Choosing a validation rule
• Declaring a catalog

Choosing a validation rule
MDweb allows you to define the rule for validating catalog references. You have
two choices:
• Manual
• Automatic
The manual validation rule states that for each record to be published, i.e., to
be accessible via the search form (access module), it has to be first validated by a user
having appropriate rights, either the administrator or the validator. By default, until it is
validated, a record is not published.
The automatic validation rule states that once a record has been created and
fully entered, it is automatically accessible via the search form. Evidently, we strongly
recommend that validation rule be set to manual.
To modify the validation rule:
1. In the Administration module, Options > Publication rule.



2. Click on the Change button to toggle between Automatic and Manual. When
you set it to Automatic, all existing records are automatically validated.
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
12
-


Declaring a catalog
For MDweb to store metadata records in a catalog, the catalog has to first exist.
MDweb has the facility of creating catalogs. When a metadata record is created, it can be
stored in any existing catalog. Before MDweb can be used, at least one catalog has to be
created.
In the Administration module, the Catalogs menu allows you to create, modify or
delete catalogs.
To create a catalog:
1. Select Catalogs > Add.

2. Complete the form by filling in your organization’s name in the Catalog name
field, and selecting your country. Validate and your catalog is created.



3. At any stage, you can change the organization name by using the
modification form at Organizations > Modify.
MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
13
-


3. MDweb online documentation
Online documentation is available for MDweb. It is accessible from the home page
for:
• Help in searching for references
• Help in managing catalogs

The online documentation is also available from the menu of the management and
administration module.



MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
14
-


4. Useful addresses for MDweb installation

We provide here a non-exhaustive list of web addresses for reference
documentation or online help that may be useful for installation, usage of services,
modules and extensions necessary for MDweb installation.

The PostgreSQL database server
PostgreSQL presentation: http://www.grappa.univ-lille3.fr/polys/reseaux-2000/reseaux022.html

PostgreSQL installation: http://diablotins.org/documentation.php4?article=postgresql

Official PostgreSQL documentation: http://www.postgresql.org/docs/

Reference documentation in French: http://www.linux-france.org/article/serveur/psql/Postgres-7.2/set1.html

PostgreSQL and security: http://pgsql-fr.tuxfamily.org/pgsql-fr/auth-methods.htm

PostgreSQL download site: http://www.postgresql.org/ftp/binary/



The Apache server
Official Apache site http://httpd.apache.org/

Http server section
Apache server documentation (French) http://httpd.apache.org/docs/


The PHP module
Official PHP site: http://www.php.net/

PHP installation (French): http://dev.nexen.net/docs/php/annotee/installation.php

PHP - PostgreSQL http://php.planetmirror.com/manual/fr/ref.pgsql.php

PHP – MySQL http://www.phpscripts-fr.net/

http://www.nexen.net/index.php

PHP source files http://www.php.net/downloads.php


PhpPgAdmin: an application for managing PostgreSQL databases
The PhpPgAdmin php application is a very useful tool for managing databases
under PostgreSQL. You can download the scripts and get online help at the following
URL: http://phppgadmin.sourceforge.net/


The Wamp Server application

Official site http://www.wampserver.com/

MDweb installation guide – Windows Platform
Desertification unit (IRD) 12/11/2006 -
15
-






















Contacts



IRD / Desertification unit (US 166)
500, rue Jean François Breton, 34093 Montpellier Cedex 05, France
TEL : +33 (0)4 67 54 87 02
J.C Desconnets jcd@teledetection.fr

B. Granouillac bgranou@teledetection.fr


MDweb project site: www.mdweb-project.org

Online demo: www.mdweb-project.org/demo14/