Skip to content

Instantly share code, notes, and snippets.

@centminmod
Last active May 18, 2022 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save centminmod/813027b2a397c37b40fc91c62efef5a8 to your computer and use it in GitHub Desktop.
Save centminmod/813027b2a397c37b40fc91c62efef5a8 to your computer and use it in GitHub Desktop.
Drupal 9 Centmin Mod install in /public

Disclaimer: I have no practial experience with Drupal so the below instructions all based on doing readings below which was less than 1hr worth. The instructions serve as starting point for setup of Drupal on Centmin Mod Nginx where Nginx web root defaults to public/. Following this guide will install Drupal 9.x to web root at /home/nginx/domains/drupal.domain.com/public rather than Drupal 9.x's composer installed defaults which may end up in incorrect locations like at /home/nginx/domains/drupal.domain.com/yourprojectsite/web or /home/nginx/domains/drupal.domain.com/public/yourprojectsite/web.

Centmin Mod based install for Drupal 9.x with Nginx and changing web root from web/ to public/. These instructions are provided as is without any support. To discuss this or provide feedback, suggestions or corrections, post them on forums at https://community.centminmod.com/forums/blogs-cms-usage.33/?prefix_id=56

# modified Drupal install as per instructiosn at
# https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies#s-to-do-a-modified-install

# ensure letsencrypt is enabled
# if variable LETSENCRYPT_DETECT='y' is not setup
# in persistent config file yet, run these 2 commands
touch /etc/centminmod/custom_config.inc
echo "LETSENCRYPT_DETECT='y'" >> /etc/centminmod/custom_config.inc

# create nginx vhost domain with config file
# /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf
# web root
# /home/nginx/domains/drupal.domain.com/public
# where my_pass is your desired Pure-ftpd FTP virtual username
# nv command line will auto generate an associated Pure-ftp FTP user password
# -s lelived, means install Letsencrypt SSL certificate with HTTPS default
# before running nv command, ensure your domain has valid DNS A records pointing
# to server IP for Letsencrypt domain validation
# if behind Cloudflare, use CF DNS API method setup outlined
# at https://centminmod.com/letsencrypt-freessl.html#dns
# before running nv command
nv -d drupal.domain.com -s lelived -u my_pass

# install composer
# https://getcomposer.org/download/
wget https://getcomposer.org/download/latest-stable/composer.phar -O /usr/bin/composer
chmod +x /usr/bin/composer

# install drupal in temporary directory
# at /home/nginx/domains/drupal.domain.com-files
# files will be later copied to /home/nginx/domains/drupal.domain.com
cd /home/nginx/domains/
echo y | composer create-project --no-install drupal/recommended-project drupal.domain.com-files

# backup composer.json as composer.json-orig
cp -a /home/nginx/domains/drupal.domain.com-files/composer.json /home/nginx/domains/drupal.domain.com-files/composer.json-orig

# modify web/ to public/ web root in composer.json
sed -i 's|web\/|public\/|g' /home/nginx/domains/drupal.domain.com-files/composer.json

# check modified composer.json compared to composer.json-orig backup
diff -u /home/nginx/domains/drupal.domain.com-files/composer.json-orig /home/nginx/domains/drupal.domain.com-files/composer.json

# install drupal via composer install command from temp directory
# at /home/nginx/domains/drupal.domain.com-files
cd /home/nginx/domains/drupal.domain.com-files
echo y | composer install

# verify installed files in temp directory at
# /home/nginx/domains/drupal.domain.com-files
ls -lah /home/nginx/domains/drupal.domain.com-files
ls -lah /home/nginx/domains/drupal.domain.com-files/public/

# copy over drupal installed files from temp directory
# at /home/nginx/domains/drupal.domain.com-files
# to /home/nginx/domains/drupal.domain.com/
# so that drupal installation web root will be
# at /home/nginx/domains/drupal.domain.com/public
\cp -af /home/nginx/domains/drupal.domain.com-files/* /home/nginx/domains/drupal.domain.com/

# install drush via composer
cd /home/nginx/domains/drupal.domain.com/
echo y | composer require --dev drush/drush

# optionally remove temp directory copied files
# at /home/nginx/domains/drupal.domain.com-files
# or technically you maybe able to copy this and reuse
# it for other drupal installs?
cd /home/nginx/domains/drupal.domain.com-files
rm -rf /home/nginx/domains/drupal.domain.com-files

# move default index.html
mv /home/nginx/domains/drupal.domain.com/public/index.html /home/nginx/domains/drupal.domain.com/public/index.html-orig

# setup sites/default/settings.php
cp -a /home/nginx/domains/drupal.domain.com/public/sites/default/default.settings.php /home/nginx/domains/drupal.domain.com/public/sites/default/settings.php

# create /home/nginx/domains/drupal.domain.com/public/sites/default/files
mkdir -p /home/nginx/domains/drupal.domain.com/public/sites/default/files
chmod a+w /home/nginx/domains/drupal.domain.com/public/sites/default/files

# ensure all files & directories are owned by nginx user
chown -R nginx:nginx /home/nginx/domains/drupal.domain.com

# verify installed files in final location directories at
# /home/nginx/domains/drupal.domain.com
# /home/nginx/domains/drupal.domain.com/public

ls -lah /home/nginx/domains/drupal.domain.com
ls -lah /home/nginx/domains/drupal.domain.com/public

# create MySQL database using
# addons/mysqladmin_shell.sh
# replace with your desired
# database name = drupal_db1
# database user = drupal_user1
# database pass = drupal_pass1
/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb drupal_db1 drupal_user1 drupal_pass1

# then in web browser go install.php to complete installation
# http://drupal.domain.com/core/install.php

Add & configure in /home/nginx/domains/drupal.domain.com/public/sites/default/settings.php

$settings['trusted_host_patterns'] = [
  '^drupal\.domain\.com$',
];

Make a copy of /usr/local/nginx/conf/php.conf as /usr/local/nginx/conf/php-drupal.conf

cp -a /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php-drupal.conf

Then edit /usr/local/nginx/conf/php-drupal.conf top line

from

location ~ [^/]\.php(/|$) {

to

location ~ '\.php$|^/update.php' {

and edit

from

fastcgi_intercept_errors off;

to

fastcgi_intercept_errors on;

Then backup nginx vhost to /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf.bak

cp -a /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf.bak

Then modify /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf include file references for /usr/local/nginx/conf/php.conf and change to /usr/local/nginx/conf/php-drupal.conf

include /usr/local/nginx/conf/php-drupal.conf;

Drupal Nginx Config Settings

For /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf nginx vhost, modify it (do not replace it only modify) with relevant Drupal settings below

    location ~ \..*/.*\.php$ {
        return 403;
    }

    location ~ ^/sites/.*/private/ {
        return 403;
    }

    location / {
        include /usr/local/nginx/conf/503include-only.conf;
        try_files $uri /index.php?$query_string;
    }

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }

    # Fighting with Styles? This little gem is amazing.
    location ~ ^/sites/.*/files/styles/ {
        try_files $uri @rewrite;
    }

Modified /usr/local/nginx/conf/conf.d/drupal.domain.com.ssl.conf nginx vhost looks like below. Uncomment /usr/local/nginx/conf/cloudflare.conf include line if you are using Cloudflare in front of your Drupal site to restore real visitor IP addresses.

Do not copy and paste the entire Nginx vhost below as settings will be different for your domain and below SSL settings are for self-signed SSL certificate demo and not Letsencrypt issued SSL certificates. So only modify do not replace with above Drupal 9.x settings

# Centmin Mod Getting Started Guide
# must read https://centminmod.com/getstarted.html

# redirect from www to non-www  forced SSL
# uncomment, save file and restart Nginx to enable
# if unsure use return 302 before using return 301
server {
       listen   80;
       server_name drupal.domain.com;
       return 302 https://drupal.domain.com$request_uri;
}

server {
  listen 443 ssl http2;
  server_name drupal.domain.com www.drupal.domain.com;

  ssl_dhparam /usr/local/nginx/conf/ssl/drupal.domain.com/dhparam.pem;
  ssl_certificate      /usr/local/nginx/conf/ssl/drupal.domain.com/drupal.domain.com.crt;
  ssl_certificate_key  /usr/local/nginx/conf/ssl/drupal.domain.com/drupal.domain.com.key;
  include /usr/local/nginx/conf/ssl_include.conf;

  # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
  #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/drupal.domain.com/origin.crt;
  #ssl_verify_client on;
  
  
  
  # mozilla recommended
  ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
  ssl_prefer_server_ciphers   on;
  #add_header Alternate-Protocol  443:npn-spdy/3;

  # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
  #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
  #add_header X-Frame-Options SAMEORIGIN;
  add_header X-Xss-Protection "1; mode=block" always;
  add_header X-Content-Type-Options "nosniff" always;
  #add_header Referrer-Policy "strict-origin-when-cross-origin";
  #add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
  #spdy_headers_comp 5;
  ssl_buffer_size 1369;
  ssl_session_tickets on;
  
  # enable ocsp stapling
  #resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
  #resolver_timeout 10s;
  #ssl_stapling on;
  #ssl_stapling_verify on;
  #ssl_trusted_certificate /usr/local/nginx/conf/ssl/drupal.domain.com/drupal.domain.com-trusted.crt;  

# ngx_pagespeed & ngx_pagespeed handler
#include /usr/local/nginx/conf/pagespeed.conf;
#include /usr/local/nginx/conf/pagespeedhandler.conf;
#include /usr/local/nginx/conf/pagespeedstatslog.conf;

  # limit_conn limit_per_ip 16;
  # ssi  on;

  access_log /home/nginx/domains/drupal.domain.com/log/access.log combined buffer=256k flush=5m;
  error_log /home/nginx/domains/drupal.domain.com/log/error.log;

  include /usr/local/nginx/conf/autoprotect/drupal.domain.com/autoprotect-drupal.domain.com.conf;
  root /home/nginx/domains/drupal.domain.com/public;
  # uncomment cloudflare.conf include if using cloudflare for
  # server and/or vhost site
  #include /usr/local/nginx/conf/cloudflare.conf;
  include /usr/local/nginx/conf/503include-main.conf;

    location ~ \..*/.*\.php$ {
        return 403;
    }

    location ~ ^/sites/.*/private/ {
        return 403;
    }

    location / {
        include /usr/local/nginx/conf/503include-only.conf;
        try_files $uri /index.php?$query_string;
    }

    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }

    # Fighting with Styles? This little gem is amazing.
    location ~ ^/sites/.*/files/styles/ {
        try_files $uri @rewrite;
    }

  include /usr/local/nginx/conf/php-drupal.conf;
  include /usr/local/nginx/conf/pre-staticfiles-local-drupal.domain.com.conf;
  include /usr/local/nginx/conf/pre-staticfiles-global.conf;
  include /usr/local/nginx/conf/staticfiles.conf;
  include /usr/local/nginx/conf/drop.conf;
  #include /usr/local/nginx/conf/errorpage.conf;
  include /usr/local/nginx/conf/vts_server.conf;
}

worklog example outputs

drush module list

vendor/bin/drush pm:list
 --------------------- ----------------------------------------------------------- ---------- --------- 
  Package               Name                                                        Status     Version  
 --------------------- ----------------------------------------------------------- ---------- --------- 
  Core                  Actions (action)                                            Disabled   9.3.13   
  Core                  Aggregator (aggregator)                                     Disabled   9.3.13   
  Core                  Automated Cron (automated_cron)                             Enabled    9.3.13   
  Core                  Ban (ban)                                                   Disabled   9.3.13   
  Web services          HTTP Basic Authentication (basic_auth)                      Disabled   9.3.13   
  Core                  BigPipe (big_pipe)                                          Enabled    9.3.13   
  Core                  Block (block)                                               Enabled    9.3.13   
  Core                  Custom Block (block_content)                                Enabled    9.3.13   
  Core                  Book (book)                                                 Disabled   9.3.13   
  Core                  Breakpoint (breakpoint)                                     Enabled    9.3.13   
  Core                  CKEditor (ckeditor)                                         Enabled    9.3.13   
  Core (Experimental)   CKEditor 5 (ckeditor5)                                      Disabled   9.3.13   
  Core                  Color (color)                                               Enabled    9.3.13   
  Core                  Comment (comment)                                           Disabled   9.3.13   
  Core                  Configuration Manager (config)                              Enabled    9.3.13   
  Multilingual          Configuration Translation (config_translation)              Enabled    9.3.13   
  Core                  Contact (contact)                                           Enabled    9.3.13   
  Core                  Content Moderation (content_moderation)                     Enabled    9.3.13   
  Multilingual          Content Translation (content_translation)                   Enabled    9.3.13   
  Core                  Contextual Links (contextual)                               Enabled    9.3.13   
  Field types           Datetime (datetime)                                         Enabled    9.3.13   
  Field types           Datetime Range (datetime_range)                             Disabled   9.3.13   
  Core                  Database Logging (dblog)                                    Enabled    9.3.13   
  Core                  Internal Dynamic Page Cache (dynamic_page_cache)            Enabled    9.3.13   
  Core                  Text Editor (editor)                                        Enabled    9.3.13   
  Field types           Entity Reference (entity_reference)                         Disabled   9.3.13   
  Core                  Field (field)                                               Enabled    9.3.13   
  Core (Experimental)   Field Layout (field_layout)                                 Disabled   9.3.13   
  Core                  Field UI (field_ui)                                         Enabled    9.3.13   
  Field types           File (file)                                                 Enabled    9.3.13   
  Core                  Filter (filter)                                             Enabled    9.3.13   
  Core                  Forum (forum)                                               Disabled   9.3.13   
  Web services          HAL (hal)                                                   Disabled   9.3.13   
  Core                  Help (help)                                                 Enabled    9.3.13   
  Core (Experimental)   Help Topics (help_topics)                                   Disabled   9.3.13   
  Core                  History (history)                                           Enabled    9.3.13   
  Field types           Image (image)                                               Enabled    9.3.13   
  Core                  Inline Form Errors (inline_form_errors)                     Disabled   9.3.13   
  Web services          JSON:API (jsonapi)                                          Disabled   9.3.13   
  Multilingual          Language (language)                                         Enabled    9.3.13   
  Core                  Layout Builder (layout_builder)                             Enabled    9.3.13   
  Core                  Layout Discovery (layout_discovery)                         Enabled    9.3.13   
  Field types           Link (link)                                                 Enabled    9.3.13   
  Multilingual          Interface Translation (locale)                              Enabled    9.3.13   
  Core                  Media (media)                                               Enabled    9.3.13   
  Core                  Media Library (media_library)                               Enabled    9.3.13   
  Core                  Custom Menu Links (menu_link_content)                       Enabled    9.3.13   
  Core                  Menu UI (menu_ui)                                           Enabled    9.3.13   
  Migration             Migrate (migrate)                                           Disabled   9.3.13   
  Migration             Migrate Drupal (migrate_drupal)                             Disabled   9.3.13   
  Core (Experimental)   Migrate Drupal Multilingual (migrate_drupal_multilingual)   Disabled   9.3.13   
  Migration             Migrate Drupal UI (migrate_drupal_ui)                       Disabled   9.3.13   
  Core                  Node (node)                                                 Enabled    9.3.13   
  Field types           Options (options)                                           Enabled    9.3.13   
  Core                  Internal Page Cache (page_cache)                            Enabled    9.3.13   
  Core                  Path (path)                                                 Enabled    9.3.13   
  Core                  Path alias (path_alias)                                     Enabled    9.3.13   
  Core                  Quick Edit (quickedit)                                      Disabled   9.3.13   
  Core                  RDF (rdf)                                                   Enabled    9.3.13   
  Core                  Responsive Image (responsive_image)                         Enabled    9.3.13   
  Web services          RESTful Web Services (rest)                                 Disabled   9.3.13   
  Core                  Search (search)                                             Enabled    9.3.13   
  Web services          Serialization (serialization)                               Disabled   9.3.13   
  Core                  Settings Tray (settings_tray)                               Disabled   9.3.13   
  Core                  Shortcut (shortcut)                                         Enabled    9.3.13   
  Core                  Testing (simpletest)                                        Disabled   9.3.13   
  Core                  Statistics (statistics)                                     Disabled   9.3.13   
  Core                  Syslog (syslog)                                             Disabled   9.3.13   
  Core                  System (system)                                             Enabled    9.3.13   
  Core                  Taxonomy (taxonomy)                                         Enabled    9.3.13   
  Field types           Telephone (telephone)                                       Disabled   9.3.13   
  Field types           Text (text)                                                 Enabled    9.3.13   
  Core                  Toolbar (toolbar)                                           Enabled    9.3.13   
  Core                  Tour (tour)                                                 Enabled    9.3.13   
  Core                  Activity Tracker (tracker)                                  Disabled   9.3.13   
  Core                  Update Manager (update)                                     Enabled    9.3.13   
  Core                  User (user)                                                 Enabled    9.3.13   
  Core                  Views (views)                                               Enabled    9.3.13   
  Core                  Views UI (views_ui)                                         Enabled    9.3.13   
  Core                  Workflows (workflows)                                       Enabled    9.3.13   
  Core (Experimental)   Workspaces (workspaces)                                     Disabled   9.3.13   
  Core (Experimental)   Umami demo: Content (demo_umami_content)                    Enabled    9.3.13   
  Core                  Bartik (bartik)                                             Disabled   9.3.13   
  Core                  Claro (claro)                                               Disabled   9.3.13   
  Core                  Classy (classy)                                             Disabled   9.3.13   
  Core                  Olivero (olivero)                                           Disabled   9.3.13   
  Core                  Seven (seven)                                               Enabled    9.3.13   
  Core                  Stable (stable)                                             Disabled   9.3.13   
  Core                  Stable 9 (stable9)                                          Disabled   9.3.13   
  Core                  Stark (stark)                                               Disabled   9.3.13   
                        starterkit_theme (starterkit_theme)                         Disabled            
                        Umami (umami)                                               Enabled    9.3.13   
 --------------------- ----------------------------------------------------------- ---------- --------- 

drush core requirements check

vendor/bin/drush core:requirements
+----------------------------------------+----------+------------------------------------------------------------------------------+
| Title                                  | Severity | Summary                                                                      |
+----------------------------------------+----------+------------------------------------------------------------------------------+
| GD library PNG support                 | Info     | 2.3.3                                                                        |
|                                        |          |                                                                              |
| Configuration files                    | Info     | Protected                                                                    |
|                                        |          |                                                                              |
| Drupal core security coverage          | Info     | Covered until 9.5.0                                                          |
|                                        |          |                                                                              |
| Cron maintenance tasks                 | Info     | Last run 11 minutes 24 seconds ago                                           |
|                                        |          |                                                                              |
| Database system                        | Info     | MariaDB                                                                      |
|                                        |          |                                                                              |
| Database system version                | Info     | 10.3.34-MariaDB                                                              |
|                                        |          |                                                                              |
| Drupal                                 | Info     | 9.3.13                                                                       |
|                                        |          |                                                                              |
| Entity/field definitions               | Info     | Up to date                                                                   |
|                                        |          |                                                                              |
| Experimental modules enabled           | Warning  | Experimental modules found: /Umami demo: Content/. Experimental modules [1]  |
|                                        |          | are provided for testing purposes only. Use at your own risk.                |
|                                        |          |                                                                              |
|                                        |          | [1] https://www.drupal.org/core/experimental                                 |
|                                        |          |                                                                              |
| Experimental installation profile used | Warning  | Demo: Umami Food Magazine (Experimental)                                     |
|                                        |          |                                                                              |
| File system                            | Info     | Writable (/public/ download method)                                          |
|                                        |          |                                                                              |
| Upload progress                        | Info     | Not enabled                                                                  |
|                                        |          |                                                                              |
| Image toolkit                          | Info     | gd                                                                           |
|                                        |          |                                                                              |
| GD library                             | Info     | 2.3.3                                                                        |
|                                        |          |                                                                              |
| Installation profile                   | Info     | /Demo: Umami Food Magazine (Experimental)/ (/demo_umami/-/9.3.13/)           |
|                                        |          |                                                                              |
| Translation update status              | OK       | Up to date                                                                   |
|                                        |          |                                                                              |
| Media                                  | Warning  |                                                                              |
| Node Access Permissions                | Info     | Disabled                                                                     |
|                                        |          |                                                                              |
| PHP                                    | Info     | 7.4.29 (more information [1])                                                |
|                                        |          |                                                                              |
|                                        |          | [1] http://default/en/admin/reports/status/php                               |
|                                        |          |                                                                              |
| PHP extensions                         | Info     | Enabled                                                                      |
|                                        |          |                                                                              |
| PHP memory limit                       | Info     | 800M                                                                         |
|                                        |          |                                                                              |
| PHP OPcode caching                     | Info     | Enabled                                                                      |
|                                        |          |                                                                              |
| Random number generation               | Info     | Successful                                                                   |
|                                        |          |                                                                              |
| Search index progress                  | Info     | 100% (0 remaining)                                                           |
|                                        |          |                                                                              |
| Trusted Host Settings                  | Info     | Enabled                                                                      |
|                                        |          |                                                                              |
| Database updates                       | Info     | Up to date                                                                   |
|                                        |          |                                                                              |
| Access to update.php                   | Info     | Protected                                                                    |
|                                        |          |                                                                              |
| Update notifications                   | Info     | Enabled                                                                      |
|                                        |          |                                                                              |
| Drupal core update status              | Info     | Up to date [1]                                                               |
|                                        |          |                                                                              |
|                                        |          | [1] http://default/en/admin/reports/updates                                  |
|                                        |          |                                                                              |
| Web server                             | Info     |                                                                              |
+----------------------------------------+----------+------------------------------------------------------------------------------+

drush status

vendor/bin/drush status
 Drupal version   : 9.3.13                                                             
 Site URI         : http://default                                                     
 DB driver        : mysql                                                              
 DB hostname      : localhost                                                          
 DB port          : 3306                                                               
 DB username      : drupal_user1                                                       
 DB name          : drupal_db1                                                         
 Database         : Connected                                                          
 Drupal bootstrap : Successful                                                         
 Default theme    : umami                                                              
 Admin theme      : seven                                                              
 PHP binary       : /usr/local/bin/php                                                 
 PHP config       : /usr/local/lib/php.ini                                             
 PHP OS           : Linux                                                              
 Drush script     : /home/nginx/domains/drupal.domain.com/vendor/bin/drush             
 Drush version    : 11.0.9                                                             
 Drush temp       : /tmp                                                               
 Drush configs    : /home/nginx/domains/drupal.domain.com/vendor/drush/drush/drush.yml 
 Install profile  : demo_umami                                                         
 Drupal root      : /home/nginx/domains/drupal.domain.com/public                       
 Site path        : sites/default                                                      
 Files, Public    : sites/default/files                                                
 Files, Temp      : /tmp  

drush list

vendor/bin/drush list
Drush Commandline Tool 11.0.9

Run `drush help [command]` to view command-specific help.  Run `drush topic` to read even more documentation.

 Available commands:                                                                                                            
 _global:                                                                                                                       
   browse                               Display a link to a given path or open link in a browser.                               
   config:pull (cpull)                  Export and transfer config from one environment to another.                             
   deploy                               Run several commands after performing a code deployment.                                
   drupal:directory (dd)                Return the filesystem path for modules/themes and other key folders.                    
   generate (gen)                       Generate boilerplate code for modules/plugins/services etc.                             
   help                                 Display usage details for a command.                                                    
   list                                 List available commands.                                                                
   mk:docs                              Build a Markdown document for each Drush command/generator that is available on a site. 
   runserver (rs, serve)                Runs PHP's built-in http server for development.                                        
   user:login (uli)                     Display a one time login link for user ID 1, or another user.                           
   version                              Show Drush version.                                                                     
 cache:                                                                                                                         
   cache:clear (cc)                     Clear a specific cache, or all Drupal caches.                                           
   cache:get (cg)                       Fetch a cached object and display it.                                                   
   cache:rebuild (cr, rebuild)          Rebuild a Drupal 8 site.                                                                
   cache:set (cs)                       Cache an object expressed in JSON or var_export() format.                               
   cache:tags (ct)                      Invalidate by cache tags.                                                               
 core:                                                                                                                          
   core:edit (conf, config)             Edit drush.yml, site alias, and Drupal settings.php files.                              
   core:rsync (rsync)                   Rsync Drupal code or files to/from another server using ssh.                            
   core:status (status, st)             An overview of the environment - Drush and Drupal.                                      
   core:topic (topic)                   Read detailed documentation on a given topic.                                           
 php:                                                                                                                           
   php:eval (eval, ev)                  Evaluate arbitrary php code after bootstrapping Drupal (if available).                  
   php:script (scr)                     Run php a script after a full Drupal bootstrap.                                         
 pm:                                                                                                                            
   pm:security (sec)                    Check Drupal Composer packages for pending security updates.                            
   pm:security-php (sec-php)            Check non-Drupal PHP packages for pending security updates.                             
 site:                                                                                                                          
   site:alias (sa)                      Show site alias details, or a list of available site aliases.                           
   site:alias-convert (sa-convert, sac) Convert legacy site alias files to the new yml format.                                  
   site:install (si, sin)               Install Drupal along with modules/themes/configuration/profile.                         
   site:set (use)                       Set a site alias that will persist for the current session.                             
   site:ssh (ssh)                       Connect to a Drupal site's server via SSH, and optionally run a shell command.          
 sql:                                                                                                                           
   sql:cli (sqlc)                       Open a SQL command-line interface using Drupal's credentials.                           
   sql:connect                          A string for connecting to the DB.                                                      
   sql:create                           Create a database.                                                                      
   sql:drop                             Drop all tables in a given database.                                                    
   sql:dump                             Exports the Drupal DB as SQL using mysqldump or equivalent.                             
   sql:query (sqlq)                     Execute a query against a database.                                                     
   sql:sync                             Copy DB data from a source site to a target site. Transfers data via rsync.             
 updatedb:                                                                                                                      
   updatedb (updb)                      Apply any database updates required (as with running update.php).                       
   updatedb:status (updbst)             List any pending database updates.  

drush install via composer

echo y | composer require --dev drush/drush
Do not run Composer as root/super user! See https://getcomposer.org/root for details
For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins
You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^11.0 for drush/drush
./composer.json has been updated
Running composer update drush/drush
Loading composer repositories with package information
Updating dependencies
Lock file operations: 24 installs, 0 updates, 0 removals
  - Locking chi-teck/drupal-code-generator (2.5.3)
  - Locking consolidation/annotated-command (4.5.5)
  - Locking consolidation/config (2.1.0)
  - Locking consolidation/filter-via-dot-access-data (2.0.2)
  - Locking consolidation/log (2.1.1)
  - Locking consolidation/output-formatters (4.2.2)
  - Locking consolidation/robo (3.0.10)
  - Locking consolidation/self-update (2.0.5)
  - Locking consolidation/site-alias (3.1.5)
  - Locking consolidation/site-process (4.2.0)
  - Locking dflydev/dot-access-data (v3.0.1)
  - Locking drush/drush (11.0.9)
  - Locking enlightn/security-checker (v1.10.0)
  - Locking grasmash/expander (2.0.3)
  - Locking league/container (4.2.0)
  - Locking nikic/php-parser (v4.13.2)
  - Locking psy/psysh (v0.11.4)
  - Locking symfony/filesystem (v5.4.7)
  - Locking symfony/finder (v5.4.8)
  - Locking symfony/polyfill-intl-grapheme (v1.25.0)
  - Locking symfony/string (v5.4.8)
  - Locking webflo/drupal-finder (1.2.2)
  - Locking webmozart/assert (1.10.0)
  - Locking webmozart/path-util (2.3.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 24 installs, 0 updates, 0 removals
  - Downloading consolidation/log (2.1.1)
  - Downloading symfony/finder (v5.4.8)
  - Downloading dflydev/dot-access-data (v3.0.1)
  - Downloading consolidation/output-formatters (4.2.2)
  - Downloading consolidation/self-update (2.0.5)
  - Downloading webmozart/path-util (2.3.0)
  - Downloading webflo/drupal-finder (1.2.2)
  - Downloading nikic/php-parser (v4.13.2)
  - Downloading psy/psysh (v0.11.4)
  - Downloading league/container (4.2.0)
  - Downloading enlightn/security-checker (v1.10.0)
  - Downloading grasmash/expander (2.0.3)
  - Downloading consolidation/config (2.1.0)
  - Downloading consolidation/site-alias (3.1.5)
  - Downloading consolidation/site-process (4.2.0)
  - Downloading consolidation/annotated-command (4.5.5)
  - Downloading consolidation/robo (3.0.10)
  - Downloading consolidation/filter-via-dot-access-data (2.0.2)
  - Downloading symfony/polyfill-intl-grapheme (v1.25.0)
  - Downloading symfony/string (v5.4.8)
  - Downloading chi-teck/drupal-code-generator (2.5.3)
  - Downloading drush/drush (11.0.9)
  - Installing consolidation/log (2.1.1): Extracting archive
  - Installing symfony/finder (v5.4.8): Extracting archive
  - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
  - Installing consolidation/output-formatters (4.2.2): Extracting archive
  - Installing symfony/filesystem (v5.4.7): Extracting archive
  - Installing consolidation/self-update (2.0.5): Extracting archive
  - Installing webmozart/assert (1.10.0): Extracting archive
  - Installing webmozart/path-util (2.3.0): Extracting archive
  - Installing webflo/drupal-finder (1.2.2): Extracting archive
  - Installing nikic/php-parser (v4.13.2): Extracting archive
  - Installing psy/psysh (v0.11.4): Extracting archive
  - Installing league/container (4.2.0): Extracting archive
  - Installing enlightn/security-checker (v1.10.0): Extracting archive
  - Installing grasmash/expander (2.0.3): Extracting archive
  - Installing consolidation/config (2.1.0): Extracting archive
  - Installing consolidation/site-alias (3.1.5): Extracting archive
  - Installing consolidation/site-process (4.2.0): Extracting archive
  - Installing consolidation/annotated-command (4.5.5): Extracting archive
  - Installing consolidation/robo (3.0.10): Extracting archive
  - Installing consolidation/filter-via-dot-access-data (2.0.2): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.25.0): Extracting archive
  - Installing symfony/string (v5.4.8): Extracting archive
  - Installing chi-teck/drupal-code-generator (2.5.3): Extracting archive
  - Installing drush/drush (11.0.9): Extracting archive
4 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
47 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
ls -lah vendor/drush/drush/
total 440K
drwxr-sr-x 10 root nginx 4.0K Apr 16 12:01 .
drwxr-sr-x  3 root nginx 4.0K May 18 14:32 ..
-rw-r--r--  1 root nginx 3.3K Apr 16 12:01 appveyor.yml
-rw-r--r--  1 root nginx 1.2K Apr 16 12:01 CODEOWNERS
-rw-r--r--  1 root nginx 4.9K Apr 16 12:01 composer.json
-rw-r--r--  1 root nginx 316K Apr 16 12:01 composer.lock
-rw-r--r--  1 root nginx 2.3K Apr 16 12:01 CONTRIBUTING.md
drwxr-sr-x  3 root nginx 4.0K Apr 16 12:01 .ddev
drwxr-sr-x  8 root nginx 4.0K Apr 16 12:01 docs
-rwxr-xr-x  1 root nginx   58 Apr 16 12:01 drush
-rw-r--r--  1 root nginx  150 Apr 16 12:01 drush.bat
-rw-r--r--  1 root nginx   21 Apr 16 12:01 drush.info
-rw-r--r--  1 root nginx  23K Apr 16 12:01 drush_logo-black.png
-rwxr-xr-x  1 root nginx 3.1K Apr 16 12:01 drush.php
-rw-r--r--  1 root nginx  125 Apr 16 12:01 drush.yml
drwxr-sr-x  3 root nginx 4.0K Apr 16 12:01 examples
drwxr-sr-x  4 root nginx 4.0K Apr 16 12:01 .github
-rw-r--r--  1 root nginx  397 Apr 16 12:01 .gitignore
drwxr-sr-x  2 root nginx 4.0K Apr 16 12:01 includes
drwxr-sr-x  2 root nginx 4.0K Apr 16 12:01 misc
-rw-r--r--  1 root nginx 3.3K Apr 16 12:01 mkdocs_base.yml
-rw-r--r--  1 root nginx  542 Apr 16 12:01 phpcs.xml
-rw-r--r--  1 root nginx 1.1K Apr 16 12:01 README.md
-rw-r--r--  1 root nginx 1.5K Apr 16 12:01 rector.php
drwxr-sr-x 21 root nginx 4.0K Apr 16 12:01 src
drwxr-sr-x  4 root nginx 4.0K Apr 16 12:01 src-symfony-compatibility
ls -lah vendor/bin
total 40K
drwxr-sr-x  2 root nginx 4.0K May 18 14:32 .
drwxr-sr-x 30 root nginx 4.0K May 18 14:32 ..
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 dcg
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 drush
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 php-parse
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 psysh
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 release
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 robo
-rwxr-xr-x  1 root nginx 3.2K May 18 14:32 security-checker
-rwxr-xr-x  1 root nginx 3.3K May 18 02:44 var-dump-server
/usr/local/src/centminmod/addons/mysqladmin_shell.sh createuserdb drupal_db1 drupal_user1 drupal_pass1
--------------------------------------------------------------
Basic MySQL Admin - create mysql user & databases 
--------------------------------------------------------------
--------------------------------------------------------------

Grants for drupal_user1@localhost
GRANT USAGE ON *.* TO `drupal_user1`@`localhost` IDENTIFIED BY PASSWORD '*FB6A1CBAB75568E50E58E03FB6D3B01B0ECB844D'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER ON `drupal_db1`.* TO `drupal_user1`@`localhost`

Ok: MySQL user: drupal_user1 MySQL database: drupal_db1 created successfully

final

ls -lah /home/nginx/domains/drupal.domain.com
total 2.8M
drwxr-s---   7 nginx nginx 4.0K May 18 02:54 .
drwxr-s---. 24 nginx nginx 4.0K May 18 02:39 ..
drwxr-s---   2 nginx nginx 4.0K May 18 01:57 backup
-rwxr-xr-x   1 nginx nginx 2.6M Apr 13 14:43 composer
-rw-r--r--   1 nginx nginx 3.1K May 18 02:41 composer.json
-rw-r--r--   1 nginx nginx 3.1K May 11 09:20 composer.json-orig
-rw-r--r--   1 nginx nginx 167K May 11 09:20 composer.lock
drwxr-s---   2 nginx nginx 4.0K May 18 01:57 log
drwxr-s---   2 nginx nginx 4.0K May 18 01:57 private
drwxr-sr-x   7 nginx nginx 4.0K May 18 02:44 public
drwxr-sr-x  19 nginx nginx 4.0K May 18 02:44 vendor

ls -lah /home/nginx/domains/drupal.domain.com/public/
total 136K
drwxr-sr-x  7 nginx nginx 4.0K May 18 02:44 .
drwxr-s---  7 nginx nginx 4.0K May 18 02:54 ..
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 401.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 403.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 404.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 500.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 502.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 503.html
-rw-r-----  1 nginx nginx 7.6K May 18 01:57 503.jpg
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 504.html
-rw-r-----  1 nginx nginx 2.0K May 18 01:57 50x.html
-rw-r--r--  1 nginx nginx  315 May 18 02:44 autoload.php
drwxr-sr-x 12 nginx nginx 4.0K May 11 09:20 core
-rw-r--r--  1 nginx nginx 1.1K May 18 02:44 .csslintrc
-rw-r--r--  1 nginx nginx  151 May 18 02:44 .eslintignore
-rw-r--r--  1 nginx nginx   41 May 18 02:44 .eslintrc.json
-rw-r--r--  1 nginx nginx 1.5K May 18 02:44 example.gitignore
-rw-r--r--  1 nginx nginx 7.4K May 18 02:44 .htaccess
-rw-r--r--  1 nginx nginx 2.3K May 18 02:44 .ht.router.php
-rw-r-----  1 nginx nginx 6.5K May 18 01:57 index.html
-rw-r--r--  1 nginx nginx  549 May 18 02:44 index.php
-rw-r--r--  1 nginx nginx   94 May 18 02:44 INSTALL.txt
-rw-r-----  1 nginx nginx 3.3K May 18 01:57 maintenance.html
drwxr-sr-x  2 nginx nginx 4.0K May 18 02:44 modules
drwxr-sr-x  2 nginx nginx 4.0K May 18 02:44 profiles
-rw-r--r--  1 nginx nginx 3.2K May 18 02:44 README.md
-rw-r--r--  1 nginx nginx 1.6K May 18 02:44 robots.txt
drwxr-sr-x  3 nginx nginx 4.0K May 18 02:44 sites
drwxr-sr-x  2 nginx nginx 4.0K May 18 02:44 themes
-rw-r--r--  1 nginx nginx  804 May 18 02:44 update.php
-rw-r--r--  1 nginx nginx 4.0K May 18 02:44 web.config

temp

ls -lah /home/nginx/domains/drupal.domain.com-files/public/
total 84K
drwxr-sr-x  7 root nginx 4.0K May 18 02:44 .
drwxr-sr-x  4 root nginx 4.0K May 18 02:44 ..
-rw-r--r--  1 root nginx  315 May 18 02:44 autoload.php
drwxr-sr-x 12 root nginx 4.0K May 11 09:20 core
-rw-r--r--  1 root nginx 1.1K May 18 02:44 .csslintrc
-rw-r--r--  1 root nginx  151 May 18 02:44 .eslintignore
-rw-r--r--  1 root nginx   41 May 18 02:44 .eslintrc.json
-rw-r--r--  1 root nginx 1.5K May 18 02:44 example.gitignore
-rw-r--r--  1 root nginx 7.4K May 18 02:44 .htaccess
-rw-r--r--  1 root nginx 2.3K May 18 02:44 .ht.router.php
-rw-r--r--  1 root nginx  549 May 18 02:44 index.php
-rw-r--r--  1 root nginx   94 May 18 02:44 INSTALL.txt
drwxr-sr-x  2 root nginx 4.0K May 18 02:44 modules
drwxr-sr-x  2 root nginx 4.0K May 18 02:44 profiles
-rw-r--r--  1 root nginx 3.2K May 18 02:44 README.md
-rw-r--r--  1 root nginx 1.6K May 18 02:44 robots.txt
drwxr-sr-x  3 root nginx 4.0K May 18 02:44 sites
drwxr-sr-x  2 root nginx 4.0K May 18 02:44 themes
-rw-r--r--  1 root nginx  804 May 18 02:44 update.php
-rw-r--r--  1 root nginx 4.0K May 18 02:44 web.config
ls -lah /home/nginx/domains/drupal.domain.com-files
total 200K
drwxr-sr-x   4 root  nginx 4.0K May 18 02:44 .
drwxr-s---. 24 nginx nginx 4.0K May 18 02:39 ..
-rw-r--r--   1 root  nginx 3.1K May 18 02:41 composer.json
-rw-r--r--   1 root  nginx 3.1K May 11 09:20 composer.json-orig
-rw-r--r--   1 root  nginx 167K May 11 09:20 composer.lock
-rw-r--r--   1 root  nginx  357 May 18 02:44 .editorconfig
-rw-r--r--   1 root  nginx 3.8K May 18 02:44 .gitattributes
drwxr-sr-x   7 root  nginx 4.0K May 18 02:44 public
drwxr-sr-x  19 root  nginx 4.0K May 18 02:44 vendor
echo y | composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 62 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.12.0): Extracting archive
For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins
You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.
  - Installing drupal/core-composer-scaffold (9.3.13): Extracting archive
  - Installing drupal/core-project-message (9.3.13): Extracting archive
  - Installing typo3/phar-stream-wrapper (v3.1.7): Extracting archive
  - Installing symfony/polyfill-php72 (v1.25.0): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing twig/twig (v2.14.11): Extracting archive
  - Installing symfony/yaml (v4.4.34): Extracting archive
  - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
  - Installing symfony/var-dumper (v5.4.0): Extracting archive
  - Installing symfony/translation-contracts (v2.5.0): Extracting archive
  - Installing symfony/validator (v4.4.35): Extracting archive
  - Installing symfony/translation (v4.4.34): Extracting archive
  - Installing symfony/deprecation-contracts (v2.5.0): Extracting archive
  - Installing psr/container (1.1.1): Extracting archive
  - Installing symfony/service-contracts (v2.5.0): Extracting archive
  - Installing symfony/serializer (v4.4.35): Extracting archive
  - Installing symfony/routing (v4.4.34): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
  - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
  - Installing symfony/mime (v5.4.0): Extracting archive
  - Installing symfony/http-foundation (v4.4.34): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing symfony/psr-http-message-bridge (v2.1.2): Extracting archive
  - Installing symfony/process (v4.4.35): Extracting archive
  - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
  - Installing symfony/polyfill-php73 (v1.25.0): Extracting archive
  - Installing symfony/http-client-contracts (v2.5.0): Extracting archive
  - Installing symfony/event-dispatcher-contracts (v1.1.11): Extracting archive
  - Installing symfony/event-dispatcher (v4.4.34): Extracting archive
  - Installing psr/log (1.1.4): Extracting archive
  - Installing symfony/debug (v4.4.31): Extracting archive
  - Installing symfony/error-handler (v4.4.34): Extracting archive
  - Installing symfony/http-kernel (v4.4.35): Extracting archive
  - Installing symfony/dependency-injection (v4.4.34): Extracting archive
  - Installing symfony/console (v4.4.34): Extracting archive
  - Installing symfony-cmf/routing (2.3.4): Extracting archive
  - Installing stack/builder (v1.0.6): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-factory (1.0.1): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing pear/pear_exception (v1.0.2): Extracting archive
  - Installing pear/console_getopt (v1.4.3): Extracting archive
  - Installing pear/pear-core-minimal (v1.10.11): Extracting archive
  - Installing pear/archive_tar (1.4.14): Extracting archive
  - Installing masterminds/html5 (2.7.5): Extracting archive
  - Installing laminas/laminas-stdlib (3.6.1): Extracting archive
  - Installing laminas/laminas-escaper (2.9.0): Extracting archive
  - Installing laminas/laminas-feed (2.15.0): Extracting archive
  - Installing laminas/laminas-diactoros (2.8.0): Extracting archive
  - Installing guzzlehttp/psr7 (1.8.5): Extracting archive
  - Installing guzzlehttp/promises (1.5.1): Extracting archive
  - Installing guzzlehttp/guzzle (6.5.5): Extracting archive
  - Installing doctrine/lexer (1.2.1): Extracting archive
  - Installing egulias/email-validator (3.1.2): Extracting archive
  - Installing doctrine/annotations (1.13.2): Extracting archive
  - Installing doctrine/reflection (1.2.2): Extracting archive
  - Installing composer/semver (3.2.6): Extracting archive
  - Installing asm89/stack-cors (1.3.0): Extracting archive
  - Installing drupal/core (9.3.13): Extracting archive
  - Installing drupal/core-recommended (9.3.13)
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Generating autoload files
41 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.md from assets/scaffold/files/drupal.README.md
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
  * Homepage: https://www.drupal.org/project/drupal
  * Support:
    * docs: https://www.drupal.org/docs/user_guide/en/index.html
    * chat: https://www.drupal.org/node/314178
echo y | composer create-project --no-install drupal/recommended-project drupal.domain.com-files
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Creating a "drupal/recommended-project" project at "./drupal.domain.com-files"
Info from https://repo.packagist.org: #StandWithUkraine
Installing drupal/recommended-project (9.3.13)
  - Installing drupal/recommended-project (9.3.13): Extracting archive
Created project in /home/nginx/domains/drupal.domain.com-files

ls -lah /home/nginx/domains/drupal.domain.com-files
total 180K
drwxr-sr-x   2 root  nginx 4.0K May 11 09:20 .
drwxr-s---. 24 nginx nginx 4.0K May 18 02:39 ..
-rw-r--r--   1 root  nginx 3.1K May 11 09:20 composer.json
-rw-r--r--   1 root  nginx 167K May 11 09:20 composer.lock
ls -lAh /home/nginx/domains/drupal.domain.com/mysite/
total 172K
-rw-r--r-- 1 nginx nginx 3.1K May 11 09:20 composer.json
-rw-r--r-- 1 nginx nginx 167K May 11 09:20 composer.lock
diff -u /home/nginx/domains/drupal.domain.com-files/composer.json-orig /home/nginx/domains/drupal.domain.com-files/composer.json
--- /home/nginx/domains/drupal.domain.com-files/composer.json-orig      2022-05-11 09:20:58.000000000 +0000
+++ /home/nginx/domains/drupal.domain.com-files/composer.json   2022-05-18 02:41:25.309845894 +0000
@@ -31,35 +31,35 @@
     "extra": {
         "drupal-scaffold": {
             "locations": {
-                "web-root": "web/"
+                "web-root": "public/"
             }
         },
         "installer-paths": {
-            "web/core": [
+            "public/core": [
                 "type:drupal-core"
             ],
-            "web/libraries/{$name}": [
+            "public/libraries/{$name}": [
                 "type:drupal-library"
             ],
-            "web/modules/contrib/{$name}": [
+            "public/modules/contrib/{$name}": [
                 "type:drupal-module"
             ],
-            "web/profiles/contrib/{$name}": [
+            "public/profiles/contrib/{$name}": [
                 "type:drupal-profile"
             ],
-            "web/themes/contrib/{$name}": [
+            "public/themes/contrib/{$name}": [
                 "type:drupal-theme"
             ],
             "drush/Commands/contrib/{$name}": [
                 "type:drupal-drush"
             ],
-            "web/modules/custom/{$name}": [
+            "public/modules/custom/{$name}": [
                 "type:drupal-custom-module"
             ],
-            "web/profiles/custom/{$name}": [
+            "public/profiles/custom/{$name}": [
                 "type:drupal-custom-profile"
             ],
-            "web/themes/custom/{$name}": [
+            "public/themes/custom/{$name}": [
                 "type:drupal-custom-theme"
             ]
         },

before /home/nginx/domains/drupal.domain.com/mysite/composer.json

cat /home/nginx/domains/drupal.domain.com-files/composer.json | grep 'web\/'
                "web-root": "web/"
            "web/core": [
            "web/libraries/{$name}": [
            "web/modules/contrib/{$name}": [
            "web/profiles/contrib/{$name}": [
            "web/themes/contrib/{$name}": [
            "web/modules/custom/{$name}": [
            "web/profiles/custom/{$name}": [
            "web/themes/custom/{$name}": [
{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.9",
        "drupal/core-composer-scaffold": "^9.3",
        "drupal/core-project-message": "^9.3",
        "drupal/core-recommended": "^9.3"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

after /home/nginx/domains/drupal.domain.com-files/composer.json

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.9",
        "drupal/core-composer-scaffold": "^9.3",
        "drupal/core-project-message": "^9.3",
        "drupal/core-recommended": "^9.3"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "public/"
            }
        },
        "installer-paths": {
            "public/core": [
                "type:drupal-core"
            ],
            "public/libraries/{$name}": [
                "type:drupal-library"
            ],
            "public/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "public/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "public/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "public/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "public/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "public/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

Reading material

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment