Welcome to http://www.marssoft.de/
 
Tuesday, 11th December 2018 21:21:58 (GMT+1) 

Drupal 8 (Currently Active Pages)

Setting up a Plain Multi-Site Drupal 8 installation

For the Page biodataanalysis.de

First backup mySQL databases

For Aldebaran:

# list mySQL databases
mysql --user='root' --password='' --execute='SHOW DATABASES;'

DATE=$(date +%s)
mysqldump --user='root' --password='' --databases 'emmenlau_emmenl_drupal' | gzip -9 > ~/emmenlau_emmenl_drupal_${DATE}.sql.gz
mysqldump --user='root' --password='' --databases 'emmenlau_valumar_drupal' | gzip -9 > ~/emmenlau_valumar_drupal_${DATE}.sql.gz

For Atlas:

# list mySQL databases
mysql --user='root' --password='' --execute='SHOW DATABASES;'

DATE=$(date +%s)
mysqldump --user='root' --password='' --databases 'emmenlau_biodat_drupal' | gzip -9 > ~/emmenlau_biodat_drupal_${DATE}.sql.gz
Make a new empty Drupal 8 installation
ssh aldebaran
ssh atlas

mkdir -p /home/www/www-mario-common/drupal-current/sites/biodataanalysis.de
mkdir -p /home/www/de.biodataanalysis/pages
mkdir -p /home/www/de.biodataanalysis/pages/data

cd /home/www/www-mario-common/ && \
sudo chmod g+w . && \
wget https://ftp.drupal.org/files/projects/drupal-8.2.7.tar.gz && \
untargz drupal-8.2.7.tar.gz && \
sudo ln -s ../../www-mario-common-atlas/drupal-8.2.7 /home/www/de.biodataanalysis/pages/drupal-8.2.7
# create a new mysql database:
mysql --user='root' --password='' --execute="CREATE DATABASE emmenlau_biodat_drupal8 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password='' --execute="CREATE USER 'emmenlau_biodat'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password='' --execute="GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_biodat_drupal8.* TO 'emmenlau_biodat'@'localhost';"

# set up multi-site configuration as discussed in drupal-8.2.7/core/INSTALL.txt
cp -iv drupal-8.2.7/sites/example.sites.php drupal-8.2.7/sites/sites.php
mkdir -p drupal-8.2.7/sites/new.biodataanalysis.de
cp -iv drupal-8.2.7/sites/default/default.settings.php drupal-8.2.7/sites/new.biodataanalysis.de/settings.php
mkdir -p drupal-8.2.7/sites/new.biodataanalysis.de/files

sudo chmod -R u+rwX,g+rX-w,o-rwx  drupal-8.2.7*
sudo chown -R www-mario:www-mario drupal-8.2.7*

# give every specific write permissions on the upload directories:
sudo chmod -R g+w drupal-8.2.7/sites/new.biodataanalysis.de/files
sudo chmod -R g+w drupal-8.2.7/sites/new.biodataanalysis.de/settings.php

# configure Apache to use this new website:
sudo cp -iv /etc/apache2/sites-available/de.biodataanalysis /etc/apache2/sites-available/de.biodataanalysis.new
sudo nano /etc/apache2/sites-available/de.biodataanalysis.new 
sudo chmod 664 /etc/apache2/sites-available/de.biodataanalysis.new
sudo ln -s ../sites-available/de.biodataanalysis.new /etc/apache2/sites-enabled/2400-de.biodataanalysis.new.conf 
sudo service apache2 reload

Remove the write permissions after successful installation:

sudo chmod u-w,g-w,o-w drupal-8.2.7/sites/new.biodataanalysis.de/settings.php
sudo chmod u-w,g-w,o-w drupal-8.2.7/sites/new.biodataanalysis.de
Configure the new Drupal (Web-Based Setup)
  • Go to the new website at: http://www.biodataanalysis.de/
    • Pick: Standard Install
    • Pick: English Language
    • Pick: MySQL
      • Database name: emmenlau_biodat_drupal
      • Database username: emmenlau_biodat
      • Database password: <put password here>
    • Pick:
      • Site email: webmaster@biodataanalysis.de
      • Maintenance Username: emmenlau
      • Maintenance Email: webmaster@biodataanalysis.de
      • Maintenace Password: <put password here>
      • Default Country: Germany

Setting up a Drupal 8 with STARTUP Growth Theme installation

scp ~/BioDataAnalysis/Ressources/Website/DrupalTheme-StartupGrowth/startupgrowth-personal_5.0.0.zip atlas:/home/www/www-mario-common-atlas/

ssh atlas
cd /tmp/
rm -fr /tmp/startupgrowth
unzip -q /home/www/www-mario-common-atlas/startupgrowth-personal_5.0.0.zip
sudo rm -fr /home/www/www-mario-common-atlas/drupal-8.1.6
sudo mv /tmp/startupgrowth/site/d8 /home/www/www-mario-common-atlas/drupal-8.1.6
sudo ln -s ../../www-mario-common-atlas/drupal-8.1.6 /home/www/de.biodataanalysis/pages/drupal-8.1.6
# drop the Drupal 8 test database:
mysql --user='root' --password='' --execute="DROP DATABASE emmenlau_biodat_d8sg;"
# create a new mysql database:
mysql --user='root' --password='' --execute="CREATE DATABASE emmenlau_biodat_d8sg DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password='' --execute="CREATE USER 'emmenlau_biodat'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password='' --execute="GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_biodat_d8sg.* TO 'emmenlau_biodat'@'localhost';"

Depreated, did not work: Migrate STARTUP Growth Theme Into BDA01 Theme

#cd /home/www/www-mario-common-atlas/drupal-8.1.6/
#mv themes/custom/startupgrowth themes/custom/bda01
#perl -pi -e 's@startupgrowth@bda01@g' _data/db_instance.sql
#perl -pi -e 's@Startup Growth@bda01@g' _data/db_instance.sql

#cd /home/www/www-mario-common-atlas/drupal-8.1.6/themes/custom/bda01/
#find . -name '*startupgrowth*'|while read I ; do J=$(echo "$I"|perl -pe 's@startupgrowth@bda01@g') ; mv "$I" "$J" || break ; done
#grep -Irn 'startupgrowth' *|cut -d':' -f1|sort -u|while read I ; do perl -pi -e 's@startupgrowth@bda01@g' "$I" || break ; done
#grep -Irn 'Startup Growth' *|cut -d':' -f1|sort -u|while read I ; do perl -pi -e 's@Startup Growth@bda01@g' "$I" || break ; done
## no need to assign new UUIDs:
##grep -Iirn uuid config/*|cut -d':' -f1|sort -u|while read I ; do perl -pi -e "s@^uuid: .*@uuid: $(cat /proc/sys/kernel/random/uuid)@g" "$I" || break ; done
# Import the database initialization for the theme:
mysql --user='root' --password='' emmenlau_biodat_d8sg < /home/www/www-mario-common-atlas/drupal-8.1.6/_data/db_instance.sql

# set up default single-site configuration:
cd /home/www/www-mario-common-atlas/
cp -iv drupal-8.1.6/sites/default/default.settings.php drupal-8.1.6/sites/default/settings.php
mkdir -p drupal-8.1.6/sites/default/files

sudo chmod -R u+rwX,g+rX-w,o-rwx  drupal-8.1.6*
sudo chown -R www-mario:www-mario drupal-8.1.6*

# give every specific write permissions on the upload directories:
sudo chmod -R g+w drupal-8.1.6/sites/default/files
sudo chmod -R g+w drupal-8.1.6/sites/default/settings.php

# configure Apache to use this new website:
sudo cp -iv /etc/apache2/sites-available/de.biodataanalysis /etc/apache2/sites-available/de.biodataanalysis.new
sudo nano /etc/apache2/sites-available/de.biodataanalysis.new 
sudo chmod 664 /etc/apache2/sites-available/de.biodataanalysis.new
sudo ln -s ../sites-available/de.biodataanalysis.new /etc/apache2/sites-enabled/2400-de.biodataanalysis.new.conf 
sudo service apache2 reload

Remove the now unused _data directory:

sudo rm -fr drupal-8.1.6/_data

Remove the write permissions after successful installation:

sudo chmod u-w,g-w,o-w drupal-8.1.6/sites/new.biodataanalysis.de/settings.php
sudo chmod u-w,g-w,o-w drupal-8.1.6/sites/new.biodataanalysis.de
cd /home/www/www-mario-common-atlas/
nano drupal-8.2.7/sites/default/settings.php

# add the following:
$settings['trusted_host_patterns'] = array(
  '^biodataanalysis\.de$',
  '^.+\.biodataanalysis\.de$',
);

Configure the STARTUP Growth Theme

Update to latest Drupal 8

This is an update from 8.2.7 to 8.3.1:

cd /home/www/www-mario-common-atlas/
sudo rm -fr drupal-8.3.1
sudo cp -par drupal-8.2.7 drupal-8.3.1
sudo chown -R emmenlau:emmenlau drupal-8.3.1

cd ./drupal-8.3.1/
# Remove the 'core' and 'vendor' directories:
rm -fr core vendor
# Remove all files in the top-level directory, except any that you added manually:
find . -maxdepth 1 -type f -exec rm \{\} \;

# fetch the latest Drupal:
cd /home/www/www-mario-common-atlas/
wget https://www.drupal.org/files/projects/drupal-8.3.1.tar.gz
tar -xzf drupal-8.3.1.tar.gz

diff -wBdNau drupal-8.2.7/sites/default/default.settings.php drupal-8.3.1/sites/default/default.settings.php > /tmp/settings.php.patch
perl -pi -e 's@/default.settings.php@/settings.php@g' /tmp/settings.php.patch
cd /home/www/www-mario-common-atlas/drupal-8.3.1/
patch -p1 -i /tmp/settings.php.patch

# point apache2 to the latest directory:
## as long as the current version is not linked via 'current', set the version link manually:
#sudo ln -s ../../www-mario-common-atlas/drupal-8.3.1 /home/www/de.biodataanalysis/pages/drupal-8.3.1
#sudo nano /etc/apache2/sites-available/de.biodataanalysis
#sudo service apache2 reload
cd /home/www/www-mario-common-atlas/
sudo rm drupal-current
sudo ln -s drupal-8.3.1 drupal-current

# enable update mode:
perl -pi -e 's@(update_free_access.*) FALSE@$1 TRUE@g' drupal-8.3.1/sites/default/settings.php

cd /home/www/www-mario-common-atlas/
sudo chmod -R u+rwX,g+rX-w,o-rwx  drupal-8.3.1*
sudo chown -R www-mario:www-mario drupal-8.3.1* drupal-current

# give every specific write permissions on the upload directories:
sudo chmod -R g+w drupal-8.3.1/sites/default/files
sudo chmod -R g+w drupal-8.3.1/sites/default/settings.php
# disable update mode:
cd /home/www/www-mario-common-atlas/
sudo chown -R emmenlau drupal-8.3.1/sites/default
perl -pi -e 's@(update_free_access.*) TRUE@$1 FALSE@g' drupal-8.3.1/sites/default/settings.php
sudo chown -R www-mario:www-mario drupal-8.3.1*
sudo chmod -R g-w drupal-8.3.1/sites/default/settings.php

Install or Update Modules / Plugins

Sometimes modules must be installed from the SHELL

Video Embed

Download from https://www.drupal.org/project/video_embed_field

cd /tmp/ && \
wget --no-check-certificate http://ftp.drupal.org/files/projects/video_embed_field-8.x-1.4.tar.gz && \
untargz video_embed_field-8.x-1.4.tar.gz && \
sudo rm -fr /home/www/www-mario-common/drupal-current/modules/video_embed_field && \
sudo mv video_embed_field /home/www/www-mario-common/drupal-current/modules/video_embed_field && \
sudo mv video_embed_field-8.x-1.4.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/modules/video_embed_field && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/modules/video_embed_field

Superfish

Download from https://www.drupal.org/project/superfish

cd /tmp/ && \
wget --no-check-certificate http://ftp.drupal.org/files/projects/superfish-8.x-1.0-rc6.tar.gz && \
untargz superfish-8.x-1.0-rc6.tar.gz && \
sudo rm -fr /home/www/www-mario-common/drupal-current/modules/superfish && \
sudo mv superfish /home/www/www-mario-common/drupal-current/modules/superfish && \
sudo mv superfish-8.x-1.0-rc6.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/modules/superfish && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/modules/superfish

Google Analytics

Download from https://www.drupal.org/project/google_analytics

cd /tmp/ && \
wget --no-check-certificate https://ftp.drupal.org/files/projects/google_analytics-8.x-2.1.tar.gz && \
untargz google_analytics-8.x-2.1.tar.gz && \
sudo rm -fr /home/www/www-mario-common/drupal-current/modules/google_analytics && \
sudo mv google_analytics /home/www/www-mario-common/drupal-current/modules/google_analytics && \
sudo mv google_analytics-8.x-2.1.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/modules/google_analytics && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/modules/google_analytics
guides/drupal8.txt · Last modified: 2017/04/26 21:22 by mario