From 1b37c6673fec975399e708b2753c3b770d0d1250 Mon Sep 17 00:00:00 2001 From: Theodotos Andreou Date: Sun, 14 Jan 2018 15:21:18 +0200 Subject: [PATCH] Created Setting up CiviCRM (markdown) --- Setting-up-CiviCRM.md | 105 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Setting-up-CiviCRM.md diff --git a/Setting-up-CiviCRM.md b/Setting-up-CiviCRM.md new file mode 100644 index 0000000..19b34d8 --- /dev/null +++ b/Setting-up-CiviCRM.md @@ -0,0 +1,105 @@ +Next we need to setup *CiviCRM* alongside *Drupal 7*. + +## Prerequisites + +* A [[Drupal setup|Setting up Drupal 7]] + +## Prepare CiviCRM requirements + +Install the PHP SOAP extension + +``` +$ sudo apt -y install php7.0-soap +``` + +Set the PHP *memory_limit* to **256M**: + +``` +sudo sed -i -e 's/memory_limit\ =\ 128M/memory_limit\ =\ 256M/' /etc/php/7.0/fpm/php.ini +``` + +Restart *php7.0-fpm*: + +``` +sudo systemctl restart php7.0-fpm +``` + +Prepare a *CiviCRM Database: + +``` +MariaDB [(none)]> CREATE DATABASE civicrm CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +MariaDB [(none)]> GRANT ALL PRIVILEGES ON civicrm.* TO 'cmsuser'@'localhost' IDENTIFIED BY 'MyDrupalDBPass'; +``` + +## Install CiviCRM + +Download and extract civicrm: + +``` +$ sudo su - webadmin +$ wget https://download.civicrm.org/civicrm-4.7.29-drupal.tar.gz +$ tar xvzf civicrm-4.7.29-drupal.tar.gz -C cms/sites/all/modules/ +``` + +Setup the correct permissions (as the *admin* user): + +``` +$ sudo chown www-data /srv/webadmin/cms/sites/default +``` + +Run the installer: + +https://cms.example.com/sites/all/modules/civicrm/install/index.php + +Fill in these settings: + +* CiviCRM Database Settings + * MySQL server: **localhost** + * MySQL username: **cmsuser** + * MySQL password: **MyDrupalDBPass* + * MySQL database: **civicrm** + +* Drupal Database Settings + * MySQL server: **localhost** + * MySQL username: **cmsuser** + * MySQL password: **MyDrupalDBPass* + * MySQL database: **cms** + +Then press the 'Re-check Requirements' button. If you get the green assurance that all is OK proceed by pressing the 'Check Requirements and Install CiviCRM' button. + +## Post-install steps + +### Restrict access to private files + +Add the following configuration in */etc/nginx/sites-available/cms*: + +``` +location ~* ^/sites/.*/files/civicrm/(?:ConfigAndLog|custom|upload|templates_c) { + access_log off; + return 404; + } +``` + +Restart *Nginx*: + +``` +$ sudo nginx -t && sudo systemctl restart nginx +``` + +### Set Drupal Views to use the CiviCRM database + +Visit this URL: + +https://cms.example.com/civicrm/admin/setting/uf?reset=1 + +Add the following: + +* Drupal Users Table Name: **users** +* Sync CMS Email: **Enabled** + +References +---------- +* https://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades +* https://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+PHP+Requirements +* https://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+Drupal+7 +* https://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration \ No newline at end of file