Following we describe the configuration steps of Mapbender3 a bit further. Configuring your Mapbender3 installation is made up of the following six steps:
All can be done using the console utility provided by Symfony2, on which 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.
Notice: The following steps assume that you are in the directory above the app directory (notice that for git installation that means mapbender3/application/ else mapbender3/).
cd mapbender3/
or for git based installation
cd mapbender3/application
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: secret
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
Symfony2 will create the database schema for you:
app/console doctrine:schema:create
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
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 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 into a database occurs using the command:
app/console doctrine:fixtures:load --fixtures=./mapbender/src/Mapbender/CoreBundle/DataFixtures/ORM/Application/ --append
The basic configuration is done inside the app/config/parameters.yml file. A template is provided in the app/config/parameters.yml.dist file.
app/config/config.yml provides more parameters f.e. to configure portal functionality, owsproxy or provide an additional database.
Notice: You need a mailer for self-registration and reset password functionality.
Notice: You need a mailer for self-registration and reset password functionality (see parameters.yml).
If you use a proxy you have to add the proxy settings to config.yml at section ows_proxy3_core.
This is how the configiration could look like:
ows_proxy3_core:
logging: true
obfuscate_client_ip: true
proxy:
host: myproxy
port: 8080
connecttimeout: 60
timeout: 90
noproxy:
- 192.168.1.123
You can configure an applications on two ways. In the mapbender.yml file or with the browser in the Mapbender3 backend.
app/console doctrine:fixtures:load --fixtures=./mapbender/src/Mapbender/CoreBundle/DataFixtures/ORM/Application/ --append