wiki:DrupalServer

Version 33 (modified by admin, 4 years ago) (diff)

--

Drupal8

  • apt-get install php5-gd php5-mysql ca-certificates apache2-mpm-prefork libapache2-mod-php5 mariadb-server
  • Make unstable available as a debian repository, then:
    • apt-get install composer
    • NOTE: composer is required for civicrm-drupal.
  • sudo a2enmod rewrite

Nick

From .tar.gz:

  • wget http://ftp.drupal.org/files/projects/drupal-8.0.0-rc1.tar.gz
  • cd /var/www/html/
    • tar -xzf ~/drupal-8.0.0-rc1.tar.gz

Change domain name in /var/www/html/drupal8/core/lib/Drupal/Core/DrupalKernel.php's initializeRequestGlobals(): $base_url="http://anacostia.faikvm.com";

Add the following after the line use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; in /var/www/html/drupal8/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php:

/* for CiviCRM Views Module. -- JEL */

use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser as YamlParser;
use Symfony\Component\ExpressionLanguage\Expression;

Broken

From git:

  • cd /var/www/html
    • git clone https://github.com/drupal/drupal.git drupal8

Common

  • mkdir /var/www/html/drupal8/sites/default/files
  • chown www-data.www-data /var/www/html/drupal8/sites/default/files
  • cd /var/www/html/drupal8/sites/default
    • mv default.settings.php settings.php
      • add the following configuration changes in the appropriate places inside settings.php:
        $settings['reverse_proxy'] = TRUE;
        $settings['reverse_proxy_addresses'] = array('172.16.0.1', '10.0.2.51');
        
  • sudo chown www-data.www-data /var/www/html/drupal8/sites/default/settings.php
  • chown www-data.www-data /var/www/html/drupal8/sites/default

Enable clean URLs

  • Add the following right before the closing tag of /etc/apache2/sites-available/000-default.conf
    <directory /var/www/html>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ drupal8/?q=$1 [L,QSA]
    </directory>
    

Database Setup

  • mysql -u root -p
    • create database drupal8;
    • create user drupal;
    • GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, TRIGGER, CREATE TEMPORARY TABLES ON drupal8.* TO 'drupal'@'localhost' IDENTIFIED BY 'password';
      • Note that TRIGGER is required for CiviCRM, not drupal.

Web Interface

Go to the URL of your Drupal8 server.

  • Yes, you have to continue anyway, due to drupal8 not detecting that clean URLs are available.
  • No, do not bother checking for updates. We are going to handle this manually.

CiviCRM

  • mkdir /var/www/html/drupal8/libraries

Nick

  • cd /var/www/html/drupal8/libraries
    • wget http://dist.civicrm.org/by-date/latest/master/civicrm-4.7.beta1-drupal-20151103.tar.gz
    • tar -xzf civicrm-4.7.beta1-drupal-20151103.tar.gz
    • rm -rf /var/www/html/drupal8/libraries/civicrm/drupal

Broken

From git:

  • cd /var/www/html/drupal8/libraries
    • git clone https://github.com/civicrm/civicrm-core civicrm
  • cd /var/www/html/drupal8/libraries/civicrm
    • composer install
  • cd /var/www/html/drupal8/libraries/civicrm
    • sudo git clone https://github.com/civicrm/civicrm-packages.git packages

CiviCRM-Drupal

From git:

  • cd /var/www/html/drupal8/modules/
    • sudo git clone -b 8.x-master http://github.com/civicrm/civicrm-drupal.git civicrm

Web Interface

  • under 'Extend', select the 'CiviCRM Core' extension, and scroll to the bottom of the page to 'Install'.
    • This will result in an empty white page.

Themes

Mayo

  • mayo-8.x-1.0-rc3.tar.gz

Pre-Work Update Procedure

  • cd /var/www/html/drupal8/
    • git pull
  • cd /var/www/html/drupal8/modules/civicrm/
    • git pull
  • cd /var/www/html/drupal8/libraries/civicrm
    • git pull
  • cd /var/www/html/drupal8/libraries/civicrm/packages/
    • git pull

Reset Procedure

  • mysql -u root -p
    • drop database drupal8;
    • GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, TRIGGER, CREATE TEMPORARY TABLES ON drupal8.* TO 'drupal'@'localhost' IDENTIFIED BY 'password';
    • quit
  • cd /var/www/html/drupal8/sites/default/
    • sudo cp default.settings.php settings.php
    • add the following configuration changes in the appropriate places inside settings.php:
      $settings['reverse_proxy'] = TRUE;
      $settings['reverse_proxy_addresses'] = array('172.16.0.1', '10.0.2.51');