-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlamp.sh
67 lines (53 loc) · 2 KB
/
lamp.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
# This script installs a basic LAMP stack on a virtual machine - developed with CentOS in mind
# The script successfully ends with the output of installed LAMP services versions
#!/bin/bash
set -e
echo "==============================="
echo "Enabling repositories."
echo "==============================="
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
echo "==============================="
echo "Installing Apache service."
echo "==============================="
yum --enablerepo=epel,remi install httpd -y
echo "==============================="
echo "Configuring Apache service."
echo "==============================="
systemctl enable httpd.service
systemctl start httpd.service
echo "==============================="
echo "Installing MySQL service."
echo "==============================="
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
yum install mysql-server -y
echo "==============================="
echo "Configuring MySQL service."
echo "==============================="
systemctl enable mysqld.service
systemctl start mysqld.service
mysql=`grep 'A temporary password' /var/log/mysqld.log | tail -n1`
echo "Temporary password for MySQL is:"
echo "$mysql"
mysql_secure_installation
echo "==============================="
echo "Installing PHP service."
echo "==============================="
yum --enablerepo=epel,remi-php73 install php -y
yum --enablerepo=remi-php73 list php-*
yum --enablerepo=remi-php73 install php-mysql php-xml php-xmlrpc php-soap php-gd -y
echo "==============================="
echo "Configuring MySQL service."
echo "==============================="
systemctl restart httpd.service
echo "==============================="
echo "Installing git"
echo "==============================="
sudo yum install git
echo "==============================="
echo "Verifying all installed."
echo "==============================="
php -v
httpd -v
mysql -v
git --version