Drupal core extraction to website folder (ISP Config system)

PART 1 - INSTALLATION

Go to website folder:

cd /var/www/websites/client0/domain0/web

wget https://ftp.drupal.org/files/projects/drupal-7.78.tar.gz

 tar xzvf drupal-7.78.tar.gz

mv -f drupal-7.78/* ./

 ls -la drupal-7.78

cd drupal-7.78

cp .editorconfig .gitignore .htaccess ..

rm ../drupal-7.78.tar.gz

All your files are unpacked to "web"-location!

 

Next step:

Permissions!

chown -R web0:client0 ./

systemctl restart httpd php-fpm

 

Making the Stable CORE

 

Multi-byte UTF-8 support

nano /etc/my.cnf

[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true

systemctl restart mariadb

 

The PHP MySQL driver must support the utf8mb4 charset (libmysqlclient 5.5.3 and up, or mysqlnd 5.0.9 and up, MySQL(mysqlnd) Native Driver is a replacement for the MySQL Client Library (libmysqlclient)).

 

The MySQL server must support the utf8mb4 charset (5.5.3 and up).

Run the command mysql --version to see your current MySQL version. As for checking the MySQL driver version, run the command php -i | grep 'mysqlnd\|libmysqlclient'.

 

 

For existing Drupal installations

  • First, back up your database and convert all existing tables to utf8mb4, such as by using the drush command provided by the utf8mb4_convert contrib project.
  • Set the "charset" and "collation" keys on the database connection array in settings.php to "utf8mb4" and "utf8mb4_general_ci" respectively:
    $databases['default']['default'] = array(
      'driver' => 'mysql',
      'database' => 'databasename',
      'username' => 'username',
      'password' => 'password',
      'host' => 'localhost',
      'charset' => 'utf8mb4',
      'collation' => 'utf8mb4_general_ci',
    );
    

 

Method for EXISTING WEBSITES with active databases doesn't work

mysql -u database_user -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 425
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

  • SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4;') AS mySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "c0_db_core" AND TABLE_TYPE="BASE TABLE";
  •  ALTER DATABASE c0_db_core CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
  • SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;') AS MySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "c0_db_core" AND TABLE_TYPE="BASE TABLE";
  • SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, ROW_FORMAT = DYNAMIC;') AS MySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "c0_db_core" AND TABLE_TYPE="BASE TABLE";

 

 

 

Therefore, we have to use recommendation for

new Drupal installations

  • Prior to running the installer, edit settings.php and manually add in the full database settings array code, with 'charset' as 'utf8mb4', and 'collation' as 'utf8mb4_general_ci', and with the actual values for 'database', 'username', 'password', 'host', as shown below:
    $databases['default']['default'] = array(
      'driver' => 'mysql',
      'database' => 'databasename',
      'username' => 'username',
      'password' => 'password',
      'host' => 'localhost',
      'charset' => 'utf8mb4',
      'collation' => 'utf8mb4_general_ci',
    );
    
  • Then run the installer specifically by accessing install.php, as in http://example.com/install.php (not just http://example.com/)

http://WEB.SITE/#overlay=admin/reports/status

Then fix HTTP request statusFails

 


http://WEB.SITE/#overlay=admin/modules

 

Disabling

Overlay

Dashboard

Toolbar

 

PART 2 - FORCED HTTPS

 

After

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

RewriteCond %{HTTPS} !=on
    # This checks to make sure the connection is not already HTTPS
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

PART 3 -

 

Enabling

 

Unpack multiple archives in folder

 

for archive in *.tar.gz
do
  tar xzvf $archive
done

 



  1. /admin/config/system/backup_migrate

    Running first BACK-UP


    + Scheduling DAILY_BACKUPS

    /admin/config/system/backup_migrate/schedule
    NameDestinationsProfileFrequencyKeepEnabledLast runOperations
    Untitled ScheduleScheduled Backups DirectoryDefault SettingsEvery 3 days24 hourly, 30 daily, all weekly backupsEnabledNeveredit   delete   export

     


  2. Changed layout of MENU to a nice view
     

  3.  

  4. /sites/all/modules/admin_menu/admin_menu.inc/**
     * Build icon menu links; mostly containing maintenance helpers.
     *
     * @see theme_admin_menu_links()
     */
    function admin_menu_links_icon() {
      $destination = drupal_get_destination();

      $links = array(
        '#theme' => 'admin_menu_links',
        '#wrapper_attributes' => array('id' => 'admin-menu-icon'),
        '#weight' => -100,
      );
      $links['icon'] = array(
        '#title' => theme('admin_menu_icon'),
        '#attributes' => array('class' => array('admin-menu-icon')),
        '#href' => '<front>',
        '#options' => array(
          'html' => TRUE,
        ),
      );
      // Add link to manually run cron.
      $links['icon']['cron'] = array(
        '#title' => t('Run cron'),
        '#weight' => 50,
        '#access' => user_access('administer site configuration'),
        '#href' => 'admin/reports/status/run-cron',
      );
      // Add link to content page.
      $links['icon']['modules']= array(
        '#title' => t('Modules'),
        '#weight' => 86,
        '#access' => user_access('administer site configuration'),
        '#href' => 'admin/modules',
      );

      // Add items to flush caches.
      $links['icon']['flush-cache'] = array(
        '#title' => t('Flush all caches'),
        '#weight' => 20,
        '#access' => user_access('flush caches'),
        '#href' => 'admin_menu/flush-cache',
        '#options' => array(
          'query' => $destination + array('token' => drupal_get_token('admin_menu/flush-cache')),
        ),
      );
      $caches = module_invoke_all('admin_menu_cache_info');
      foreach ($caches as $name => $cache) {
        $links['icon']['flush-cache'][$name] = array(
          '#title' => $cache['title'],
          '#href' => 'admin_menu/flush-cache/' . $name,
          '#options' => array(
            'query' => $destination + array('token' => drupal_get_token('admin_menu/flush-cache/' . $name)),
          ),
        );
      }

     
  5. adminimal_admin_menu
     wget https://ftp.drupal.org/files/projects/adminimal_admin_menu-7.x-1.9.tar.gz
     
  6. Encryption

    encrypt
    ctools
    libraries

    wget https://ftp.drupal.org/files/projects/encrypt-7.x-2.3.tar.gz
    tar xzvf encrypt-7.x-2.3.tar.gz

    wget https://ftp.drupal.org/files/projects/ctools-7.x-1.19.tar.gz
    tar xzvf ctools-7.x-1.19.tar.gz

    wget https://ftp.drupal.org/files/projects/libraries-7.x-2.5.tar.gz
    tar xzvf libraries-7.x-2.5.tar.gz


     cd ../libraries
    wget https://deac-riga.dl.sourceforge.net/project/phpseclib/phpseclib1.0.19.zip
    unzip phpseclib1.0.19.zip -d phpseclib

     
  7. COPYing multiple required libraries:
    cp -r /var/www/clients/client0/web3/web/sites/all/libraries/{ace,colorbox,flexslider,fontawesome,jquery.imagesloaded,jquery.imgareaselect,spyc,video-js} ./

     
  8. Modules:

    Ace Editor module
    Colorbox module
    FlexSlider module
    Font Awesome module
    Manual Crop module
    REST Server module
    Video.js module

    Font Awesome 5 and version 7.x-3.x

    LIBRARY - wget https://use.fontawesome.com/releases/v5.15.3/fontawesome-free-5.15.3-web.zip
    MODULE - wget https://ftp.drupal.org/files/projects/fontawesome-7.x-3.13.tar.gz



    Extract MULTIPLE ARCHIVES (for *.tar.gz:)
    for file in *.tar.gz; do tar -zxf "$file"; done


    For *.tar.bz2:

    for file in *.tar.bz2; do tar -jxf "$file"; done
    

    For *.tar.xz:

    for file in *.tar.xz; do tar -Jxf "$file"; done
    

    wget https://ftp.drupal.org/files/projects/ace_editor-7.x-1.9.tar.gz
    wget https://ftp.drupal.org/files/projects/videojs-7.x-3.0-alpha3.tar.gz
     wget https://ftp.drupal.org/files/projects/flexslider-7.x-2.0-rc2.tar.gz
      wget https://ftp.drupal.org/files/projects/colorbox-7.x-2.15.tar.gz
      wget https://ftp.drupal.org/files/projects/manualcrop-7.x-1.7.tar.gz
      wget https://ftp.drupal.org/files/projects/services-7.x-3.27.tar.gz


    LIBRARY for VIDEO-JS version 5
    wget https://github.com/videojs/video.js/releases/download/v5.20.5/video-js-5.20.5.zip
    unzip video-js-5.20.5.zip -d video-js


     
  9. next