-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-script.sh
143 lines (81 loc) · 4.77 KB
/
build-script.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
printf "\n##################################################"
printf "\n# #"
printf "\n# #"
printf "\n# SETUP SCRIPT START #"
printf "\n# #"
printf "\n# #"
printf "\n##################################################\n\n"
printf "##### Entering build-script.sh\n\n" >> /root/report/build-report.txt
pushd /root/bin
printf "\n########## SCRIPT EXECUTION PARTICULARS ##########\n\n"
. /root/bin/setup.conf
printf "\n******/root/bin/setup.conf******\n" >> /root/report/build-report.txt
printf "%s" "$(</root/bin/setup.conf)" >> /root/report/build-report.txt
printf "\n******/root/bin/setup.conf******\n" >> /root/report/build-report.txt
printf "\n########## CONFIGURE THE HOSTNAME & HOSTS OVERRIDES ###\n"
. /root/bin/scripts/00000-make-environment-variables-persist.sh
printf "\n########## CONFIGURE THE HOSTNAME & HOSTS OVERRIDES ###\n"
. /root/bin/scripts/00100-configure-hostname.sh
printf "\n########## SET THE TIMEZONE & TIME ###\n\n"
. /root/bin/scripts/00200-configure-time.sh
printf "\n########## APT SOURCES, FIRST UPDATE, & COMMON PACKAGES INSTALL ###\n\n"
. /root/bin/scripts/00300-update-system.sh
printf "\n########## ALLOW SUPPLEMENTAL SSH ALGORITHMS ###\n"
. /root/bin/scripts/00400-configure-sshd.sh
printf "\n########## UPDATE THE IPTABLES RULES ###\n"
. /root/bin/scripts/00500-configure-iptables.sh
printf "\n########## CONFIGURE FAIL2BAN ###\n"
. /root/bin/scripts/00600-configure-fail2ban.sh
printf "\n########## INSTALL NGINX ###\n"
. /root/bin/scripts/00700-install-nginx-and-php7-fpm.sh
printf "\n########## INSTALL MYSQL ###\n"
. /root/bin/scripts/00800-install-and-configure-mysql.sh
printf "\n########## CREATE WEBROOT FILE STRUCTURE ###\n"
. /root/bin/scripts/00900-create-webroot-file-structure.sh
printf "\n########## CONFIGURE DEVELOPMENT INSTANCE PACKAGES ###\n"
. /root/bin/scripts/01000-configure-dev-resources.sh
printf "\n########## CONFIGURE NGINX AND PHP-FPM ###\n\n"
. /root/bin/scripts/01100-configure-nginx-and-php7-fpm.sh
printf "\n########## INSTALL WEBDEVELOPER RESOURCES ###\n"
. /root/bin/scripts/01300-install-dev-tools.sh
printf "\n########## INSTALL AND CONFIGURE MAIL ###\n"
. /root/bin/scripts/01400-install-and-configure-system-mail.sh
printf "\n########## INSTALL AND CONFIGURE SYSSTAT ###\n"
. /root/bin/scripts/01600-install-and-configure-sysstat.sh
#sed -i "s/ENABLED=\"false\"/ENABLED=\"true\"/" /etc/default/sysstat
printf "\n########## INSTALL AND CONFIGURE BACK END ASSETS ###\n"
. /root/bin/scripts/01700-install-back-end-assets.sh
printf "\n########## INSTALL NODEJS VIA N ###\n"
. /root/bin/scripts/01900-install-nodejs.sh
printf "\n########## INSTALL NODEJS PROJECT DEPENDENCIES ###\n"
. /root/bin/scripts/02100-install-front-end-tools.sh
printf "\n########## INSTALL REDIS ###\n"
. /root/bin/scripts/02300-install-redis.sh
printf "\n########## INSTALL MONITORING TOOLS ###\n"
# ToDo: install monitoring tools
#. /root/bin/scripts/02500-install-monitoring-tools.sh
printf "\n########## CLEAN UP ###\n"
printf "\nLast autoremove of packages\n\n"
apt-get -y autoremove
printf "\n########## START THE WEBSERVER SERVICES ###\n"
systemctl start php7.1-fpm
systemctl start nginx
printf "\n##################################################"
printf "\n# #"
printf "\n# #"
printf "\n# SETUP SCRIPT END #"
printf "\n# #"
printf "\n# #"
printf "\n##################################################\n\n"
#. /root/bin/scripts/troubleshooting.sh
#FIXME Commenting these until front end is squared away-- or I make an expect script for them and configuration settings for it.
printf "\n Add a person user. Best practices dictate using the root account less. ( ./add-web-person-user.sh $USERID1001 TRUE )\n"
#. /root/bin/add-web-person-user.sh $USERID1001 TRUE
#usermod -a --groups $WEBUSER $USERID1001
printf "\nSSL Certs come from a third-party, be sure to back up the applicable files and link them in the appropriate directory.\n"
printf "\nThinking inside my head that a few minutes of uptime is trivial at this point-- nobody is actually depending on the system being up or even using it at this exact moment-- a reboot might be a smart idea.\n"
printf "\nSet up Reverse DNS while you wait if applicable-- gets rid of those pesky problem with the server being referred to by the linode assigned machine name in most places."
date +%s >> /root/report/build-report.txt
#TODO remove this --exits the ssh connection
#exit 0