Week 3 - Configuration Drupal 8 - Fresh Install
There are a few things that are required to be done in order to follow the best practices within a Drupal 8 site in regards to setting up added security and configuration directories. Below are two items that I performed that allowed me to have a status report with no errors.
- Secure the Trusted Host Settings - https://www.drupal.org/docs/8/install/trusted-host-settings
Example of trusted host configuration setting:
$settings['trusted_host_patterns'] = array(
- Configuration Directories – settings.php file must define the $config_directories variable as an array containing the names of directories in which configuration files can be found. It must contain a sync key. I’ve used the following resources to get this setup:
I have decided to create a secondary repository for my project. This repository is called ‘sitenameConfigBackup’ in which I plan to use it as a dumping ground for configuration files and backups of the database. In reading the articles above I’ve found that this does have to be a separate location as the configuration files and backups should not exist anywhere in the root folder of the website where the Drupal files exists. (Unless you know how to securely lock it down then its best to move the file away from access by the webserver) For me it would be easier to train future me's in having things separate then training someone how to write apache configuration settings to prevent directories from being served by the web server when files exist inside the sites root directory.
Example of Configuration Setting
$config_directories[CONFIG_SYNC_DIRECTORY] = '../private-files/config/site/';
Another task was to figure out how to install community modules and how to update the Drupal core. I was a drush guy in Drupal 7 so I had to pillage this handy table for having a cheat sheet of composer commands  that reflected my previous experience. I hope at some point I'll not have to come back to this table:
|Installing a contrib project (latest version)||
|Installing a contrib project (specific version)||
|Updating all contrib projects and Drupal core||
|Updating a single contrib project||
|Updating Drupal core||