Created Setting up CiviCRM (markdown)

Theodotos Andreou 2018-01-14 15:21:18 +02:00
parent 17e7d8c16d
commit 1b37c6673f

105
Setting-up-CiviCRM.md Normal file

@ -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