-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlemp-server.sh
More file actions
55 lines (44 loc) · 2.04 KB
/
lemp-server.sh
File metadata and controls
55 lines (44 loc) · 2.04 KB
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
#!/bin/sh
##################################################################################
# Bash script to install an LEMP stack plus tweaks. For Ubuntu based systems.
# Written by @eftakhairul from https://eftakahirul.com
#
#
# RUN: bash <(curl -s https://raw.githubusercontent.com/eftakhairul/helpful-scripts/master/lemp-server.sh)
###################################################################################
#COLORS
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
# Update packages and Upgrade system
echo -e "$Cyan \n Updating System.. $Color_Off"
sudo apt-get update -y && sudo apt-get upgrade -y
# Installing essentials packages
echo -e "$Cyan \n Installing Essentials Packages $Color_Off"
sudo apt-get -y install python-software-properties
sudo apt-get -y install software-properties-common
## Install LEMP
echo -e "$Cyan \n Installing Nginx $Color_Off"
sudo apt-get install nginx -y
echo -e "$Cyan \n Installing PHP & Requirements $Color_Off"
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update && sudo apt-get -y install php7.1-fpm php7.1-mysql php7.1-curl php7.1-gd php7.1-mcrypt php7.1-sqlite3 php7.1-bz2 php7.1-mbstrin php7.1-soap php7.1-xml php7.1-zip
echo -e "$Cyan \n Installing Composer $Color_Off"
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
echo -e "$Cyan \n Installing MySQL $Color_Off"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password 123456'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password 123456'
sudo apt-get -y install mysql-server
## TWEAKS and Settings
# Permissions
echo -e "$Cyan \n Permissions for /var/www $Color_Off"
sudo chown -R www-data:www-data /var/www
echo -e "$Green \n Permissions have been set $Color_Off"
# Restart Nginx
echo -e "$Cyan \n Restarting Nginx $Color_Off"
sudo /etc/init.d/nginx restart