Installation on Ubuntu/Debian

Mapbender is shipped with a preconfigured SQLite database which includes preconfigured applications (the database is located under <mapbender>/app/db/demo.sqlite).

Hint

For productive use PostgreSQL is recommended. You can find the neccessary configuration steps in chapter Optional > Mapbender Deployment on PostgreSQL.

Requirements

  • PHP >= 7.4

  • Apache installation with the following modules activated:

    • mod_rewrite

    • libapache2-mod-php

Nginx can also be used as web server (this will not be discussed in detail here).

Preparation

Installation of mandatory PHP extensions:

sudo apt install php-gd php-curl php-cli php-xml php-sqlite3 sqlite3 php-apcu php-intl openssl php-zip php-mbstring php-bz2
  • Please check the Mapbender FAQ page for further PHP settings: FAQ.

Unpack and register to web server

Download the current Mapbender version and unzip it into /var/www/mapbender or a different location:

wget https://mapbender.org/builds/mapbender-starter-current.tar.gz -O /var/www/mapbender-starter-current.tar.gz
tar -zxf /var/www/mapbender-starter-current.tar.gz -C /var/www
mv $(ls -d /var/www/*/ | grep mapbender) /var/www/mapbender/

Configuration Apache 2.4

Create the file /etc/apache2/sites-available/mapbender.conf with the following content:

Alias /mapbender /var/www/mapbender/web/
<Directory /var/www/mapbender/web/>
 Options MultiViews FollowSymLinks
 DirectoryIndex app.php
 Require all granted

 RewriteEngine On
 RewriteBase /mapbender/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ app.php [QSA,L]
</Directory>

Activate the site and reload Apache:

a2ensite mapbender.conf
service apache2 reload

Directory rights

sudo chown -R :www-data /var/www/mapbender

sudo chmod -R ug+w /var/www/mapbender/app/logs
sudo chmod -R ug+w /var/www/mapbender/app/cache
sudo chmod -R ug+w /var/www/mapbender/web/uploads

sudo chmod -R ug+w /var/www/mapbender/app/db/demo.sqlite

First steps

The Mapbender installation can now be accessed under http://[hostname]/mapbender/. User data by default:

username: “root”, password: “root”

Troubleshooting is available via the following command (must be executed in the application directory):

app/console mapbender:config:check

Hint

Please note that config:check will use the php-cli version. The settings may be different from your webserver PHP settings. Please use php -r ‘phpinfo();’ to show your PHP webserver settings.

Congratulations! Mapbender is now set up correctly and ready for further configuration. Find Information about the first steps with Mapbender: Mapbender Quickstart Document.

Optional

LDAP

To use the optional LDAP-connection, following PHP-LDAP-extension is required:

sudo apt install php-ldap

Mapbender installation with PostgreSQL

Configuration of PostgreSQL database for productive use:

Requirements: - configured PostgreSQL database - database for Mapbender configuration - PostgreSQl database user to access the database with create database right

Installation PHP-PostgreSQL driver

sudo apt install php-pgsql

Configuration of database connection (app/config/parameters.yml):

database_driver:   pdo_pgsql
database_host:     localhost
database_port:     5432
database_name:     mapbender
database_path:     ~
database_user:     postgres
database_password: secret

For further information: YAML Configuration (Configuration and Application files).

Initialisation of the database connection:

cd /var/www/mapbender
app/console doctrine:database:create
app/console doctrine:schema:create
app/console mapbender:database:init -v
bin/composer run reimport-example-apps

Create root user for access:

app/console fom:user:resetroot

Find further information in Details of the configuration of Mapbender

Mapbender installation with MySQL:

Similar to configuration with PostgreSQL.

Installation MySQL driver:

apt install php-mysql

Following parameters (parameters.yml) need to be adapted:

database_driver:   pdo_mysql
database_port:     3306

To initialize your database connection, see PostgreSQL.