Installation

This document describes all necessary steps in order to get a running Mapbender3 installation.

Prerequisites

Mapbender3 needs the following components in order to run:

  • PHP 5.3.10 or later (php5)
  • PHP CLI interpreter (php5-cli)
  • PHP SQLite extension (php5-sqlite)
  • PHP cURL extension (php5-curl)
  • PHP Alternative PHP Cache (php-apc)
  • PHP Internationalization (php5-intl)

Optionally, in order to use a database other than the preconfigured SQLite one, you need a matching PHP extension supported by Doctrine.

If you want to use the developer mode, for using the web installer or creating profiler data to be used to analyze errors you will still need the SQLite extension!

Download

Installation packages are distributed as compressed packages and are available for download at the download page.

After downloading, extract the package in a directory of your choice. Then make sure your Webserver points to the web directory inside the mapbender3 directory you just uncompressed. You will also need to make sure that the default directory index is app.php.

Example for ALIAS configuration for Apache in file /etc/apache2/conf.d/mapbender3

ALIAS /mapbender3 /var/www/mapbender3/web/
<Directory /var/www/mapbender3/web/>
  Options MultiViews
  DirectoryIndex app.php
  Order allow,deny
  Allow from all
</Directory>

A Git-based installation - mainly for developers - is also possible.

Configuration

Using the web installer

Configuration right inside your browser is not yet available. Please use the command line method below for now.

Using the command line

Configuring your Mapbender3 installation is made up of the following steps:

  • Creating the database
  • Creating the database schema
  • Copying the bundles’ assets to the public web directory
  • Initializing the role system
  • Creating the “root” user
  • Inserting srs parameters (EPSG code definition)

All can be done using the console utility provided by Symfony2, the Mapbender3 framework is built upon. There’s a mayor caveat though you should understand, before continuing:

The console utility will write files in the app/cache and app/logs
directories. These operations are made using the user permissions of
whatever user you’re logged in with. This is also true for the app/db
directory and the SQLite database within. When you open the application
from within the browser, the server PHP process will try to access/write
all these files with other permissions. So make sure you give the PHP
process write access to these files. See last step below.

The following steps assume that you are in the directory above the app directory (notice that for git installation that means mapbender-starter/application/ else mapbender-starter/).

Adapting the configuration file

Database connection parameters are stored together with some more configuration parameters in the file app/config/parameters.yml. This file is using YAML syntax, so be aware that you can not use tabs for indenting. Be careful about this and use whitespaces instead.

Your database configuration in the parameters.yml file could look like this when you use PostgreSQL:

database_driver:   pdo_pgsql
database_host:     localhost
database_port:     5432
database_name:     mapbender3
database_path:
database_user:     postgres
database_password: 1xyz45ab
Creating the database

Symfony2 can attempt to create your database, this works of course only if the configured database user is allowed to. Call the console utility like this:

app/console doctrine:database:create
Creating the database schema

Symfony2 will create the database schema for you:

app/console doctrine:schema:create

We also need to initialize the security system’s database tables separately:

app/console init:acl
Copying the bundles’ assets

Each bundle has it’s own assets - CSS files, JavaScript files, images and more - but these need to be copied into the public web folder:

app/console assets:install web

Alternatively, as a developer, you might want to use the symlink switch on that command to symlink instead of copy. This will make editing assets inside the bundle directories way easier.

app/console assets:install web --symlink --relative
Creating the administrative user

The first user - which has all privileges - must be created using the command:

app/console fom:user:resetroot

This will interactively ask all information needed and create the user in the database.

Alternatively, there is a silent mode you can use, if you want to use a script to install Mapbender3 and don’t want to be asked for all parameters:

app/console fom:user:resetroot --username="root" --password="root" --email="root@example.com" --silent
Inserting srs parameters

Inserting proj4 srs parameters into a database occurs using the command:

app/console doctrine:fixtures:load --fixtures=./mapbender/src/Mapbender/CoreBundle/DataFixtures/ORM/Epsg/ --append
Importing applications from mapbender.yml

Importing applications from mapbender.yml into a database occurs using the command:

app/console doctrine:fixtures:load --fixtures=./mapbender/src/Mapbender/CoreBundle/DataFixtures/ORM/Application/ --append
Write permission

You have to set write permission to app/cache and app/logs.

chmod -R o+w /var/www/mapbender3/app/cache
chmod -R o+w /var/www/mapbender3/app/logs
Check config.php

You can start using Mapbender3 now. You can open the developer mode when you run app_dev.php.

Notice: Click on the Mapbender3 logo to get to the login page. Log in with the new user you created.

Installation Example for Ubuntu

Install necessary components:

apt-get install php5 php5-pgsql php5-gd php5-curl php5-cli php5-sqlite sqlite php-apc php5-intl curl

Configure the Apache ALIAS in file /etc/apache2/conf.d/mapbender3 and restart your Apache server

ALIAS /mapbender3 /var/www/mapbender3/web/
<Directory /var/www/mapbender3/web/>
  Options MultiViews
  DirectoryIndex app.php
  Order allow,deny
  Allow from all
</Directory>

Check the ALIAS is working

Open Symfony´s Welcome Script config.php. This script checks whether all necessary components are installed and configurations are done. If there are still problems, you should fix them.

../../_images/mapbender3_symfony_check_configphp.png

Set owner, group and rights

chmod -R uga+r /var/www/mapbender3
chown -R www-data:www-data /var/www/mapbender3

Adapt the configuration file parameters.yml (app/config/parameters.yml) and define the database you want to create.

database_driver:   pdo_pgsql
database_host:     localhost
database_port:     5432
database_name:     mapbender3
database_path:
database_user:     postgres
database_password: 1xyz45ab

Run the app/console commands

cd /var/www/mapbender3
app/console doctrine:database:create
app/console doctrine:schema:create
app/console init:acl
app/console assets:install web
app/console fom:user:resetroot
app/console doctrine:fixtures:load  --append

Installation of Mapbender3 is done.

Check config.php

You have to set write permission to app/cache and app/logs

chmod -R o+w /var/www/mapbender3/app/cache
chmod -R o+w /var/www/mapbender3/app/logs

You can start using Mapbender3 now. You can open the developer mode when you run app_dev.php.

Notice: Click on the Mapbender3 logo to get to the login page. Log in with the new user you created.

To learn more about Mapbender3 have a look at the Mapbender3 Quickstart.

Installation Example for Windows

Install necessary components:

  • add the path to your PHP-bin directory to the PATH variable
  • activate the PHP extensions in your php.ini configuration file
extension=php_curl.dll
extension=php_gd2.dll
extension=php_intl.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll

Configure the Apache ALIAS and restart your Apache server

ALIAS /mapbender3 c:/mapbender3/web/
<Directory c:/mapbender3/web/>
  Options MultiViews
  DirectoryIndex app.php
  Order allow,deny
  Allow from all
</Directory>

Check the ALIAS is working

Open Symfony´s Welcome Script config.php. This script checks whether all necessary components are installed and configurations are done. If there are still problems, you should fix them.

../../_images/mapbender3_symfony_check_configphp.png

Adapt the configuration file parameters.yml (app/config/parameters.yml) and define the database you want to create.

database_driver:   pdo_pgsql
database_host:     localhost
database_port:     5432
database_name:     mapbender3
database_path:
database_user:     postgres
database_password: 1xyz45ab

Run the app/console commands with php. First you have to open a terminal (cmd).

cd c:/mapbender3
php.exe app/console doctrine:database:create
php.exe app/console doctrine:schema:create
php.exe app/console init:acl
php.exe app/console assets:install web
php.exe app/console fom:user:resetroot
php.exe app/console doctrine:fixtures:load  --append

Installation of Mapbender3 is done.

Check config.php

You can start using Mapbender3 now. You can open the developer mode when you run app_dev.php.

Notice: Click on the Mapbender3 logo to get to the login page. Log in with the new user you created.

To learn more about Mapbender3 have a look at the Mapbender3 Quickstart.