Skip to content

Commit b77d2b2

Browse files
committed
Update hst-install.sh to “drop” support for 16.04
Removed the option —nginx no to stop Apache2 as “Webserver” without nginx as proxy. There for saving us time on development and testing
1 parent f21a68a commit b77d2b2

File tree

3 files changed

+67
-105
lines changed

3 files changed

+67
-105
lines changed

install/hst-install-debian.sh

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ installer_dependencies="apt-transport-https curl dirmngr gnupg wget ca-certifica
7171
help() {
7272
echo "Usage: $0 [OPTIONS]
7373
-a, --apache Install Apache [yes|no] default: yes
74-
-n, --nginx Install Nginx [yes|no] default: yes
7574
-w, --phpfpm Install PHP-FPM [yes|no] default: yes
7675
-o, --multiphp Install Multi-PHP [yes|no] default: no
7776
-v, --vsftpd Install Vsftpd [yes|no] default: yes
@@ -162,7 +161,6 @@ for arg; do
162161
delim=""
163162
case "$arg" in
164163
--apache) args="${args}-a " ;;
165-
--nginx) args="${args}-n " ;;
166164
--phpfpm) args="${args}-w " ;;
167165
--vsftpd) args="${args}-v " ;;
168166
--proftpd) args="${args}-j " ;;
@@ -194,10 +192,9 @@ done
194192
eval set -- "$args"
195193

196194
# Parsing arguments
197-
while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:D:fh" Option; do
195+
while getopts "a:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:D:fh" Option; do
198196
case $Option in
199197
a) apache=$OPTARG ;; # Apache
200-
n) nginx=$OPTARG ;; # Nginx
201198
w) phpfpm=$OPTARG ;; # PHP-FPM
202199
o) multiphp=$OPTARG ;; # Multi-PHP
203200
v) vsftpd=$OPTARG ;; # Vsftpd
@@ -433,9 +430,9 @@ clear
433430
install_welcome_message
434431

435432
# Web stack
436-
if [ "$nginx" = 'yes' ]; then
437-
echo ' - NGINX Web / Proxy Server'
438-
fi
433+
434+
echo ' - NGINX Web / Proxy Server'
435+
439436
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
440437
echo ' - Apache Web Server'
441438
fi
@@ -585,11 +582,10 @@ echo "Adding required repositories to proceed with installation:"
585582
echo
586583

587584
# Installing Nginx repo
588-
if [ "$nginx" = 'yes' ]; then
589-
echo "[ * ] NGINX"
590-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
591-
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
592-
fi
585+
echo "[ * ] NGINX"
586+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
587+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
588+
593589

594590
# Installing sury PHP repo
595591
echo "[ * ] PHP"
@@ -732,9 +728,7 @@ fi
732728

733729
# Excluding packages
734730
software=$(echo "$software" | sed -e "s/apache2.2-common//")
735-
if [ "$nginx" = 'no' ]; then
736-
software=$(echo "$software" | sed -r -e 's/(\s|^)nginx(\s|$)/ /')
737-
fi
731+
738732
if [ "$apache" = 'no' ]; then
739733
software=$(echo "$software" | sed -e "s/apache2 //")
740734
software=$(echo "$software" | sed -e "s/apache2-bin//")
@@ -980,15 +974,7 @@ touch $HESTIA/conf/hestia.conf
980974
chmod 660 $HESTIA/conf/hestia.conf
981975

982976
# Web stack
983-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
984-
echo "WEB_SYSTEM='apache2'" >> $HESTIA/conf/hestia.conf
985-
echo "WEB_RGROUPS='www-data'" >> $HESTIA/conf/hestia.conf
986-
echo "WEB_PORT='80'" >> $HESTIA/conf/hestia.conf
987-
echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
988-
echo "WEB_SSL='mod_ssl'" >> $HESTIA/conf/hestia.conf
989-
echo "STATS_SYSTEM='awstats'" >> $HESTIA/conf/hestia.conf
990-
fi
991-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
977+
if [ "$apache" = 'yes' ]; then
992978
echo "WEB_SYSTEM='apache2'" >> $HESTIA/conf/hestia.conf
993979
echo "WEB_RGROUPS='www-data'" >> $HESTIA/conf/hestia.conf
994980
echo "WEB_PORT='8080'" >> $HESTIA/conf/hestia.conf
@@ -999,7 +985,7 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
999985
echo "PROXY_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
1000986
echo "STATS_SYSTEM='awstats'" >> $HESTIA/conf/hestia.conf
1001987
fi
1002-
if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
988+
if [ "$apache" = 'no' ]; then
1003989
echo "WEB_SYSTEM='nginx'" >> $HESTIA/conf/hestia.conf
1004990
echo "WEB_PORT='80'" >> $HESTIA/conf/hestia.conf
1005991
echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
@@ -1160,35 +1146,33 @@ cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
11601146
# Configure Nginx #
11611147
#----------------------------------------------------------#
11621148

1163-
if [ "$nginx" = 'yes' ]; then
1164-
echo "[ * ] Configuring NGINX..."
1165-
rm -f /etc/nginx/conf.d/*.conf
1166-
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1167-
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1168-
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1169-
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1170-
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1171-
mkdir -p /etc/nginx/conf.d/domains
1172-
mkdir -p /etc/nginx/modules-enabled
1173-
mkdir -p /var/log/nginx/domains
1174-
1175-
# Update dns servers in nginx.conf
1176-
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1177-
for ip in $dns_resolver; do
1178-
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1179-
resolver="$ip $resolver"
1180-
fi
1181-
done
1182-
if [ ! -z "$resolver" ]; then
1183-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1184-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
1149+
echo "[ * ] Configuring NGINX..."
1150+
rm -f /etc/nginx/conf.d/*.conf
1151+
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1152+
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1153+
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1154+
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1155+
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1156+
mkdir -p /etc/nginx/conf.d/domains
1157+
mkdir -p /etc/nginx/modules-enabled
1158+
mkdir -p /var/log/nginx/domains
1159+
1160+
# Update dns servers in nginx.conf
1161+
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1162+
for ip in $dns_resolver; do
1163+
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1164+
resolver="$ip $resolver"
11851165
fi
1186-
1187-
update-rc.d nginx defaults > /dev/null 2>&1
1188-
systemctl start nginx >> $LOG
1189-
check_result $? "nginx start failed"
1166+
done
1167+
if [ ! -z "$resolver" ]; then
1168+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1169+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
11901170
fi
11911171

1172+
update-rc.d nginx defaults > /dev/null 2>&1
1173+
systemctl start nginx >> $LOG
1174+
check_result $? "nginx start failed"
1175+
11921176

11931177
#----------------------------------------------------------#
11941178
# Configure Apache #

install/hst-install-ubuntu.sh

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ installer_dependencies="apt-transport-https curl dirmngr gnupg wget software-pro
5252
help() {
5353
echo "Usage: $0 [OPTIONS]
5454
-a, --apache Install Apache [yes|no] default: yes
55-
-n, --nginx Install Nginx [yes|no] default: yes
5655
-w, --phpfpm Install PHP-FPM [yes|no] default: yes
5756
-o, --multiphp Install Multi-PHP [yes|no] default: no
5857
-v, --vsftpd Install Vsftpd [yes|no] default: yes
@@ -143,7 +142,6 @@ for arg; do
143142
delim=""
144143
case "$arg" in
145144
--apache) args="${args}-a " ;;
146-
--nginx) args="${args}-n " ;;
147145
--phpfpm) args="${args}-w " ;;
148146
--vsftpd) args="${args}-v " ;;
149147
--proftpd) args="${args}-j " ;;
@@ -175,10 +173,9 @@ done
175173
eval set -- "$args"
176174

177175
# Parsing arguments
178-
while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:D:fh" Option; do
176+
while getopts "a:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:D:fh" Option; do
179177
case $Option in
180178
a) apache=$OPTARG ;; # Apache
181-
n) nginx=$OPTARG ;; # Nginx
182179
w) phpfpm=$OPTARG ;; # PHP-FPM
183180
o) multiphp=$OPTARG ;; # Multi-PHP
184181
v) vsftpd=$OPTARG ;; # Vsftpd
@@ -407,9 +404,7 @@ clear
407404
install_welcome_message
408405

409406
# Web stack
410-
if [ "$nginx" = 'yes' ]; then
411-
echo ' - NGINX Web / Proxy Server'
412-
fi
407+
echo ' - NGINX Web / Proxy Server'
413408
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
414409
echo ' - Apache Web Server'
415410
fi
@@ -559,11 +554,9 @@ echo "Adding required repositories to proceed with installation:"
559554
echo
560555

561556
# Installing Nginx repo
562-
if [ "$nginx" = 'yes' ]; then
563-
echo "[ * ] NGINX"
564-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
565-
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
566-
fi
557+
echo "[ * ] NGINX"
558+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
559+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
567560

568561
# Installing sury PHP repo
569562
echo "[ * ] PHP"
@@ -704,10 +697,7 @@ fi
704697

705698
# Excluding packages
706699
software=$(echo "$software" | sed -e "s/apache2.2-common//")
707-
if [ "$nginx" = 'no' ]; then
708-
software=$(echo "$software" | sed -r -e 's/(\s|^)nginx(\s|$)/ /')
709700

710-
fi
711701
if [ "$apache" = 'no' ]; then
712702
software=$(echo "$software" | sed -e "s/apache2 //")
713703
software=$(echo "$software" | sed -e "s/apache2-bin//")
@@ -1018,16 +1008,7 @@ rm -f $HESTIA/conf/hestia.conf > /dev/null 2>&1
10181008
touch $HESTIA/conf/hestia.conf
10191009
chmod 660 $HESTIA/conf/hestia.conf
10201010

1021-
# Web stack
1022-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
1023-
echo "WEB_SYSTEM='apache2'" >> $HESTIA/conf/hestia.conf
1024-
echo "WEB_RGROUPS='www-data'" >> $HESTIA/conf/hestia.conf
1025-
echo "WEB_PORT='80'" >> $HESTIA/conf/hestia.conf
1026-
echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
1027-
echo "WEB_SSL='mod_ssl'" >> $HESTIA/conf/hestia.conf
1028-
echo "STATS_SYSTEM='awstats'" >> $HESTIA/conf/hestia.conf
1029-
fi
1030-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
1011+
if [ "$apache" = 'yes' ]; then
10311012
echo "WEB_SYSTEM='apache2'" >> $HESTIA/conf/hestia.conf
10321013
echo "WEB_RGROUPS='www-data'" >> $HESTIA/conf/hestia.conf
10331014
echo "WEB_PORT='8080'" >> $HESTIA/conf/hestia.conf
@@ -1038,7 +1019,7 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
10381019
echo "PROXY_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
10391020
echo "STATS_SYSTEM='awstats'" >> $HESTIA/conf/hestia.conf
10401021
fi
1041-
if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
1022+
if [ "$apache" = 'no' ]; then
10421023
echo "WEB_SYSTEM='nginx'" >> $HESTIA/conf/hestia.conf
10431024
echo "WEB_PORT='80'" >> $HESTIA/conf/hestia.conf
10441025
echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
@@ -1199,35 +1180,32 @@ cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
11991180
# Configure Nginx #
12001181
#----------------------------------------------------------#
12011182

1202-
if [ "$nginx" = 'yes' ]; then
1203-
echo "[ * ] Configuring NGINX..."
1204-
rm -f /etc/nginx/conf.d/*.conf
1205-
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1206-
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1207-
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1208-
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1209-
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1210-
mkdir -p /etc/nginx/conf.d/domains
1211-
mkdir -p /etc/nginx/modules-enabled
1212-
mkdir -p /var/log/nginx/domains
1213-
1214-
# Update dns servers in nginx.conf
1215-
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1216-
for ip in $dns_resolver; do
1217-
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1218-
resolver="$ip $resolver"
1219-
fi
1220-
done
1221-
if [ ! -z "$resolver" ]; then
1222-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1223-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
1183+
echo "[ * ] Configuring NGINX..."
1184+
rm -f /etc/nginx/conf.d/*.conf
1185+
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1186+
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1187+
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1188+
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1189+
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1190+
mkdir -p /etc/nginx/conf.d/domains
1191+
mkdir -p /etc/nginx/modules-enabled
1192+
mkdir -p /var/log/nginx/domains
1193+
1194+
# Update dns servers in nginx.conf
1195+
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1196+
for ip in $dns_resolver; do
1197+
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1198+
resolver="$ip $resolver"
12241199
fi
1225-
1226-
update-rc.d nginx defaults > /dev/null 2>&1
1227-
systemctl start nginx >> $LOG
1228-
check_result $? "nginx start failed"
1200+
done
1201+
if [ ! -z "$resolver" ]; then
1202+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1203+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
12291204
fi
12301205

1206+
update-rc.d nginx defaults > /dev/null 2>&1
1207+
systemctl start nginx >> $LOG
1208+
check_result $? "nginx start failed"
12311209

12321210
#----------------------------------------------------------#
12331211
# Configure Apache #

install/hst-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Currently Supported Operating Systems:
77
#
88
# Debian 9, 10
9-
# Ubuntu 16.04, 18.04, 20.04
9+
# Ubuntu 18.04, 20.04
1010
#
1111

1212
# Am I root?
@@ -99,7 +99,7 @@ check_wget_curl(){
9999

100100
# Check for supported operating system before proceeding with download
101101
# of OS-specific installer, and throw error message if unsupported OS detected.
102-
if [[ "$release" =~ ^(9|10|16.04|18.04|20.04)$ ]]; then
102+
if [[ "$release" =~ ^(9|10|18.04|20.04)$ ]]; then
103103
check_wget_curl $*
104104
else
105105
no_support_message

0 commit comments

Comments
 (0)