-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
54 lines (42 loc) · 1.63 KB
/
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
#!/bin/bash
echo "*****************************************************";
echo "*****************************************************";
echo "************* Starting Installation *****************";
echo "*****************************************************";
echo "*****************************************************";
LG='\033[0;37m'
CLOSE='\033[0m'
echo "\n\n\n"
echo "${LG} Installing Nginx, PHP7.1, Mysql and Git. \n\n\n ${CLOSE}"
# install Nginx, PHP7.1 & apache2
apt-get install apt-transport-https lsb-release ca-certificates
apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
apt-get install sudo
apt-get install mysql-server nginx php7.1 php7.1-mbstring php7.1-xml php7.1-pdo php7.1-mysql git certbot || exit
# apt-get -y install libapache2-mod-rpaf
# copy nginx config
sudo cp default /etc/nginx/sites-available/default
ln /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
#sudo cp proxy_params /etc/nginx/proxy_params
# Install git
git config --global user.name "Username"
git config --global user.email "email"
sudo mkdir /var/www/.ssh
sudo chown -R www-data:www-data /var/www/.ssh/
sudo -Hu www-data ssh-keygen -t rsa # choose "no passphrase"
sudo cat /var/www/.ssh/id_rsa.pub
# Installing Firewall
apt-get install ufw || echo "Installation Failed" && exit
sudo ufw allow 22/tcp
sudo ufw allow ssh
sudo ufw allow 'Nginx HTTP'
systemctl enable nginx.service
service nginx restart
service apache2 restart
sudo ufw status
sudo ufw app list
echo "here's your SSH key!"
sudo cat /var/www/.ssh/id_rsa.pub