installation summary General ------- Domain is lstwfd.se CMS is Drupal. Hosting provider is ODERLAND Webbhotell AB (oderland.se). User interfaces are Drupal web UI, Cpanel, ssh console. PHP dependencies and site install/update are managed using Composer. Other version control, if used, is git. The dbms is MariaDB. The database is lstwfdse_drupal. User interfaces are PhpMyAdmin and the ssh console. Site/Drupal maintenance performed using Composer, Drush, bash and Drupal tools/commands. When defining the docroot for the domain use a directory structure to accomodate a composer project. The directory structure must also accomodate the Drush tool's requirements. // e.g. /home/lstwfdse/lstwfdmain/lstwfd.se/ The installation will, among other things, create and populate the vendor directory at the same level as This is necessary for composer and Drush to work properly as well as for security. Confirm that the requirements are met for installing and running Drupal. run php --version and confirm that it is compatible with drupal and composer. Confirm that the necessary PHP extentions and options are enabled. run composer --version and confirm that it is compatible with drupal. run drush --version and confirm that it is compatible with drupal. Use PhpMyAdmin to check the database's compatibllity. (note, as an example, I had to disable the php extention mysqli) Prepare to use composer. cd to e.g. /home/lstwfdse/ Run composer --version to establish the hosting provider's version of composer. If a different version is desired, install composer into the following the instuctions as described at https://getcomposer.org/download/ The following describes using composer to install drupal and drush to form a basic system. note that php memory may need to be augmented. Preceed the composer command with COMPOSER_MEMORY_LIMIT=2560M (what ever amount you need). A new composer project can be created from an exsisting project using the create-project command. Drupal has created a project for this purpose. See https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies cd to / e.g. /home/lstwfdse/ run composer create-project --no-install drupal/recommended-project ie run composer create-project --no-install drupal/recommended-project bsitesub cd to ie bsitesub/ Edit composer.json replacing web with ie bsite.lstwfd.se run composer install and if advised run composer update to make drush available within the project run COMPOSER_MEMORY_LIMIT=2560M composer require drush/drush Have the database credentials available. run vendor/drush/drush/drush site:install Make a note of the admin credentials. Open the homepage log in and run the status report. Make adjustments as advised. Some drush commands: vendor/drush/drush/drush sset system.maintenance_mode 1 vendor/drush/drush/drush sset system.maintenance_mode 0 vendor/drush/drush/drush updatedb vendor/drush/drush/drush cr note following about file permissions for /default and its contents: dr-xr-xr-x default/ 555 -rw-rw-r-- default/default.services.yml 664 -rw-rw-r-- default/default.settings.php 664 drwxrwxr-x default/files/ 775 -r--r--r-- default/settings.php 444 -r--r--r-- default/files/.htaccess 444 Note that tar will not extract files to a directory that does not have write permission. (Sub-directories with their contents will be extracted provided their permissions allow.) In order to restore the files and folder the permissions should be changed dr-xr-xr-x default/ 555 to 755 -r--r--r-- default/settings.php 444 to 644 (not necessary as it turns out) backup the cd to ie /home/lstwfdse/ run the tar command: tar czf short_term_backups/bsite-install-`date "+%F-%H%M"`.tar.gz bsitesub backup the database run the mysqldump command: mysqldump --defaults-file="/home/lstwfdse/bsitemysqlopts" --opt --add-drop-table -u lstwfdse_bsite01 lstwfdse_bsite > short_term_backups/bsite-install-`date "+%F-%H%M"`.sql To restore the site run: vendor/drush/drush/drush sset system.maintenance_mode 1 chmod 755 bsitesub/bsite.lstwfd.se/sites/default tar xvf short_term_backups/bsite-install-2021-01-31-1936.tar.gz If necessary run chmod 555 bsitesub/bsite.lstwfd.se/sites/default Make sure that bsitesub/bsite.lstwfd.se/sites/default/settings.php is read-only, mode 444 mysql --defaults-file="/home/lstwfdse/bsitemysqlopts" -u lstwfdse_bsite01 lstwfdse_bsite < /home/lstwfdse/short_term_backups/bsite-install-2021-01-31-1935.sql run: vendor/drush/drush/drush updatedb vendor/drush/drush/drush cr vendor/drush/drush/drush sset system.maintenance_mode 0 Updating using composer: run composer outdated 'drupal/*' If there are updates available: COMPOSER_MEMORY_LIMIT=2560M composer update drupal/core 'drupal/core-*' --with-all-dependencies After that run: vendor/drush/drush/drush updatedb vendor/drush/drush/drush cr note: If you have separate dev/staging and production servers, ensure the updated composer.json and composer.lock files are on production and always run composer install --no-dev on production, rather than composer update. The --no-dev switch skips the installation of packages not intended for use on production sites. PATH=/usr/local/cpanel/3rdparty/lib/path-bin :/usr/local/cpanel/3rdparty/lib/path-bin :/usr/local/cpanel/3rdparty/lib/path-bin :/usr/local/bin :/usr/bin :/usr/local/sbin :/usr/sbin :/opt/cpanel/composer/bin :/usr/local/easy/bin :/home/lstwfdse/.local/bin :/home/lstwfdse/bin