Read the description in the Mapbender Wiki http://www.mapbender.org/index.php/Installation To update a running Mapbender Installation have a look at: http://www.mapbender.org/Update_Mapbender Every Mapbender User is invited to let the Mapbender Wiki grow. If you want an account to edit any of these Wiki pages please write an email to info@mapbender.org and request for an ID and password. You need a valid email address to be able to edit this Wiki. ---- -- Prerequisite ---- To be able to install and operate your own copy of Mapbender you need: * Webserver (Apache, MS IIS) * an installation of PHP (scripting language, version > 5.1.x) * Database (PostgreSQL >7.3 or MySQL > 4k) The following instructions only describe the configuration process for these packages, please follow the installation instructions for your operating system individually as the paths to files will vary on your systems. ---- -- 1. Download of the package ---- Download the newest Mapbender OSGeo installation package. For further details see Download Mapbender. Extracting the package Mapbender consists of multiple PHP-files in different directories which can be downloaded in one ZIP-file. To extract the ZIP-file you will need archiving software like unzip (commandline) or FileZip (Windows). Directories After downloading and unpacking Mapbender you find the following directories: * conf - directory for the configuration file mapbender.conf * core * documents * http - directory for the application. Within this directory the modules are sorted by type in subdirectories. Some modules are pure JavaScript applications, even though they have .php as suffix. * lib * license - license information files * log - logfiles will be saved here * owsproxy * resource - directory for the SQL-Dump to build up the Mapbender database or update the database; also contains translation files ---- -- 2. Internationalisation ---- * Set USE_I18N to true in mapbender.conf. define("USE_I18N", true); * Define default language define("LANGUAGE", "en"); // "en", "de", "bg", "gr", "nl", "it", es" * Compile the .po files into .mo files via msgfmt, see http://www.mapbender.org/gettext. msgfmt resources/locale/bg_BG/LC_MESSAGES/Mapbender.po -o resources/locale/bg_BG/LC_MESSAGES/Mapbender.mo msgfmt resources/locale/de_DE/LC_MESSAGES/Mapbender.po -o resources/locale/de_DE/LC_MESSAGES/Mapbender.mo msgfmt resources/locale/fr_FR/LC_MESSAGES/Mapbender.po -o resources/locale/fr_FR/LC_MESSAGES/Mapbender.mo msgfmt resources/locale/el_GR/LC_MESSAGES/Mapbender.po -o resources/locale/el_GR/LC_MESSAGES/Mapbender.mo msgfmt resources/locale/it_IT/LC_MESSAGES/Mapbender.po -o resources/locale/it_IT/LC_MESSAGES/Mapbender.mo ---- -- 3. Apache virtual directory ---- After installation create a virtual directory. Edit /etc/apache/httpd.conf (path varies, for apache2 /etc/apache2/sites-available/default): Alias /mapbender /path/to/mapbender2/http/ Options MultiViews DirectoryIndex index.php Order allow,deny Allow from all For example using Ubuntu edit: /etc/apache2/sites-available/default Alias /mapbender /var/www/apache2-default/mapbender_2.4.3/http/ Options MultiViews DirectoryIndex index.php Order allow,deny Allow from all You must reload (or stop and restart) the Apache program after making changes to the configuration file to make them take effect. If you want to enable directory browsing, e.g. for debugging purposes add Indexes to the Options line. ---- -- 4. Apache output compression ---- For optimal performance, enable output compression of your web server. Here's an instruction for Apache (see http://httpd.apache.org/docs/2.0/mod/mod_deflate.html for more details). Just append the content in bold to your Directory settings Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48 # the above regex won't work. You can use the following # workaround to get the desired effect: BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary Make sure you have loaded the required modules (for example, Ubuntu and Apache2) * a2enmod deflate * a2enmod headers For Windows and Apache2, you have to activate the modules at httpd.conf. * LoadModule deflate_module modules/mod_deflate.so * LoadModule headers_module modules/mod_headers.so Mapbender will load almost twice as fast! ---- -- 5. PHP Configuration ---- You might have to make some adjustments to the file php.ini. Changes in the php.ini also become operative only after restarting the Apache web server ! 1. During the test and installation phase of Mapbender it can be helpful to display error messages. To see error messages displayed configure the file php.ini as follows: error_reporting = E_ALL & ~E_NOTICE display_errors = On 2. After testing and installing, error messages should not be displayed anymore, turn this setting off again: display_errors = Off 3. Check the following details in php.ini allow_url_fopen parameter: extension_dir = (path to extensions-directory) allow_url_fopen = On 4. Mapbender manages access authorization in SESSIONS. Check the following details: session.save_handler = files session.save_path = (Path to SESSIONS-Directory). (Check authorisation!) 5. Further details of session management should be customized according to server load (see 'garbage collection' in php.ini) 6. With regard to other modules the extension gd2 should be included in the installation and configuration process. extension=php_gd2.dll (Windows) extension=gd.so (Linux) On a Debian-System you find this lib in /usr/lib/libgd.so. If it is not installed zou can do that using the command (or use Synaptic Packet Manager or similar): # apt.get install lbgd2-dev 7. For some Mapbender modules access to a PostgreSQL database is required. If these modules should be used, you have to check the availability of the required extension in the php.ini file: extension=php_pgsql.dll (Windows) extension=pgsql.so (Linux) 8. from Mapbender 2.5 on we need gettext and mbstring extension=php_gettext.dll (Windows) extension=php_mbstring.dll (Windows) Furthermore check, whether the database information in ./conf/mapbender.conf is correct. ---- -- 6. Database: ---- (NOTE: If want to save time, use the new shell script at resources/db/install.sh BEWARE! THIS SHELL SCRIPT IS NOT STABLE! USE AT YOUR OWN RISK!) -- -- MySQL -- -- -- Create a Database: -- select the encoding to run your databse: UTF8 or Latin is possible (choose in the mapbender.conf) -- To Show the possible character sets: SHOW CHARACTER SET; SHOW COLLATION; SHOW databases; -- database with utf8 encoding CREATE DATABASE mapbender CHARACTER SET utf8 COLLATE utf8_general_ci ; -- database with ISO-8859-1 encoding CREATE DATABASE mapbender CHARACTER SET latin1 COLLATE latin1_german1_ci ; -- select the database mapbender use mapbender -- special: update the mb_user_password to md5 for an existing Mapbender installation that used password()-encryption in the file mapbender/frames/login.php there is a variable $setEncPw. Set $setEncPw = true to transform the password to md5 when the user logged in with the right password. This helps you to transform the passwords step by step from password() to md5(). --If you want to run Mapbender with MySQL load the following files: 1. mysql_schema_.sql (creates tables, keys, constraints) 2. mysql_data_.sql (loads data) -- run the scripts as follow: source mysql_schema_.sql source mysql_data_.sql (make sure, that you use the right sql for the right encoding) -- Load the update SQL to update from 2.5 to 2.5.1 source update/update_2.5_to_2.5.1rc1__.sql -- -- PostgreSQL -- -- -- Create a Database with Latin1 or UTF8 encoding CREATE DATABASE mapbender ENCODING = 'UTF8'; or CREATE DATABASE mapbender ENCODING = 'LATIN1'; If you want to run Mapbender with PostgreSQL load the following files: 1. pgsql_schema_.sql (creates tables, keys, constraints) 2. pgsql_data_.sql (loads data) 3. pgsql_serial_set_sequences_7x_.sql or pgsql_serial_set_sequences_.sql (depending on wich postgresql version you use, sets the values for the sequences) - Zaehlerstand der Sequenz fuer Serial-Felder (Autowerte) -- How to load the sqls in PostgreSQL: psql -f pgsql_schema_.sql psql -f pgsql_data_.sql psql -f pgsql_serial_set_sequences_.sql -- Load the update SQL to update from 2.5 to 2.5.1 psql -f update/update_2.5_to_2.5.1rc1__.sql ---- -- 7. mapbender configuration ---- The Mapbender Configuration File is found in the directory "conf". Here you find the file mapbender.conf-dist. Rename the file to mapbender.conf. You won't loose your configuration at the next update of Mapbender. -- check the database connection http://localhost/tools/mapbender_setup.php ---- -- 8. print configuration ---- to use the pdfprint configure the files: mapbender\http\print\printPDF.conf (if you use the print in an iframe) mapbender\http\print\printPDF_b.conf (if you use the print with a button - b for button) In Linux : change the permission of tmp folder to 777 $ chmod -R 777 log ---- -- 9. Change the Permission of log Folder ---- In Linux : change the permission of log folder to 777 so that php script can write logs in it. $ chmod -R 777 log --- -- 10. Checking the Setup --- The script moved to tools directory: http://localhost/mapbender/tools/mapbender_setup.php mapbender_setup.php tests the data connections. If you use PostgreSQL it checks if PostGIS and MD5 are available. Further more you have to check the settings in pg_hba.conf (e.g. you have to set ident sameUser to trust). After the installation - first Login For login you can use the user account with username root and the inital password root. Make sure to change this password asap in order to secure your Mapbender installation. --- -- 11. OWSPROXY --- Create an ALIAS for owsproxy: Alias /owsproxy/ "/data/mapbender/owsproxy/" AllowOverride None Order Deny,Allow Allow from all URL to owsproxy (no terminating slash) define("OWSPROXY", "http:///owsproxy"); Apache configuration: RedirectMatch ^.*owsproxy.([^i][\w\d]+)\/([\w\d]+)\/?$ http:///owsproxy/http/index.php?sid=$1\&wms=$2\& Replace with the owsproxy URL.