Install Drupal

When Ubuntu is installed and configured, Drupal can be prepared. Below follows a description for installing

  • Drupal 7 (latest official release)
  • Drupal 7.x (current dev)
  • Drupal 8 (latest official release)
  • Drupal 8.0.x (current dev)

Administrator for both mysql and Drupal is the user  ‘ada’ with password ‘Lovelace’, you can replace with your choice. If you change to other users/passwords, remember that they must match the user and password you gave when installing Ubuntu packages.

You can safely skip the steps with Drupal versions you don’t need. Typically I will use a released version, when it is the actual Drupal application having focus and a development version, when I am making bug-fixes or new features to Drupal.

First I install drush 8, which can be used for both Drupal 7 and Drupal 8. Composer is required to install drush. I use the script install-drush.sh to install drush.

#install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

#install drush
composer global require drush/drush:dev-master
sudo ln -s /home/vagrant/.composer/vendor/bin/drush /usr/bin/drush
sudo chmod -R 777 /home/vagrant/.drush/cache

Second I prepare mysql database. I create one admin user for drupal . I start mysql with mysql -u root -pLovelace. The sql commands are:

create user ‘ada’@’localhost’ identified by ‘Lovelace’;
grant all privileges on * . * to ‘ada’@’localhost’;
flush privileges;

And the installation of Drupal 7.

cd /var/www/html
drush dl drupal-7 –drupal-project-rename=d7
cd d7
drush site-install standard –db-url=”mysql://ada:Lovelace@localhost/$3″ –site-name=”Drupal $dv on Ubuntu” –account-name=ada –account-pass=Lovelace
sudo chmod -R 777 sites/default/files
sudo chown -R :www-data *

The installation of Drupal 8 is similarly, I just change the version number ‘7’ to ‘8’. In Drupal 8  trusted_host_patterns must be specified in settings.php, otherwise you will get a security warning. Add the following:

$settings[‘trusted_host_patterns’] = array(
  ‘localhost’,
  ‘^www\.example\.com$’
 );

Installing the current dev versions (7.x and 8.0.x) is slightly different, as I need Git to control the source. Replace the line “drush dl …” with:

git clone –branch 8.0.x http://git.drupal.org/project/drupal.git
mv drupal devd8

I use the scripts drupalget.sh and  drupalgetversion.sh to prepare the databases and install the different Drupal versions.

Next I install WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *