-
Notifications
You must be signed in to change notification settings - Fork 4
/
install
executable file
·122 lines (97 loc) · 4.45 KB
/
install
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/data/data/com.termux/files/usr/bin/bash
######################################################
# INSTANT INSTALASI WEBSERVER APACHE MYSQL PHPMYADMIN#
# RYUGEN XD #
#####################################################
DIR="/sdcard/htdocs"
termux-setup-storage
printf "\033[1;33m update package manager database\033[0m\n"; #sekedar refresh database package manager (apt) tanpa peningkatan versi package yang terinstall untuk menghindari peningkatan versi secara tidak sengaja dan tidak diperlukan.
# pkg update -y <<EOF
# pkg upgrade -y
# EOF #add anu anu
sleep 2;
# check if folder not exist
if [ ! -d "$DIR" ]; then
mkdir $DIR
fi
printf "\033[1;33m install php\033[0m\n"; #perintah menggunakan argumen "-y" untuk menghindari interaktifitas yang tidak diperlukan dikarenakan dependensi wajib.
pkg install php -y;
printf "\033[1;33m install composer\033[0m\n";
pkg install composer -y;
printf "\033[1;33m install mysql-Mariadb\033[0m\n";
pkg install mariadb -y;
printf "\033[1;33m install apache2\033[0m\n";
pkg install apache2 -y;
printf "\033[1;33m install phpmyadmin\033[0m\n";
pkg install phpmyadmin -y;
printf "\033[1;33m install php-apache\033[0m\n";
pkg install php-apache -y;
printf "\033[1;33m # Updata and Upgrade packages\033[0m\n";
$DOCUMENT_ROOT = "/sdcard";
$PHPMYSQL_DIR = "$DOCUMENT_ROOT/phpmyadmin";
if [ ! -d "$PHPMYSQL_DIR" ]; then
mkdir $PHPMYSQL_DIR
fi
printf "\033[1;33m # Setting konfigurasi server ...\033[0m\n";
rm -rf $PREFIX/etc/apache2/extra;
cp -rf config_files/extra $PREFIX/etc/apache2;
rm -f $PREFIX/etc/apache2/httpd.conf;
cp -f config_files/httpd.conf $PREFIX/etc/apache2;
httpd -t;
rm -f $PREFIX/share/phpmyadmin/config.inc.php;
cp -f config_files/config.inc.php $PREFIX/share/phpmyadmin;
mv $PREFIX/share/phpmyadmin/* $PHPMYSQL_DIR; #add anu anu
printf "\033[1;33m install selesai full size: 700mb \033[1;31m^\033[0m\n";
printf "\033[1;33m # Setting konfigurasi mysql\033[0m\n";
# =========== mysql settings
#!/data/data/com.termux/files/usr/bin/bash
PACKAGE_NAME="
███████╗██╗░░██╗███████╗██╗░░░░░██╗░░░░░
╚════██║██║░░██║██╔════╝██║░░░░░██║░░░░░
░░███╔═╝███████║█████╗░░██║░░░░░██║░░░░░
██╔══╝░░██╔══██║██╔══╝░░██║░░░░░██║░░░░░
███████╗██║░░██║███████╗███████╗███████╗ SERVER
╚══════╝╚═╝░░╚═╝╚══════╝╚══════╝╚══════╝
"
printf "\033[1;33m konfigurasi : MySQL \033[0m\n"
# Mulai MySQL daemon
mysqld_safe --skip-grant-tables &
printf "\033[1;34mLOADING ...!\n"
# Tunggu hingga MySQL daemon selesai diinisialisasi
sleep 6
# Login ke akun root MySQL menggunakan perintah mysql
mariadb -u root <<EOF
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
FLUSH PRIVILEGES;
exit;
EOF
# Tambahkan perintah untuk memulai Apache dan MySQL daemon di bash.bashrc dan cek apakah sudah ada jika suda maka tidak pelu di tambahkan
if ! grep -q "mysqld_safe --skip-grant-tables &" "$PREFIX/etc/bash.bashrc"; then
echo "mysqld_safe &" >> "$PREFIX/etc/bash.bashrc"
fi
if ! grep -q "apachectl start" "$PREFIX/etc/bash.bashrc"; then
echo "apachectl start" >> "$PREFIX/etc/bash.bashrc"
fi
# Bersihkan layar konsol
clear
printf "\033[1;32m$PACKAGE_NAME"
# Tampilkan pesan sukses dan keterangan login
printf "\033[33mKonfigurasi Database:\n \033[41;37mHOST\033[0m : 127.0.0.1\n \033[41;37mUSERNAME\033[0m : root\n \033[41;37mPASSWORD\033[0m : root\n"
printf "\033[32mKonfigurasi Berhasil!"
printf "\n\033[0m-------------------------------"
printf "\n\033[1;33mURL LOCAL SEVER : \033[1;34mhttp://localhost:8080\033[1;33m"
printf "\nHTDOCS PATCH : \033[1;34mlokasi htdocs tersimpan di memory internal android dengan nama folder: \033[41;37mhtdocs\033[0m"
printf "\033[1;32m\nSelamat Bro!\n"
printf "\033[1;33mWARNING : \033[41;37mServer Lokal tidak akan berjalan jika aplikasi termux tidak di reload !\033[0m"
while [ true ]
do
printf "\n\n\033[1;32mReload (\033[1;33mketik y lalu enter\033[0m):\033[0m "
read confirm
if [ "$confirm" = "y" ]
then
termux-reload-settings
login
printf "\033[41;37mExit Lagi Masbro .... \033[0m"
break
fi
done