Tags
  1. composer apache2 mariadb-server mariadb-client php libapache2-mod-php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-intl php-mbstring php-curl php-xml php-pear php-tidy php-soap php-bcmath php-xmlrpc
  2. adduser drupal
  3. usermod -aG www-data drupal

Create New Site

  1. nginx-drupal-proxy 
  2. SITEDOMAIN=
  3. vim /etc/apache2/sites-available/$SITEDOMAIN.conf
  4. a2ensite $SITEDOMAIN.conf
  5. systemctl reload apache2
  6. su drupal
  7. https://www.drupal.org/project/drupal/releases/10.0.0 
  8. composer create-project drupal/recommended-project:^10 DIRNAME
  9. cd DIRNAME
  10. mkdir web/sites/default/files
  11. chmod 777 web/sites/default/files
  12. cp web/sites/default/default.settings.php web/sites/default/settings.php
  13. cp web/sites/example.sites.php web/sites/sites.php
  14. mkdir -p web/sites/$SITEDOMAIN/files
  15. cp web/sites/default/default.settings.php web/sites/$SITEDOMAIN/settings.php
  16. chmod 777 web/sites/$SITEDOMAIN/files 
  17. chmod 777 web/sites/$SITEDOMAIN/settings.php
  18. chmod 755 web/sites/$SITEDOMAIN/settings.php

Create DataBase 

  1. mysql -u root -p
  2. CREATE DATABASE DBNAME
  3. CREATE USER 'USER'@'localhost' IDENTIFIED BY 'PW';
  4. GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON DB.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';

settings.php

Backslash vor punkt!
$settings['trusted_host_patterns'] = [
  'wiki\.bubuit\.net$',
];
reverse proxy
$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);

Symfony

$settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED;

Setting the MySQL transaction isolation level

to the database connection array

'init_commands' => [
'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
 ],

Private file system settings

$settings['file_private_path'] = $app_root . '/../private';

Errors

In case that your test of the private file system path failed and that you get the following errors:
Not fully protected
See https://www.drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the private:// directory to help protect against arbitrary code execution.
Your private:// stream is not configured.
These errors are triggered because your private directory was not created prior to setting the variable $settings['file_private_path']. 

To resolve this issue:

  • Run cron from Configuration > Cron.
  • Clear your cache from Configuration > Performance.

private/.htaccess

# Turn off all options we don't need.
Options None
Options +FollowSymLinks
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
 # Override the handler again if we're run later in the evaluation list.
 SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
# Deny all requests from Apache 2.4+.
 Require all denied
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
 # Override the handler again if we're run later in the evaluation list.
 SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
# If we know how to do it safely, disable the PHP engine entirely.
 php_flag engine off

Restore DB Backup

ll /var/backups/automysqlbackup/daily/
extract /var/backups/automysqlbackup/daily/DBNAME/DBNAME_2023-01-24_06h25m.Tuesday.sql.bz2
mysql -u root -p DBNAME < /var/backups/automysqlbackup/daily/DBNAME/DBNAME_2023-01-24_06h25m.Tuesday.sql