-
Notifications
You must be signed in to change notification settings - Fork 2
/
lamp-install.sh
59 lines (40 loc) · 1.29 KB
/
lamp-install.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
#!/bin/bash
# ARE YOU ROOT (or sudo)?
if [[ $EUID -ne 0 ]]; then
echo -e "\e[91mERROR: This script must be run as root\e[0m"
exit 1
fi
######################################
echo "***** APACHE INSTALLATION *****"
######################################
./apache-install.sh
#############################################
echo "***** MYSQL/MARIADB INSTALLATION *****"
#############################################
./mysql-install.sh
###################################
echo "***** PHP INSTALLATION *****"
###################################
./php-install.sh
############################
# Set up a new virtual host:
############################
./apache-add-virtual-host.sh
if [ -x "$(command -v iptables)" ]; then
###########################################
echo "***** FIREWALL SETUP (port 80) *****"
###########################################
./iptables-accept-http.sh \*
fi
########################################
echo "***** RESTARTING SERVERS... *****"
########################################
service apache2 restart
if [ -x "$(command -v yum)" ]; then
service php-fpm restart
elif [ -x "$(command -v apt-get)" ]; then
php_version=$(php -v | head -1 | cut -d " " -f 2 | cut -d "." -f 1-2)
service php$php_version-fpm restart
fi
service mysql restart
echo "***** READY! ALL DONE ;) *****"