Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
metamod:install [2010-06-25 11:17:12] geira |
metamod:install [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== How to configure and install ====== | ====== How to configure and install ====== | ||
- | ===== Dependencies ===== | + | The latest version of the documentation is always available in [[https:// |
- | This software depends on the following external software which is not part | + | ===== Installing |
- | of the METAMOD 2.x distribution: | + | |
- | * Linux operating system. METAMOD 2.x should work on other UNIX-like operating systems, but this is not tested. | + | The installation procedure is evolving for each new release, constantly seeking to make it more automated and painless. For instructions, read the official installation guide for the required release: |
- | * Mail system | + | |
- | * PostgreSQL database system. Tested on version 8.1 | + | |
- | * Apache 2.x web server with PHP 5.x installed, including pgsql, libxml | + | |
- | * Perl v5.8 with the following Perl modules: File::Copy, File::Path, XML:: | + | |
- | * NetCDF software | + | |
- | * ImageMagick | + | |
- | * curl, php5-curl (for fimex functionality) | + | |
- | ==== Ubuntu 8.04 (Hardy) ==== | + | * [[https:// |
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
- | The following packages are required: | ||
- | * exim4; dpkg-reconfigure exim4-config | + | ===== Initialization |
- | * postgresql-8.3 | + | |
- | * postgresql-contrib-8.3 | + | |
- | * libapache2-mod-php5 | + | |
- | * php5-pgsql | + | |
- | * libdbd-pg-perl | + | |
- | * libxml-simple-perl | + | |
- | * libxml-libxslt-perl | + | |
- | * libmailtools-perl | + | |
- | * libwww-perl | + | |
- | * pdl | + | |
- | * libnetcdf-dev | + | |
- | * netcdf-bin | + | |
- | * proj | + | |
- | * imagemagick | + | |
- | * gcc | + | |
- | * make | + | |
- | * mailx (test only) | + | |
- | * libxml2-utils (test only) | + | |
- | * subversion (test only) | + | |
- | * libdatetime-perl (test only) | + | |
- | * php5-curl (fimex reprojection) | + | |
- | + | ||
- | In addition, the following CPAN packages do not exist in etch and need to be installed separately: | + | |
- | * Geo:: | + | |
- | * PDL::NetCDF | + | |
- | + | ||
- | Note: several people (including me) have seen problems when installing postgresql. The reason is not clear, | + | |
- | but a < | + | |
- | sudo apt-get install postgresql-8.3</ | + | |
- | + | ||
- | === Changes for 2.4 === | + | |
- | + | ||
- | New packages: | + | |
- | * php5-gd | + | |
- | * php5-xsl | + | |
- | * postgresql-8.3-postgis | + | |
- | + | ||
- | Removed packages: | + | |
- | * imagemagick | + | |
- | * php5-curl | + | |
- | + | ||
- | + | ||
- | ==== Debian Etch ==== | + | |
- | + | ||
- | The following packages are required on Debian Etch to fulfil the requirements: | + | |
- | + | ||
- | * exim4 | + | |
- | * postgresql-8.1 | + | |
- | * apache2-mpm-prefork | + | |
- | * libapache2-mod-php5 | + | |
- | * php5-pgsql | + | |
- | * libdbi-perl | + | |
- | * libdbd-pg-perl | + | |
- | * libxml-simle-perl | + | |
- | * libxml-libxslt-perl | + | |
- | * libmailtools-perl | + | |
- | * libwww-perl | + | |
- | * pdl | + | |
- | * netcdf-bin | + | |
- | * netcdf-dev | + | |
- | * proj | + | |
- | * imagemagick | + | |
- | * gcc | + | |
- | * make | + | |
- | * libdatetime-perl (test only) | + | |
- | * mailx (test only) | + | |
- | * libxml2-utils (test only) | + | |
- | + | ||
- | In addition, the following CPAN packages do not exist in etch and need to be installed separately: | + | |
- | * Geo:: | + | |
- | * XML:: | + | |
- | * PDL:: | + | |
- | + | ||
- | ===== Directory structure ===== | + | |
- | + | ||
- | The top METAMOD 2.x directory | + | |
- | is divided into one subdirectory for each module (base, search, upload and | + | |
- | quest). In addition, one subdirectory (app) contains an example application. | + | |
- | + | ||
- | The module directories shares a common structure. During installation of an | + | |
- | application, | + | |
- | directories are merged into this target directory. In each module directory | + | |
- | there is a htdocs subdirectory. The htdocs directories for all the selected | + | |
- | modules are in the same way merged into one htdocs subdirectory in the target | + | |
- | directory. | + | |
- | contained within subdirectories of the htdocs directory. For example, all such | + | |
- | files are contained in the directory htdocs/sch for the METAMODSEARCH module, | + | |
- | and htdocs/upl for the METAMODUPLOAD module. On the target directory, there | + | |
- | will be a htdocs directory containing both the sch and the upl subdirectories. | + | |
- | Some htdocs subdirectories may be shared among several modules. For example, | + | |
- | the METAMODBASE module and the METAMODQUEST module both have files in the adm | + | |
- | subdirectory. Special care must be taken for these files to avoid name | + | |
- | collisions. | + | |
- | + | ||
- | Each module directory must also contain a file ' | + | |
- | lists all files comprising the module. | + | |
- | + | ||
- | The app directory contains one subdirectory for each application. In each | + | |
- | of these application directories there must be a configuration file called | + | |
- | ' | + | |
- | that are specific for the application (image files, style sheets etc.). | + | |
- | Application directories may also be found outside the METAMOD 2.x source tree. | + | |
- | + | ||
- | + | ||
- | ===== System Configuration ===== | + | |
- | + | ||
- | The following values should be configured in the **php.ini** file | + | |
- | + | ||
- | < | + | |
- | track_errors = On | + | |
- | upload_max_filesize = 100M | + | |
- | post_max_size = 100M | + | |
- | </ | + | |
- | + | ||
- | The following values are an advantage to use in **postgresql.conf**: | + | |
- | + | ||
- | < | + | |
- | random_page_cost = 2.0 | + | |
- | </ | + | |
- | + | ||
- | ===== Configuration ===== | + | |
- | + | ||
- | The source files within the METAMOD 2.x directories contain a variety of file | + | |
- | types (PHP, Perl, XML, HTML/XHTML, CSS and shell-script files, some of | + | |
- | them with embedded SQL). The source files are not intended to be used | + | |
- | directly, but must be modified and copied to a target directory tree before | + | |
- | the application can run. The reason for this is to apply a unified | + | |
- | configuration method for all the different file types. | + | |
- | + | ||
- | An application directory must contain a file, **'' | + | |
- | + | ||
- | This file contains lines as follows: | + | |
- | + | ||
- | VARNAME = VALUE | + | |
- | + | ||
- | ' | + | |
- | of white space characters may separate ' | + | |
- | ' | + | |
- | the last non-whitespace character on the line. Additional lines may be | + | |
- | appended to ' | + | |
- | lines must start with a space character. No whitespace are removed from such | + | |
- | appended lines. | + | |
- | + | ||
- | VALUEs may be empty, which sometimes indicate that some aspect of the software | + | |
- | is turned off. An empty value is indicated by having no characters (or only | + | |
- | whitespace characters) after the ' | + | |
- | + | ||
- | In addition, comment lines, starting with '#', | + | |
- | ignored. | + | |
- | + | ||
- | In the source files, all text strings like: | + | |
- | + | ||
- | [==VARNAME==] | + | |
- | + | ||
- | will be substituted with the corresponding value when the files are modified and | + | |
- | moved to the target directory. Such text strings may also be found within ' | + | |
- | strings, and they will be substituted as appropriate. | + | |
- | + | ||
- | One variable is mandatory in master_config.txt: | + | |
- | directory name of the target directory, the top level of the target directory | + | |
- | tree. | + | |
- | + | ||
- | The following variables are used to select the modules that will comprise the | + | |
- | application. They also identify the absolute path of the source directory for | + | |
- | each module: | + | |
- | + | ||
- | METAMODBASE_DIRECTORY | + | |
- | METAMODSEARCH_DIRECTORY | + | |
- | METAMODUPLOAD_DIRECTORY | + | |
- | METAMODQUEST_DIRECTORY | + | |
- | METAMODHARVEST_DIRECTORY | + | |
- | + | ||
- | If any of these variables are missing, the corresponding modules will not be part | + | |
- | of the application. | + | |
- | + | ||
- | Each application delivering data to a database (an application with the | + | |
- | METAMODUPLOAD and/or the METAMODQUEST module) must have a short acronym | + | |
- | that uniquely identify the application for the database. This acronym is | + | |
- | included in the master_config.txt file as the value of variable APPLICATION_ID. | + | |
- | + | ||
- | ===== Installation ===== | + | |
- | + | ||
- | To install an application, | + | |
- | METAMOD 2.x directory) should be run with one argument: | + | |
- | + | ||
- | | + | |
- | + | ||
- | The argument is the absolute or relative path of the application directory, the | + | |
- | directory containing the master_config.txt file for the application. | + | |
- | + | ||
- | For each module selected by the configuration file, there is a **'' | + | |
- | of files in the corresponding module directory. The installation script will copy | + | |
- | all the files in these lists to the target directory tree (given by | + | |
- | TARGET_DIRECTORY in the configuration file). In the same way, files in the | + | |
- | application specific '' | + | |
- | will be copied to the target directory tree. If any file name collision occur | + | |
- | between the module file lists and the application file list, the file in the | + | |
- | application file list is used. Thus, it is possible to substitute any file | + | |
- | in any module with an application specific file, although this mechanism is | + | |
- | primarily meant for image files, style sheets etc. Name collisions between files | + | |
- | from different modules are supposed not to occur. | + | |
- | + | ||
- | While copying the files, the script will perform all substitutions prescribed | + | |
- | in the configuration file. The script will only copy files that are | + | |
- | modified later than the corresponding target files (or the target file does not | + | |
- | exist). Directories will be created as needed. | + | |
- | + | ||
- | Some files (e.g. binary files like image files etc.) are not intended for this | + | |
- | kind of modification. To avoid substitution on such files, the file names must | + | |
- | be prepended with ' | + | |
- | + | ||
- | The file pathes in each '' | + | |
- | corresponding top module directory (or the application directory). The copied | + | |
- | files will keep these relative pathes on the the target directory. | + | |
- | + | ||
- | **Multiple target files** | + | |
- | + | ||
- | It is possible to use the configuration file to produce several target files | + | |
- | from a single source file. This is done using the special directives: | + | |
- | + | ||
- | !substitute_to_file_with_new_name sourcefilepath => targetfilepath | + | |
- | !end_substitute_to_file_with_new_name | + | |
- | + | ||
- | The ' | + | |
- | '' | + | |
- | but it is not required to exist in any '' | + | |
- | (given by ' | + | |
- | (given by ' | + | |
- | the configuration file. In addition to these substitutions, | + | |
- | directive between the ' | + | |
- | corresponding ' | + | |
- | performed. Note that these substitution directives will not affect any of the | + | |
- | other files produced by the installation script. | + | |
- | + | ||
- | By using these special directives several times for the same source file, | + | |
- | and varying the target file name between each use, several target files are | + | |
- | produced from the same source file, and they will have different content | + | |
- | depending on the in-between substitution directives found for each target | + | |
- | file. | + | |
+ | See [[test]]. |