2020-06-22 17:58:56 +02:00
|
|
|
## Requirements
|
|
|
|
|
2022-12-16 08:08:17 +01:00
|
|
|
An Ubuntu server (20.04/22.04 should both work fine) - though other linux installations should work too.
|
2022-01-31 10:12:01 +01:00
|
|
|
|
2021-10-29 01:29:46 +02:00
|
|
|
- apache2 (or nginx), mysql/mariadb, sqlite need to be installed and running
|
2022-01-31 10:12:01 +01:00
|
|
|
- php version 8+ is required
|
2020-06-25 18:29:24 +02:00
|
|
|
- php extensions for intl, mysql, sqlite3, mbstring, xml need to be installed and running
|
2021-10-29 01:29:46 +02:00
|
|
|
- php extention for curl (not required but makes composer run a little faster)
|
2020-06-25 18:29:24 +02:00
|
|
|
- composer
|
2020-06-22 17:58:56 +02:00
|
|
|
|
2021-07-02 10:21:45 +02:00
|
|
|
## Network requirements
|
|
|
|
|
2021-07-02 10:22:26 +02:00
|
|
|
Cerebrate communicates via HTTPS so in order to be able to connect to other cerebrate nodes, requiring the following ports to be open:
|
2021-07-02 10:21:45 +02:00
|
|
|
- port 443 needs to be open for outbound connections to be able to pull contactdb / sharing group information in
|
2021-07-02 10:22:26 +02:00
|
|
|
- Cerebrate also needs to be accessible (via port 443) from the outside if:
|
2021-07-02 10:21:45 +02:00
|
|
|
- you wish to pull interconnect local tools with remote cerebrate instances
|
|
|
|
- you wish to act as a hub node for a community where members are expected to pull data from your node
|
|
|
|
|
2020-06-22 17:58:56 +02:00
|
|
|
|
2020-06-22 14:53:29 +02:00
|
|
|
## Cerebrate installation instructions
|
|
|
|
|
2020-07-01 12:37:14 +02:00
|
|
|
It should be sufficient to issue the following command to install the dependencies:
|
2021-10-29 01:29:46 +02:00
|
|
|
|
2022-12-16 16:56:29 +01:00
|
|
|
### Note for Ubuntu 20.04 :
|
|
|
|
|
|
|
|
You will need to type this command first to be able to download php8 otherwise php 7.4 will be install instead.
|
|
|
|
|
|
|
|
~~~
|
|
|
|
sudo add-apt-repository ppa:ondrej/php
|
|
|
|
~~~
|
|
|
|
|
|
|
|
- for apache
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo apt install apache2 mariadb-server git php8.2-intl php8.2-mbstring php8.2-dom php8.2-xml unzip php8.2-ldap php8.2-sqlite3 ph8.2p-curl sqlite libapache2-mod-php php8.2-mysql
|
|
|
|
```
|
|
|
|
|
|
|
|
- for nginx
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo apt install nginx mariadb-server git php8.2-intl php8.2-mbstring php8.2-dom php8.2-xml unzip php8.2-ldap php8.2-sqlite3 ph8.2p-curl sqlite php8.2-mysql
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Install composer:
|
|
|
|
|
|
|
|
~~~bash
|
|
|
|
cd
|
|
|
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
|
|
|
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
|
|
|
php composer-setup.php
|
|
|
|
php -r "unlink('composer-setup.php');"
|
|
|
|
sudo mv composer.phar /usr/local/bin/composer
|
|
|
|
~~~
|
|
|
|
|
|
|
|
### Other
|
|
|
|
|
2021-10-29 01:29:46 +02:00
|
|
|
- for apache
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo apt install apache2 mariadb-server git composer php-intl php-mbstring php-dom php-xml unzip php-ldap php-sqlite3 php-curl sqlite libapache2-mod-php php-mysql
|
|
|
|
```
|
|
|
|
|
|
|
|
- for nginx
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2021-10-29 01:29:46 +02:00
|
|
|
sudo apt install nginx mariadb-server git composer php-intl php-mbstring php-dom php-xml unzip php-ldap php-sqlite3 sqlite php-fpm php-curl php-mysql
|
2020-06-25 18:29:24 +02:00
|
|
|
```
|
|
|
|
|
2022-12-16 16:56:29 +01:00
|
|
|
|
|
|
|
|
2020-06-25 18:53:52 +02:00
|
|
|
Clone this repository (for example into /var/www/cerebrate)
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo mkdir /var/www/cerebrate
|
|
|
|
sudo chown www-data:www-data /var/www/cerebrate
|
|
|
|
sudo -u www-data git clone https://github.com/cerebrate-project/cerebrate.git /var/www/cerebrate
|
2020-06-22 14:50:56 +02:00
|
|
|
```
|
|
|
|
|
2020-06-22 14:53:29 +02:00
|
|
|
Run composer
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2021-11-01 16:58:10 +01:00
|
|
|
sudo mkdir -p /var/www/.composer
|
2021-10-28 23:56:25 +02:00
|
|
|
sudo chown www-data:www-data /var/www/.composer
|
2020-06-22 14:50:56 +02:00
|
|
|
cd /var/www/cerebrate
|
2021-10-28 23:56:25 +02:00
|
|
|
sudo -H -u www-data composer install
|
2020-06-22 14:50:56 +02:00
|
|
|
```
|
|
|
|
|
2020-06-22 14:53:29 +02:00
|
|
|
Create a database for cerebrate
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2021-11-01 16:58:10 +01:00
|
|
|
With a fresh install of Ubuntu sudo to the (system) root user before logging in as the mysql root
|
|
|
|
```Bash
|
|
|
|
sudo -i mysql -u root
|
|
|
|
```
|
|
|
|
|
2020-07-01 12:37:14 +02:00
|
|
|
From SQL shell:
|
2020-11-17 14:56:56 +01:00
|
|
|
```mysql
|
2020-06-22 14:50:56 +02:00
|
|
|
mysql
|
|
|
|
CREATE DATABASE cerebrate;
|
2020-06-22 15:03:50 +02:00
|
|
|
CREATE USER 'cerebrate'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';
|
2020-06-22 14:50:56 +02:00
|
|
|
GRANT USAGE ON *.* to cerebrate@localhost;
|
|
|
|
GRANT ALL PRIVILEGES ON cerebrate.* to cerebrate@localhost;
|
2020-06-22 15:03:50 +02:00
|
|
|
FLUSH PRIVILEGES;
|
2021-11-01 16:58:10 +01:00
|
|
|
QUIT;
|
2020-06-22 14:50:56 +02:00
|
|
|
```
|
|
|
|
|
2020-07-01 12:37:14 +02:00
|
|
|
Or from Bash:
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo mysql -e "CREATE DATABASE cerebrate;"
|
2020-07-01 12:37:14 +02:00
|
|
|
sudo mysql -e "CREATE USER 'cerebrate'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';"
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo mysql -e "GRANT USAGE ON *.* to cerebrate@localhost;"
|
|
|
|
sudo mysql -e "GRANT ALL PRIVILEGES ON cerebrate.* to cerebrate@localhost;"
|
|
|
|
sudo mysql -e "FLUSH PRIVILEGES;"
|
|
|
|
```
|
|
|
|
|
2020-06-22 14:53:29 +02:00
|
|
|
create your local configuration and set the db credentials
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo -u www-data cp -a /var/www/cerebrate/config/app_local.example.php /var/www/cerebrate/config/app_local.php
|
2021-10-21 13:43:11 +02:00
|
|
|
sudo -u www-data cp -a /var/www/cerebrate/config/config.example.json /var/www/cerebrate/config/config.json
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo -u www-data vim /var/www/cerebrate/config/app_local.php
|
2020-06-22 14:51:35 +02:00
|
|
|
```
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-06-22 14:53:29 +02:00
|
|
|
Simply modify the Datasource -> default array's username, password, database fields
|
2020-06-29 12:08:40 +02:00
|
|
|
This would be, when following the steps above:
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-11-17 14:56:56 +01:00
|
|
|
```php
|
2020-06-29 12:08:40 +02:00
|
|
|
'Datasources' => [
|
|
|
|
'default' => [
|
|
|
|
'host' => 'localhost',
|
|
|
|
'username' => 'cerebrate',
|
|
|
|
'password' => 'YOUR_PASSWORD',
|
|
|
|
'database' => 'cerebrate',
|
|
|
|
```
|
2021-10-21 13:43:11 +02:00
|
|
|
|
2022-12-16 16:56:29 +01:00
|
|
|
mod_rewrite needs to be enabled if __using apache__:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo a2enmod rewrite
|
|
|
|
```
|
|
|
|
|
2021-10-21 13:43:11 +02:00
|
|
|
Run the database schema migrations
|
2022-12-16 16:56:29 +01:00
|
|
|
|
2021-10-21 13:43:11 +02:00
|
|
|
```bash
|
2021-11-01 16:58:10 +01:00
|
|
|
sudo -u www-data /var/www/cerebrate/bin/cake migrations migrate
|
|
|
|
sudo -u www-data /var/www/cerebrate/bin/cake migrations migrate -p tags
|
|
|
|
sudo -u www-data /var/www/cerebrate/bin/cake migrations migrate -p ADmad/SocialAuth
|
2021-10-21 13:43:11 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Clean cakephp caches
|
|
|
|
```bash
|
|
|
|
sudo rm /var/www/cerebrate/tmp/cache/models/*
|
|
|
|
sudo rm /var/www/cerebrate/tmp/cache/persistent/*
|
|
|
|
```
|
|
|
|
|
2020-11-17 14:47:26 +01:00
|
|
|
Create an apache config file for cerebrate / ssh key and point the document root to /var/www/cerebrate/webroot and you're good to go
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2021-10-29 01:29:46 +02:00
|
|
|
For development installs the following can be done for either apache or nginx:
|
2020-06-25 18:29:24 +02:00
|
|
|
|
2020-11-17 14:56:56 +01:00
|
|
|
```bash
|
2021-10-29 01:29:46 +02:00
|
|
|
# Apache
|
2020-06-25 18:29:24 +02:00
|
|
|
# This configuration is purely meant for local installations for development / testing
|
|
|
|
# Using HTTP on an unhardened apache is by no means meant to be used in any production environment
|
2021-10-29 01:29:46 +02:00
|
|
|
sudo cp /var/www/cerebrate/INSTALL/cerebrate_apache_dev.conf /etc/apache2/sites-available/
|
|
|
|
sudo ln -s /etc/apache2/sites-available/cerebrate_apache_dev.conf /etc/apache2/sites-enabled/
|
2020-06-25 18:29:24 +02:00
|
|
|
sudo service apache2 restart
|
|
|
|
```
|
|
|
|
|
2021-10-29 01:29:46 +02:00
|
|
|
OR
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# NGINX
|
|
|
|
# This configuration is purely meant for local installations for development / testing
|
|
|
|
# Using HTTP on an unhardened apache is by no means meant to be used in any production environment
|
|
|
|
sudo cp /var/www/cerebrate/INSTALL/cerebrate_nginx.conf /etc/nginx/sites-available/
|
|
|
|
sudo ln -s /etc/nginx/sites-available/cerebrate_nginx.conf /etc/nginx/sites-enabled/
|
|
|
|
sudo systemctl disable apache2 # may be required if apache is using port
|
|
|
|
sudo service nginx restart
|
|
|
|
sudo systemctl enable nginx
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2020-06-25 18:29:24 +02:00
|
|
|
Now you can point your browser to: http://localhost:8000
|
2020-06-22 14:50:56 +02:00
|
|
|
|
2020-06-24 14:28:33 +02:00
|
|
|
To log in use the default credentials below:
|
|
|
|
|
2020-11-17 14:47:26 +01:00
|
|
|
- Username: admin
|
|
|
|
- Password: Password1234
|