-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_lamp_1.sh
37 lines (29 loc) · 1.01 KB
/
install_lamp_1.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
#!/bin/bash
##Require allerver and then install the lamp stack
sudo yum update -y
## install PHP 55
## this also installs apache as it's a dependecy in amazons version of php55
sudo yum install -y php55 php55-mysqlnd php55-bcmath php55-gd php55-xml php55-mbstring php55-mcrypt php55-soap php55-xml
## install mysql
sudo yum install -y mysql-server
## install git
sudo yum install -y git
## start apache
sudo service httpd start
sudo chkconfig httpd on
## add a www user group
sudo groupadd www
sudo usermod -a -G www ec2-user
## start mysql and make it slightly more secure
sudo service mysqld start
sudo chkconfig mysqld on
sudo mysql_secure_installation
## micro instances don't come with swap files so we need to make one
## adding line to fstab so it's enabled on boot
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo chmod 0600 /swapfile
sudo swapon /swapfile
sudo sed -i '$ a\/swapfile swap swap defaults 0 0' /etc/fstab
# reboot to force logout
sudo reboot