forked from engelsystem/engelsystem
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathinstall_dependencies.sh
executable file
·52 lines (40 loc) · 1.62 KB
/
install_dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Authors:
# Sreeja Kamishetty <[email protected]>
# Description:
# A post-installation bash script for engelsystem
echo "Updating your package manager enter your root password"
sudo apt-get update
sudo apt-get upgrade
echo "Installing LAMP enter your root password where ever asked"
echo "Install Apache"
sudo apt-get install -y apache2
echo "Install MySQL"
sudo apt-get install mysql-server mysql-client
sudo mysql_secure_installation
php5=$(sudo apt-cache search php5 | wc -l)
php7=$(sudo apt-cache search php7 | wc -l)
if (( $php7 != 0 ))
then
sudo apt-get install -y libapache2-mod-php7.0 php7.0 php7.0-mysql
elif (( $php5 != 0 ))
then
sudo apt-get install -y libapache2-mod-php5 php5 php5-mysql
fi
echo "Install git"
sudo apt-get install -y git
cd /var/www/html
echo "Cloning the github repository"
sudo git clone --recursive https://github.com/fossasia/engelsystem.git
cd engelsystem
echo "Creating database engelsystem, enter mysql root password"
# creating new database engelsystem
echo "create database engelsystem" | mysql -u root -p
echo "Edit the database name username and password in config/config.php file"
sudo cp config/config-sample.default.php config/config.php
echo "Adding folder permission for Apache"
sudo chown -R www-data /var/www/html/engelsystem/
echo "Changing the document root and restarting apache"
sudo sed -i -e 's/DocumentRoot \/var\/www\/html/DocumentRoot \/var\/www\/html\/engelsystem\/public/g' /etc/apache2/sites-available/000-default.conf
sudo service apache2 restart
echo "All the dependencies are installed and Engelsystem can be viewed on local server at localhost/"