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

Drupal (Currently Active Pages)

Setting up a Basic Multi-Site Drupal 7 installation

# get and extract the sources:
mkdir -p /home/www/www-mario-common
cd /home/www/www-mario-common/
wget "http://ftp.drupal.org/files/projects/drupal-7.26.tar.gz"
untargz drupal-7.26.tar.gz
ln -s drupal-7.26 drupal-current
cd /home/www/www-mario-common/drupal-current/

sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-7.26
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current
sudo chmod -R u+rwX,g+rX-w,+rX-w   /home/www/www-mario-common/drupal-7.26

# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/default
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/default
General mySQL commands
# list mySQL databases
mysql --user='root' --password -e "SHOW DATABASES;"
# show all mySQL users:
mysql --user='root' --password -e "SELECT User FROM mysql.user;"
# backup mySQL databases:
mysqldump --user='root' --password emmenlau_valumar_drupal | gzip -9 > ~/emmenlau_valumar_drupal.sql.gz
mysqldump --user='root' --password emmenlau_maremm_drupal | gzip -9 > ~/emmenlau_maremm_drupal.sql.gz
# drop databases that are not used anymore:
mysql --user='root' --password -e "DROP DATABASE emmenlau_valerieundmario;"
mysql --user='root' --password -e "DROP DATABASE emmenlau_biodat_drupal;"
# change a user password:
mysql --user='root' --password -e "SET PASSWORD FOR 'emmenlau_valerie'@'localhost' = PASSWORD('<put password here>');"
# remove a user:
mysql --user='root' --password -e "flush privileges;"
mysql --user='root' --password -e "DROP USER emmenlau_valerieundmario;"
mysql --user='root' --password -e "DROP USER emmenlau_biodat@localhost;"

For the Page valerieundmario.de

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

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE emmenlau_valumar_drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'emmenlau_valumar'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_valumar_drupal.* TO 'emmenlau_valumar'@'localhost';"


# create settings file:
cd /home/www/www-mario-common/drupal-current/sites/
cp -iv ./default/default.settings.php ./valerieundmario.de/settings.php
# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/valerieundmario.de
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/valerieundmario.de

# prepare the actual root directory:
#sudo chown -R www-mario:www-mario /home/www/de.valerieundmario
#sudo chmod -R g+rwX,o-rwx         /home/www/de.valerieundmario

cd /home/www/de.valerieundmario/pages/
ln -s ../../www-mario-common/drupal-current ./drupal-current

# modify Apache settings to load from this root:
sudo cp -piv /etc/apache2/sites-available/de.emmenlauer /etc/apache2/sites-available/de.valerieundmario
sudo perl -pi -e 's/valerieundmario/valerieundmario/g' /etc/apache2/sites-available/de.valerieundmario
sudo ln -s ../sites-available/de.valerieundmario /etc/apache2/sites-enabled/2400-de.valerieundmario

sudo /etc/init.d/apache2 reload
Configure the new Drupal (Web-Based Setup)
  • Go to the new website at: http://www.valerieundmario.de/
    • Pick: Standard Install
    • Pick: English Language
    • Pick: MySQL
      • Database name: emmenlau_valumar_drupal
      • Database username: emmenlau_valumar
      • Database password: <put password here>
    • Pick:
      • Site email: webmaster@valerieundmario.de
      • Maintenance Username: emmenlau
      • Maintenance Email: webmaster@valerieundmario.de
      • Maintenace Password: <put password here>
      • Default Country: Germany
Finish Configuration
# remove write permissions from settings file:
sudo chmod 644 sites/default/settings.php
sudo chmod 755 sites/default

For the Page biodataanalysis.de

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

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE emmenlau_biodat_drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'emmenlau_biodat'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_biodat_drupal.* TO 'emmenlau_biodat'@'localhost';"


# create settings file:
cd /home/www/www-mario-common/drupal-current/sites/
cp -iv ./default/default.settings.php ./biodataanalysis.de/settings.php
# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/biodataanalysis.de
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/biodataanalysis.de

# prepare the actual root directory:
#sudo chown -R www-mario:www-mario /home/www/de.biodataanalysis
#sudo chmod -R g+rwX,o-rwx         /home/www/de.biodataanalysis

cd /home/www/de.biodataanalysis/pages/
ln -s ../../www-mario-common/drupal-current ./drupal-current

# modify Apache settings to load from this root:
sudo cp -piv /etc/apache2/sites-available/de.valerieundmario /etc/apache2/sites-available/de.biodataanalysis
sudo perl -pi -e 's/valerieundmario/biodataanalysis/g' /etc/apache2/sites-available/de.biodataanalysis
sudo ln -s ../sites-available/de.biodataanalysis /etc/apache2/sites-enabled/2400-de.biodataanalysis

sudo /etc/init.d/apache2 reload
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
Finish Configuration
# remove write permissions from settings file:
sudo chmod 644 drupal-current/sites/biodataanalysis.de/settings.php

For the Page emmenlauer.de

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

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE emmenlau_emmenl_drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'emmenlau_emmenl'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_emmenl_drupal.* TO 'emmenlau_emmenl'@'localhost';"


# create settings file:
cd /home/www/www-mario-common/drupal-current/sites/
cp -iv ./default/default.settings.php ./emmenlauer.de/settings.php
# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/emmenlauer.de
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/emmenlauer.de

cd /home/www/de.emmenlauer/pages/
ln -s ../../www-mario-common/drupal-current ./drupal-current

## prepare the actual root directory:
#sudo chown -R www-mario:www-mario /home/www/de.emmenlauer
#sudo chmod -R g+rwX,o-rwx         /home/www/de.emmenlauer

# modify Apache settings to load from this root:
sudo diff -wBd /etc/apache2/sites-available/de.valerieundmario /etc/apache2/sites-available/de.emmenlauer|less

sudo /etc/init.d/apache2 reload
Configure the new Drupal (Web-Based Setup)
  • Go to the new website at: http://www.emmenlauer.de/
    • Pick: Standard Install
    • Pick: English Language
    • Pick: MySQL
      • Database name: emmenlau_emmenl_drupal
      • Database username: emmenlau_emmenl
      • Database password: <put password here>
    • Pick:
      • Site name: www.emmenlauer.de
      • Site email: webmaster@emmenlauer.de
      • Maintenance Username: emmenlau
      • Maintenance Email: webmaster@emmenlauer.de
      • Maintenace Password: <put password here>
      • Default Country: Germany
Finish Configuration
# remove write permissions from settings file:
cd /home/www/www-mario-common/drupal-current/
sudo chmod 644 sites/default/default.settings.php
sudo chmod 755 sites/default

Install or Update Modules / Plugins

Sometimes modules must be installed from the SHELL, I don't know why!

Google Analytics

cd /tmp/ && \
wget http://ftp.drupal.org/files/projects/google_analytics-7.x-2.3.tar.gz && \
untargz google_analytics-7.x-2.3.tar.gz && \
sudo chmod -R g+rwX,o-rwx google_analytics && \
sudo chown -R www-mario:www-mario google_analytics && \
sudo rm -fr /home/www/www-mario-common/drupal-current/sites/all/modules/google_analytics && \
sudo mv google_analytics /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo mv google_analytics-7.x-2.3.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/sites/all/modules/

Google Translate

cd /tmp/ && \
wget http://ftp.drupal.org/files/projects/gtranslate-7.x-1.14.tar.gz && \
untargz gtranslate-7.x-1.14.tar.gz && \
sudo chmod -R g+rwX,o-rwx gtranslate && \
sudo chown -R www-mario:www-mario gtranslate && \
sudo rm -fr /home/www/www-mario-common/drupal-current/sites/all/modules/gtranslate && \
sudo mv gtranslate /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo mv gtranslate-7.x-1.14.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/sites/all/modules/

RSS Permissions

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

cd /home/www/www-mario-common/
sudo chmod g+w .
wget http://ftp.drupal.org/files/projects/rss_permissions-7.x-1.0-beta2.tar.gz
untargz rss_permissions-7.x-1.0-beta2.tar.gz
diff -wBdqr ./rss_permissions ./drupal-current/sites/all/modules/rss_permissions
sudo rm -fr ./drupal-current/sites/all/modules/rss_permissions
sudo mv ./rss_permissions ./drupal-current/sites/all/modules/rss_permissions
sudo chown -R www-data:www-mario ./drupal-current/sites/all/modules/rss_permissions
sudo chmod -R u+rwX,g+rX-w,o-rwx ./drupal-current/sites/all/modules/rss_permissions
sudo chmod g-w .

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-7.x-2.0-beta11.tar.gz && \
untargz video_embed_field-7.x-2.0-beta11.tar.gz && \
sudo mv video_embed_field /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo mv video_embed_field-7.x-2.0-beta11.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/sites/all/modules/

Chaos Tools (ctools) for Video

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

cd /tmp/ && \
wget --no-check-certificate http://ftp.drupal.org/files/projects/ctools-7.x-1.12.tar.gz && \
untargz ctools-7.x-1.12.tar.gz
sudo mv ctools /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
mv ctools-7.x-1.12.tar.gz /home/www/www-mario-common/ && \
sudo chown -R www-mario:www-mario /home/www/www-mario-common/drupal-current/sites/all/modules/ && \
sudo chmod -R g+rwX,o-rwx         /home/www/www-mario-common/drupal-current/sites/all/modules/

Update Drupal Minor-Release

This example was previously used to:

  • update Drupal from version 7.26 to 7.27
  • update Drupal from version 7.27 to 7.31
  • update Drupal from version 7.31 to 7.32
  • update Drupal from version 7.32 to 7.34
  • update Drupal from version 7.34 to 7.36
  • update Drupal from version 7.36 to 7.38
  • update Drupal from version 7.38 to 7.54

Read first the update instructions here:

ssh aldebaran
ssh atlas

cd /home/www/www-mario-common/ && \
sudo chmod g+w . && \
wget http://ftp.drupal.org/files/projects/drupal-7.54.tar.gz && \
untargz drupal-7.54.tar.gz && \
diff -wBdqr drupal-current drupal-7.54|less
diff -wBdqr drupal-current drupal-7.54|grep '^Only in drupal-current/sites'|perl -pe 's@Only in drupal-current/@@g;s@: @/@g'|while read DIRNAME ; do
    cp -pr "drupal-current/${DIRNAME}" "drupal-7.54/${DIRNAME}" || break
done
diff -wBdqr drupal-current drupal-7.54|grep 'settings'|perl -pe 's@ and @ @g'
# manually copy files where the *old* version is better?!

# put all sites to maintenance mode:
   * http://emmenlauer.de/admin/config/development/maintenance
   * http://valerieundmario.de/admin/config/development/maintenance
   * http://biodataanalysis.de/admin/config/development/maintenance

# continue on the server:
tar --xz -cf drupal-7.38.tar.xz drupal-7.38
sudo rm -fr drupal-7.38
sudo rm -f drupal-current
ln -s drupal-7.54 drupal-current
sudo chmod -R u+rwX,g+rX-w,o-rwx  drupal-7.54*
sudo chown -R www-mario:www-mario drupal-7.54*
sudo chown -R www-mario:www-mario drupal-current

# give every specific write permissions on the upload directories:
sudo chmod -R g+w drupal-current/sites/emmenlauer.de/files
sudo chmod -R g+w drupal-current/sites/valerieundmario.de/files
sudo chmod -R g+w drupal-current/sites/biodataanalysis.de/files

# remove write permissions on the root:
sudo chmod g-w .

# finally call the update script of all pages, and check the status:

Finally call the update script of all pages, and check the status:

Finally call the update script of all pages, and check the status:

Drupal (Deprecated Pages)

For the Page marioemmenlauer.de

*This page has been deprecated and removed*. See below for removal instructions.

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

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE emmenlau_maremm_drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'emmenlau_maremm'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_maremm_drupal.* TO 'emmenlau_maremm'@'localhost';"


# create settings file:
cd /home/www/www-mario-common/drupal-current/sites/
cp -iv ./default/default.settings.php ./marioemmenlauer.de/settings.php
# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/marioemmenlauer.de
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/marioemmenlauer.de

# prepare the actual root directory:
#sudo chown -R www-mario:www-mario /home/www/de.marioemmenlauer
#sudo chmod -R g+rwX,o-rwx         /home/www/de.marioemmenlauer

cd /home/www/de.marioemmenlauer/pages/
ln -s ../../www-mario-common/drupal-current ./drupal-current

# modify Apache settings to load from this root:
sudo cp -piv /etc/apache2/sites-available/de.valerieundmario /etc/apache2/sites-available/de.marioemmenlauer
sudo perl -pi -e 's/valerieundmario/marioemmenlauer/g' /etc/apache2/sites-available/de.marioemmenlauer
sudo ln -s ../sites-available/de.marioemmenlauer /etc/apache2/sites-enabled/2400-de.marioemmenlauer

sudo /etc/init.d/apache2 reload
Configure the new Drupal (Web-Based Setup)
  • Go to the new website at: http://www.marioemmenlauer.de/
    • Pick: Standard Install
    • Pick: English Language
    • Pick: MySQL
      • Database name: emmenlau_maremm_drupal
      • Database username: emmenlau_maremm
      • Database password: <put password here>
    • Pick:
      • Site email: webmaster@marioemmenlauer.de
      • Maintenance Username: emmenlau
      • Maintenance Email: webmaster@marioemmenlauer.de
      • Maintenace Password: <put password here>
      • Default Country: Germany
Finish Configuration
# remove write permissions from settings file:
sudo chmod 644 sites/default/settings.php
sudo chmod 755 sites/default

Removal of marioemmenlauer.de

# remove the Drupal settings directory
sudo rm -fr /home/www/www-mario-common/drupal-current/sites/marioemmenlauer.de
sudo rm -fr /home/www/de.marioemmenlauer

# list mySQL databases:
mysql --user='root' --password -e "SHOW DATABASES;"
# remove the mysql database:
mysql --user='root' --password -e "DROP DATABASE emmenlau_maremm_drupal;"
# show all mySQL users:
mysql --user='root' --password -e "SELECT User FROM mysql.user;"
# remove the mysql user:
mysql --user='root' --password -e "DROP USER 'emmenlau_maremm'@'localhost';"

# modify Apache settings to disable this root,
# make it a redirect to biodataanalysis.de:
sudo nano /etc/apache2/sites-available/de.marioemmenlauer

sudo /etc/init.d/apache2 reload

For the Page valerie.emmenlauer.de

*This page has been deprecated and removed*. See below for removal instructions.

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

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE emmenlau_valerie_drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'emmenlau_valerie'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON emmenlau_valerie_drupal.* TO 'emmenlau_valerie'@'localhost';"


# create settings file:
cd /home/www/www-mario-common/drupal-current/sites/
cp -iv ./default/default.settings.php ./valerie.emmenlauer.de/settings.php
# set this to make sure the modules can be automatically installed:
#sudo chown -R www-data:www-mario /home/www/www-mario-common/drupal-current/sites/valerie.emmenlauer.de
#sudo chmod -R g+rwX,o-rwx        /home/www/www-mario-common/drupal-current/sites/valerie.emmenlauer.de

cd /home/www/de.emmenlauer/pages/
ln -s ../../www-mario-common/drupal-current ./valerie-drupal-current

## prepare the actual root directory:
#sudo chown -R www-mario:www-mario /home/www/de.emmenlauer
#sudo chmod -R g+rwX,o-rwx         /home/www/de.emmenlauer

# modify Apache settings to load from this root:
sudo nano /etc/apache2/sites-available/de.emmenlauer

sudo /etc/init.d/apache2 reload
Configure the new Drupal (Web-Based Setup)
  • Go to the new website at: http://www.valerie.emmenlauer.de/
    • Pick: Standard Install
    • Pick: English Language
    • Pick: MySQL
      • Database name: emmenlau_valerie_drupal
      • Database username: emmenlau_valerie
      • Database password: <put password here>
    • Pick:
      • Site email: webmaster@emmenlauer.de
      • Maintenance Username: emmenlau
      • Maintenance Email: webmaster@emmenlauer.de
      • Maintenance Password: <put password here>
      • Default Country: Germany
Finish Configuration
# remove write permissions from settings file:
cd /home/www/www-mario-common/drupal-current/
sudo chmod 644 sites/default/default.settings.php
sudo chmod 755 sites/default

Removal of valerie.emmenlauer.de

# remove the Drupal settings directory
sudo rm -fr /home/www/www-mario-common/drupal-current/sites/valerie.emmenlauer.de

# list mySQL databases:
mysql --user='root' --password -e "SHOW DATABASES;"
# remove the mysql database:
mysql --user='root' --password -e "DROP DATABASE emmenlau_valerie_drupal;"
# show all mySQL users:
mysql --user='root' --password -e "SELECT User FROM mysql.user;"
# remove the mysql user:
mysql --user='root' --password -e "DROP USER 'emmenlau_valerie'@'localhost';"

sudo rm /home/www/de.emmenlauer/pages/drupal-current-valerie

# modify Apache settings to disable this root:
sudo nano /etc/apache2/sites-available/de.emmenlauer

sudo /etc/init.d/apache2 reload
guides/drupal7.txt · Last modified: 2017/03/30 20:52 by mario