wiki:DrupalServer

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

--

Drupal8

  • sudo 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:
    • sudo 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;

Tip

From git:

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

Common

  • sudo mkdir /var/www/html/drupal8/sites/default/files
  • sudo chown www-data.www-data /var/www/html/drupal8/sites/default/files
  • cd /var/www/html/drupal8/sites/default
    • add the following configuration changes in the appropriate places inside default.settings.php:
      $settings['reverse_proxy'] = TRUE;
      $settings['reverse_proxy_addresses'] = array('172.16.0.1', '10.0.2.51');
      
    • sudo cp default.settings.php settings.php
  • sudo chown www-data.www-data /var/www/html/drupal8/sites/default/settings.php
  • sudo 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>
    
  • Restart apache.
    • sudo service apache2 restart

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.
    • quit

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

Tip

From git:

  • cd /var/www/html/drupal8/libraries
    • sudo git clone https://github.com/civicrm/civicrm-core civicrm
  • cd /var/www/html/drupal8/libraries/civicrm
    • composer install
    • 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

Running the Code Generator

FIXME: this only works as root, for dumb reasons.

  • cd /var/www/html/drupal8/libraries/civicrm/
    • sudo ln -s ../../modules/civicrm/ drupal
  • cd /var/www/html/drupal8/libraries/civicrm/xml/
    • sudo php GenCode.php schema/Schema.xml '' "drupal"

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

Danland

Not yet ported. They say it will be, but... Email sent to developer, no response.

Civi Bartik

Reported working at one time.

  • cd /var/www/html/drupal8/themes/
    • git clone git://git.drupal.org/project/civi_bartik.git
    • cd civi_bartik
      • git checkout origin/8.x-1.x

Pre-Work Update Procedure

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

Reset Procedure

  • mysql -u root -p
    • drop database drupal8;
    • create 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

state

  • xml/GenCode.php
  • CRM/Core/CodeGen/main.php
  • CRM/Core/CodeGen/schema.php:run()
  • ???
  • CRM/Core/DAO.php
  • packages/DB/DataObject.php