From f79b37c93d1ccdc176c0e728666b5a40a5d1eafd Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 26 Jun 2020 01:29:24 +0900 Subject: [PATCH 1/2] chg: [doc] Updated INSTALL doc --- INSTALL/INSTALL.md | 53 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/INSTALL/INSTALL.md b/INSTALL/INSTALL.md index 6db03ff..825e695 100644 --- a/INSTALL/INSTALL.md +++ b/INSTALL/INSTALL.md @@ -1,24 +1,31 @@ ## Requirements -An Ubuntu server (18.04/20.04 should both work fine) - though other linux installations should work too. -- apache2, mysql/mariadb, sqlite need to be installed and running -- php extensions for intl, mysql, sqlite need to be installed and running +An Ubuntu server (18.04/20.04 should both work fine) - though other Linux installations should work too. +- sqlite, apache2, mysql/mariadb need to be installed and running +- php extensions for intl, mysql, sqlite3, mbstring, xml need to be installed and running +- composer ## Cerebrate installation instructions +Install dependencies +``` +sudo apt install composer apache2 libapache2-mod-php php php-intl php-mysql php-mbstring php-sqlite3 php-xml unzip mariadb-server +``` + Simply clone this repository (for example into /var/www/cerebrate) ``` -cd /var/www -git clone git@github.com:cerebrate-project/cerebrate.git +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 ``` Run composer ``` cd /var/www/cerebrate -composer install +sudo -u www-data composer install ``` Create a database for cerebrate @@ -32,25 +39,45 @@ GRANT ALL PRIVILEGES ON cerebrate.* to cerebrate@localhost; FLUSH PRIVILEGES; ``` +``` +mysql +sudo mysql -e "CREATE DATABASE cerebrate;" +sudo mysql -e "CREATE USER 'cerebrate'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';" +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;" +``` + Load the default table structure into the database ``` -mysql -u cerebrate -p cerebrate < /var/www/cerebrate/INSTALL/mysql.sql +sudo mysql -u cerebrate -p cerebrate < /var/www/cerebrate/INSTALL/mysql.sql ``` create your local configuration and set the db credentials ``` -cp -a /var/www/cerebrate/config/app_local.example.php /var/www/cerebrate/config/app_local.php -vim /var/www/cerebrate/config/app_local.php +sudo -u www-data cp -a /var/www/cerebrate/config/app_local.example.php /var/www/cerebrate/config/app_local.php +sudo -u www-data vim /var/www/cerebrate/config/app_local.php ``` -Simply modify the Datasource -> default array's username, password, database fields +Modify the Datasource -> default array's username, password, database fields -Create an apache config file for cerebrate / ssh key and point the document root to /var/www/cerebrate/webroot/index.php and you're good to go +Create an apache config file for cerebrate / ssh key and point the document root to /var/www/cerebrate/webroot/index.php and you're good to go. + +For development installs the following can be done: + +``` +# 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_dev.conf /etc/apache2/sites-available/ +sudo ln -s /etc/apache2/sites-available/cerebrate_dev.conf /etc/apache2/sites-enabled/ +sudo service apache2 restart +``` + +Now you can point your browser to: http://localhost:8000 To log in use the default credentials below: -username: admin +Username: admin Password: Password1234 - From 4ffddb8b579f4256af6a2006750a529a38032a94 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Fri, 26 Jun 2020 01:53:52 +0900 Subject: [PATCH 2/2] chg: [doc] Added mod_rewrite note --- INSTALL/INSTALL.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/INSTALL/INSTALL.md b/INSTALL/INSTALL.md index 825e695..37e67db 100644 --- a/INSTALL/INSTALL.md +++ b/INSTALL/INSTALL.md @@ -13,7 +13,7 @@ Install dependencies sudo apt install composer apache2 libapache2-mod-php php php-intl php-mysql php-mbstring php-sqlite3 php-xml unzip mariadb-server ``` -Simply clone this repository (for example into /var/www/cerebrate) +Clone this repository (for example into /var/www/cerebrate) ``` sudo mkdir /var/www/cerebrate @@ -40,9 +40,8 @@ FLUSH PRIVILEGES; ``` ``` -mysql sudo mysql -e "CREATE DATABASE cerebrate;" -sudo mysql -e "CREATE USER 'cerebrate'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';" +sudo mysql -e "CREATE USER 'cerebrate'@'localhost' IDENTIFIED BY 'YOuR_Pa$$WORD!';" 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;" @@ -65,6 +64,12 @@ Modify the Datasource -> default array's username, password, database fields Create an apache config file for cerebrate / ssh key and point the document root to /var/www/cerebrate/webroot/index.php and you're good to go. +mod_rewrite needs to be enabled: + +``` +sudo a2enmod rewrite +``` + For development installs the following can be done: ```