Ready-made configuration snippets
In some cases, it is helpful or even required for proper website operation to adapt your web application’s configuration to the freistilbox hosting environment. To simplify setting up this configuration, freistilbox provides you with CMS-specific configuration snippets that you should integrate into your own application settings.
Since these configuration snippets are stored in a subdirectory named config
on the same level as the docroot directory of your web application, you
simply include these snippets in your application configuration file using a
relative path like this:
require_once('../config/«CMS»/«CONFIGFILE»');
Which configuration files are available for which CMS is laid out in detail below.
If you insert the require_once statement at the beginning of your
configuration file, you risk that its settings get overridden further down in
your configuration file, which can lead to unexpected behaviour. That’s why we
recommend appending the require_once at the end of your configuration file.
Drupal configuration
Drupal-specific configuration snippets are stored in the directory
../config/drupal/.
The following configuration files are available. In their file names, replace
«version» with a shortcut for the Drupal version the website uses.
freistilbox supports the shortcuts “d6”, “d7” and “d8”.
settings-«version»-site.php– General website settings, for examplereverse_proxy_addresses, Twig cache directory, and website variablessettings-«version»-dbXXX.php– Database configuration. ReplacedbXXXwith the database name as listed on the freistilbox Dashboard.settings-«version»-memcache.php– Memcached configuration. See “How do I enable memcached?” for details.
There is also a settings-«version»-site-beta.php that extends the site
snippet with settings we make available ahead of global release.
The minimum configuration for running a Drupal website on freistilbox consists
of the settings-...-site.php and settings-...-dbXXX.php snippets. The
following example shows how to include them in a Drupal 8 website that is
connected to database db123.
<?php
// Drupal 8 settings.php
...
// Include configuration snippets at the end
require_once('../config/drupal/settings-d8-site.php');
require_once('../config/drupal/settings-d8-db123.php');
?>
Please note that the admin interface of your web application will not reflect settings from these include files. If you need to check the actual configuration values, take a look at the snippet files themselves or use Drush.
WordPress configuration
WordPress-specific configuration snippets are stored in the directory
../config/wordpress/.
The following configuration files are available:
settings-wp-site.php– General website settings, including website variablessettings-wp-dbXXX.php– Database configuration. ReplacedbXXXwith the database name as listed on the freistilbox Dashboard.
The database configuration snippet provides the WordPress database connection
constants (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST) for your website.
To use the configuration snippet, include it in your wp-config.php file:
<?php
// WordPress wp-config.php
...
// Include configuration snippets
require_once('../config/wordpress/settings-wp-site.php');
require_once('../config/wordpress/settings-wp-db123.php');
?>
Replace db123 with your actual database name.
Make sure to include the configuration snippet before the line that says
/* That's all, stop editing! Happy publishing. */ in your wp-config.php file.
Website variables
Website variables are values you configure in the freistilbox Dashboard for
use by your application. The generic site snippets listed above define the
$freistilbox_website_variables PHP array, so you do not need to add a second
include file. For Drupal, include settings-«version»-site.php or its -beta
variant. For WordPress, include settings-wp-site.php.
The array is always defined. If you have not configured any website variables, it is empty. You can use a variable in your application configuration like this:
$site_mode = $freistilbox_website_variables['SITE_MODE'] ?? 'production';
Managing variables in the Dashboard
You can add variables to a whole cluster or to one website. You need permission to configure the website to manage website variables. Cluster variables require permission to configure the cluster or customer account.
Cluster variables
Open the cluster in the Dashboard and find the Cluster variables section. Cluster variables apply to every website on the cluster unless a website has a local override. Select Add variable, enter a name and value, then choose either Plain or Secret.
Variable names use uppercase letters, numbers, and underscores. Names and types cannot be changed after creation. Leading and trailing whitespace in a value is preserved. For a plain variable, select Edit variable to change its value. Secret values are masked while you enter them and cannot be revealed or edited after saving. To rotate a secret, delete it and create it again.
If a website already has a website-specific variable with the same name, the Dashboard warns that it will continue to override the cluster value. To remove a cluster variable, select Delete variable. The confirmation page shows how many websites will change because they inherit the value and how many will stay unchanged because they have a local variable with the same name.
Website variables
Open the website in the Dashboard and find the Website variables section. It shows the effective values for that website and labels each source as Cluster, Override, or Local. A Cluster variable is inherited. An Override is a website-specific replacement for an inherited value. A Local variable exists only on that website.
Select Add variable to create a local website variable. To replace an inherited value for only this website, select Override inherited variable. The Dashboard keeps the inherited variable’s name and type, then asks you for the replacement value. Inherited cluster variables cannot be edited or deleted from the website page.
Deleting an Override removes only the website-specific value, so the inherited cluster value becomes effective again. Deleting a Local variable removes it from that website. Website variables use the same Plain and Secret rules as cluster variables.
Website variables are not operating-system environment variables.