Last active
January 29, 2019 17:31
-
-
Save pajachiet/90a41c95c6c5d85f9b594ff1f2e6d841 to your computer and use it in GitHub Desktop.
Installation notes for Question2Answer platform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Work for OpenChronic project https://entrepreneur-interet-general.etalab.gouv.fr/defis/2019/openchronic.html | |
# https://docs.question2answer.org/install/ | |
SERVER= | |
ROOT_PASSWORD= | |
Q2A_MYSQL_PASSWORD= | |
Q2A_ROOT_PASSWORD= | |
cd workdir | |
# 1 | |
wget https://github.com/q2a/question2answer/releases/download/v1.8.3/question2answer-1.8.3.zip | |
# 2 | |
unzip question2answer-1.8.3.zip | |
# 3 | |
git clone https://github.com/mrflos/q2a-lang-fr | |
mv q2a-lang-fr question2answer-1.8.3/fr | |
# 4 | |
ssh root@${SERVER} | |
mysql --user=root --password | |
# ROOT_PASSWORD | |
# CREATE USER 'q2a'@'localhost' IDENTIFIED BY '<MYSQL_Q2A_PASSWORD>'; | |
# GRANT ALL ON *.* TO 'q2a'@'localhost'; | |
# 5 | |
# RAS | |
# 6 | |
# .htaccess already renamed | |
mv question2answer-1.8.3/qa-config-example.php question2answer-1.8.3/qa-config.php | |
# 7 | |
sed -i '' 's/your-mysql-username/q2a/' question2answer-1.8.3/qa-config.php | |
sed -i '' 's/your-mysql-db-name/mysql/' question2answer-1.8.3/qa-config.php | |
# MANUALLY REPLACE as the following does not work | |
# sed -i '' "s/your-mysql-password/${MYSQL_Q2A_PASSWORD}/" question2answer-1.8.3/qa-config.php | |
# 8 | |
scp -r question2answer-1.8.3 root@${SERVER}:/var/www/html/qa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment