Installation on Ubuntu/Debian¶
Mapbender is shipped with a preconfigured SQLite database which includes preconfigured applications (the database is located under <mapbender>/var/db/demo.sqlite). You can find instructions for a test installation based on the Symfony web server at Launching Mapbender using the local Symfony web server.
Hint
PostgreSQL is strongly recommended for productive use. Look up the neccessary configurational steps in the chapter Optional > Mapbender Deployment on PostgreSQL.
Requirements¶
PHP >= 8.1
- Apache installation with the following modules activated:
mod_rewrite
libapache2-mod-php
- PostgreSQL Installation
It is recommended to use a PostgreSQL database for Mapbender.
It is recommended to create a database user to access the Mapbender database.
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 FAQ - Frequently Asked Questions for further PHP settings.
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/public/
<Directory /var/www/mapbender/public/>
Options MultiViews FollowSymLinks
Require all granted
RewriteEngine On
RewriteBase /mapbender/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.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/var/log
sudo chmod -R ug+w /var/www/mapbender/var/cache
sudo chmod -R ug+w /var/www/mapbender/public/uploads
sudo chmod -R ug+w /var/www/mapbender/var/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):
bin/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 in the Mapbender Quickstart.
Optional¶
LDAP¶
To use the optional LDAP-connection, following PHP-LDAP-extension is required:
sudo apt install php-ldap
Note
To use LDAP, the LDAP-Bundle must be integrated into Mapbender. Further setup instructions can be found in the Bundle’s README.md on GitHub.
Mapbender installation with PostgreSQL¶
Configuration of PostgreSQL database for productive use:
Requirements:
Installation of PostgreSQL
database for the Mapbender configuration
PostgreSQl database user to access the database (optional)
Installation PHP-PostgreSQL driver
sudo apt install php-pgsql php_pdo_pgsql
Configuration of database connection is done by a variable that contains the entire connection string. Configure it by adding it in your .env.local file.
MAPBENDER_DATABASE_URL="postgresql://dbuser:dbpassword@localhost:5432/dbname?serverVersion=17&charset=utf8"
For further information: YAML Configuration (Configuration and Application files).
Create Mapbender database if it does not exist already:
cd /var/www/mapbender
bin/console doctrine:database:create
Create mapbender table structure and load example applications
cd /var/www/mapbender
bin/console doctrine:schema:create
bin/console mapbender:database:init -v
bin/composer run reimport-example-apps
Create root user for access:
bin/console fom:user:resetroot
Find further information in Details of the configuration of Mapbender.