-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_lamp_stack.sh
29 lines (26 loc) · 1.15 KB
/
install_lamp_stack.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
#!/bin/bash
# ******************************************
# Program: LAMP Stack Installation Script
# ******************************************
if [ "`lsb_release -is`" == "Ubuntu" ] || [ "`lsb_release -is`" == "Debian" ]
then
sudo apt-get -y install mysql-server mysql-client mysql-workbench libmysqld-dev;
sudo apt-get -y install apache2 php5 libapache2-mod-php5 php5-mcrypt phpmyadmin;
sudo chmod 755 -R /var/www/;
sudo printf "<?php\nphpinfo();\n?>" > /var/www/html/info.php;
sudo service apache2 restart;
elif [ "`lsb_release -is`" == "CentOS" ] || [ "`lsb_release -is`" == "RedHat" ]
then
sudo yum -y install httpd mysql-server mysql-devel php php-mysql php-fpm;
sudo yum -y install epel-release phpmyadmin rpm-build redhat-rpm-config;
sudo yum -y install mysql-community-release-el7-5.noarch.rpm proj;
sudo yum -y install tinyxml libzip mysql-workbench-community;
sudo chmod 777 -R /var/www/;
sudo printf "<?php\nphpinfo();\n?>" > /var/www/html/info.php;
sudo service mysqld restart;
sudo service httpd restart;
sudo chkconfig httpd on;
sudo chkconfig mysqld on;
else
echo "Unsupported Operating System";
fi