-
Notifications
You must be signed in to change notification settings - Fork 0
/
first_run.sh
executable file
·33 lines (24 loc) · 1017 Bytes
/
first_run.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
#!/bin/bash
#--- Define text colors
CSI="\033["
CEND="${CSI}0m"
CGREEN="${CSI}1;32m"
CYELLOW="${CSI}1;33m"
echo -e "${CYELLOW} upgrading system...$CEND"
sudo apt-get -y update && sudo apt-get -y upgrade
echo -e "${CYELLOW} Installing pre-requsites...$CEND"
sudo apt-get -y install git curl
echo -e "${CYELLOW} Installing nginx...$CEND"
sudo apt-get -y install nginx
echo -e "${CYELLOW} Set basic nginx configuration...$CEND"
mkdir -p /etc/nginx/conf.d/ssl /etc/nginx/conf.d/common
cp files/ssl_conf /etc/nginx/conf.d/ssl/
cp files/common_conf /etc/nginx/conf.d/common/
cp files/default.conf /etc/nginx/conf.d/
echo -e "${CYELLOW} Generating Diffie-Hellman strong parameters (might take a while)...$CEND"
openssl dhparam -out /etc/nginx/conf.d/ssl/dhparams.pem 4096
chmod 600 /etc/nginx/conf.d/ssl/dhparams.pem
echo -e "${CYELLOW} Installing letsencrypt...$CEND"
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
echo -e "${CYELLOW} Restarting nginx...$CEND"
/etc/init.d/nginx reload