-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
61 lines (39 loc) · 1.17 KB
/
setup
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
#!$PREFIX/bin/bash
if [ ! -d ~/storage ];
then
termux-setup-storage
fi
sleep 5
pkg install php-apache -y
rm $PREFIX/etc/apache2/httpd.conf
cp httpd.conf $PREFIX/etc/apache2/
rm $PREFIX/etc/apache2/extra/httpd-ssl.conf
cp httpd-ssl.conf $PREFIX/etc/apache2/extra/
pkg install openssl-tool -y
openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes -subj '/CN=localhost'
mv -f server.crt $PREFIX/etc/apache2/
mv -f server.key $PREFIX/etc/apache2/
rm -f $PREFIX/bin/tamp
chmod +x tamp
cp tamp $PREFIX/bin/
pkg install mariadb composer -y
mkdir -p /sdcard/htdocs
cp -n .htaccess /sdcard/htdocs/
php_info='/sdcard/htdocs/phpinfo'
if [ ! -d $php_info ];
then
mkdir $php_info
echo "<?php phpinfo(); ?>" > $php_info/index.php
fi
if [ ! -d /sdcard/htdocs/phpmyadmin ];
then
cd /sdcard/htdocs && composer create-project phpmyadmin/phpmyadmin
fi
cd ~/tamp && cp -f config.inc.php /sdcard/htdocs/phpmyadmin/config.inc.php
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
echo "TAMP installed sucessfully."
echo "/sdcard/htdocs - is your document directory."
echo "Place your files in /sdcard/htdocs"
echo -e "Run: ${YELLOW}tamp start${NC}"
#tamp-setup