This repository has been archived by the owner on Jun 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirohaBoard_Installer.sh
103 lines (93 loc) · 2.97 KB
/
irohaBoard_Installer.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
while :
do
echo "Set Mysql root Password"
read -srp "Password: " sqlPass
echo
echo "Retype Mysql root Password"
read -srp "Password: " RsqlPass
echo
if [ $sqlPass = $RsqlPass ]; then
break
else
echo -e "\e[41mPassword is incorrect\e[m"
fi
done
echo
sed -ie "s/mysqlPass/$sqlPass/" ./irohaBoard_Installer_MySQL.cnf
while :
do
echo "Set Mysql User irohaBoard root Password"
read -srp "Password: " irohaPass
echo
echo "Retype Mysql User irohaBoard root Password"
read -srp "Password: " RirohaPass
echo
if [ $irohaPass = $RirohaPass ]; then
break
else
echo -e "\e[41mPassword is incorrect\e[m"
fi
done
echo
sed -ie "s/irohaPass/$irohaPass/" ./irohaBoard_Installer_MySQL.sql
while :
do
echo "Set Mysql User irohaBoard remote Password"
read -srp "Password: " irohaRemotePass
echo
echo "Retype Mysql User irohaBoard remote Password"
read -srp "Password: " RirohaRemotePass
echo
if [ $irohaRemotePass = $RirohaRemotePass ]; then
break
else
echo -e "\e[41mPassword is incorrect\e[m"
fi
done
echo
sed -ie "s/irohaRemotePass/$irohaRemotePass/" ./irohaBoard_Installer_MySQL.sql
echo -e "\e[33mPackage\e[m"
echo -e "\e[34mPackage Update\e[m"
apt update
echo -e "\e[34mPackage Install\e[m"
apt install -y php php-common php-mysql php-intl php-mbstring composer apache2 libapache2-mod-php mysql-server
echo -e "\e[33mPHP\e[m"
echo -e "\e[34mPHP Setting\e[m"
phpenmod pdo pdo_mysql mysqli mysqlnd
echo -e "\e[33mApache\e[m"
echo -e "\e[34mApache System Setting\e[m"
systemctl enable apache2
systemctl start apache2
echo -e "\e[34mApache Setting\e[m"
a2enmod rewrite
sed -ie '/Directory \/var\/www/,/Directory/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
systemctl restart apache2
echo -e "\e[33mMySQL\e[m"
echo -e "\e[34mMySQL System Setting\e[m"
systemctl enable mysql
systemctl start mysql
echo -e "\e[34mMySQL Setting\e[m"
mysql --defaults-extra-file=irohaBoard_Installer_MySQL.cnf < irohaBoard_Installer_MySQL.sql
sed -ie '/\[mysqld\]/a sql_mode=ALLOW_INVALID_DATES' /etc/mysql/mysql.conf.d/mysqld.cnf
echo -e "\e[33mCakePHP\e[m"
wget https://github.com/cakephp/cakephp/archive/2.10.7.tar.gz
tar xvf ./2.10.7.tar.gz
mv cakephp-2.10.7/ /var/www/cake/
echo -e "\e[33mirohaBoard\e[m"
wget https://github.com/irohasoft/irohaboard/archive/v0.9.13.tar.gz
tar xvf ./v0.9.13.tar.gz
rm -d -r -f /var/www/html/
mv irohaboard-0.9.13/ /var/www/html/
sed -ie "s/'login' => 'root',/'login' => 'ib_user',/g" /var/www/html/Config/database.php
sed -ie "s/'password' => '',/'password' => '$irohaPass',/g" /var/www/html/Config/database.php
sed -ie "s/'database' => 'hiiragi2',/'database' => 'ib',/g" /var/www/html/Config/database.php
sudo chown -R www-data:www-data /var/www/
echo
echo "Login ID: root"
echo "Password: irohaboard"
echo "Please change your password immediately after login"
echo -e "\e[33mRestart by pressing Enter key\e[m"
read
reboot
exit 0