Skip to content

Commit 8eb5219

Browse files
author
Kristan Kenney
committed
Merge remote-tracking branch 'jaapmarcus/feature/disable-support-apache2-standalone' into main
2 parents c184675 + be674ae commit 8eb5219

File tree

3 files changed

+68
-105
lines changed

3 files changed

+68
-105
lines changed

install/hst-install-debian.sh

Lines changed: 36 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
@@ -182,7 +181,6 @@ for arg; do
182181
delim=""
183182
case "$arg" in
184183
--apache) args="${args}-a " ;;
185-
--nginx) args="${args}-n " ;;
186184
--phpfpm) args="${args}-w " ;;
187185
--vsftpd) args="${args}-v " ;;
188186
--proftpd) args="${args}-j " ;;
@@ -214,10 +212,9 @@ done
214212
eval set -- "$args"
215213

216214
# Parsing arguments
217-
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
215+
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
218216
case $Option in
219217
a) apache=$OPTARG ;; # Apache
220-
n) nginx=$OPTARG ;; # Nginx
221218
w) phpfpm=$OPTARG ;; # PHP-FPM
222219
o) multiphp=$OPTARG ;; # Multi-PHP
223220
v) vsftpd=$OPTARG ;; # Vsftpd
@@ -453,9 +450,9 @@ clear
453450
install_welcome_message
454451

455452
# Web stack
456-
if [ "$nginx" = 'yes' ]; then
457-
echo ' - NGINX Web / Proxy Server'
458-
fi
453+
454+
echo ' - NGINX Web / Proxy Server'
455+
459456
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
460457
echo ' - Apache Web Server'
461458
fi
@@ -605,11 +602,10 @@ echo "Adding required repositories to proceed with installation:"
605602
echo
606603

607604
# Installing Nginx repo
608-
if [ "$nginx" = 'yes' ]; then
609-
echo "[ * ] NGINX"
610-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
611-
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
612-
fi
605+
echo "[ * ] NGINX"
606+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
607+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
608+
613609

614610
# Installing sury PHP repo
615611
echo "[ * ] PHP"
@@ -752,9 +748,7 @@ fi
752748

753749
# Excluding packages
754750
software=$(echo "$software" | sed -e "s/apache2.2-common//")
755-
if [ "$nginx" = 'no' ]; then
756-
software=$(echo "$software" | sed -r -e 's/(\s|^)nginx(\s|$)/ /')
757-
fi
751+
758752
if [ "$apache" = 'no' ]; then
759753
software=$(echo "$software" | sed -e "s/apache2 //")
760754
software=$(echo "$software" | sed -e "s/apache2-bin//")
@@ -1000,15 +994,7 @@ touch $HESTIA/conf/hestia.conf
1000994
chmod 660 $HESTIA/conf/hestia.conf
1001995

1002996
# Web stack
1003-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
1004-
write_config_value "WEB_SYSTEM" "apache2"
1005-
write_config_value "WEB_RGROUPS" "www-data"
1006-
write_config_value "WEB_PORT" "80"
1007-
write_config_value "WEB_SSL_PORT" "443"
1008-
write_config_value "WEB_SSL" "mod_ssl"
1009-
write_config_value "STATS_SYSTEM" "awstats"
1010-
fi
1011-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
997+
if [ "$apache" = 'yes' ]; then
1012998
write_config_value "WEB_SYSTEM" "apache2"
1013999
write_config_value "WEB_RGROUPS" "www-data"
10141000
write_config_value "WEB_PORT" "8080"
@@ -1019,12 +1005,13 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
10191005
write_config_value "PROXY_SSL_PORT" "443"
10201006
write_config_value "STATS_SYSTEM" "awstats"
10211007
fi
1022-
if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
1008+
if [ "$apache" = 'no' ]; then
10231009
write_config_value "WEB_SYSTEM" "nginx"
10241010
write_config_value "WEB_PORT" "80"
10251011
write_config_value "WEB_SSL_PORT" "443"
10261012
write_config_value "WEB_SSL" "openssl"
10271013
write_config_value "STATS_SYSTEM" "awstats"
1014+
10281015
fi
10291016

10301017
if [ "$release" -ge 9 ] || [ "$multiphp" = 'yes' ]; then
@@ -1180,35 +1167,33 @@ cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
11801167
# Configure Nginx #
11811168
#----------------------------------------------------------#
11821169

1183-
if [ "$nginx" = 'yes' ]; then
1184-
echo "[ * ] Configuring NGINX..."
1185-
rm -f /etc/nginx/conf.d/*.conf
1186-
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1187-
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1188-
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1189-
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1190-
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1191-
mkdir -p /etc/nginx/conf.d/domains
1192-
mkdir -p /etc/nginx/modules-enabled
1193-
mkdir -p /var/log/nginx/domains
1194-
1195-
# Update dns servers in nginx.conf
1196-
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1197-
for ip in $dns_resolver; do
1198-
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1199-
resolver="$ip $resolver"
1200-
fi
1201-
done
1202-
if [ ! -z "$resolver" ]; then
1203-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1204-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
1170+
echo "[ * ] Configuring NGINX..."
1171+
rm -f /etc/nginx/conf.d/*.conf
1172+
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1173+
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1174+
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1175+
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1176+
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1177+
mkdir -p /etc/nginx/conf.d/domains
1178+
mkdir -p /etc/nginx/modules-enabled
1179+
mkdir -p /var/log/nginx/domains
1180+
1181+
# Update dns servers in nginx.conf
1182+
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1183+
for ip in $dns_resolver; do
1184+
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1185+
resolver="$ip $resolver"
12051186
fi
1206-
1207-
update-rc.d nginx defaults > /dev/null 2>&1
1208-
systemctl start nginx >> $LOG
1209-
check_result $? "nginx start failed"
1187+
done
1188+
if [ ! -z "$resolver" ]; then
1189+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1190+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
12101191
fi
12111192

1193+
update-rc.d nginx defaults > /dev/null 2>&1
1194+
systemctl start nginx >> $LOG
1195+
check_result $? "nginx start failed"
1196+
12121197

12131198
#----------------------------------------------------------#
12141199
# 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
@@ -163,7 +162,6 @@ for arg; do
163162
delim=""
164163
case "$arg" in
165164
--apache) args="${args}-a " ;;
166-
--nginx) args="${args}-n " ;;
167165
--phpfpm) args="${args}-w " ;;
168166
--vsftpd) args="${args}-v " ;;
169167
--proftpd) args="${args}-j " ;;
@@ -195,10 +193,9 @@ done
195193
eval set -- "$args"
196194

197195
# Parsing arguments
198-
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
196+
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
199197
case $Option in
200198
a) apache=$OPTARG ;; # Apache
201-
n) nginx=$OPTARG ;; # Nginx
202199
w) phpfpm=$OPTARG ;; # PHP-FPM
203200
o) multiphp=$OPTARG ;; # Multi-PHP
204201
v) vsftpd=$OPTARG ;; # Vsftpd
@@ -427,9 +424,7 @@ clear
427424
install_welcome_message
428425

429426
# Web stack
430-
if [ "$nginx" = 'yes' ]; then
431-
echo ' - NGINX Web / Proxy Server'
432-
fi
427+
echo ' - NGINX Web / Proxy Server'
433428
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
434429
echo ' - Apache Web Server'
435430
fi
@@ -579,11 +574,9 @@ echo "Adding required repositories to proceed with installation:"
579574
echo
580575

581576
# Installing Nginx repo
582-
if [ "$nginx" = 'yes' ]; then
583-
echo "[ * ] NGINX"
584-
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
585-
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
586-
fi
577+
echo "[ * ] NGINX"
578+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
579+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
587580

588581
# Installing sury PHP repo
589582
echo "[ * ] PHP"
@@ -724,10 +717,7 @@ fi
724717

725718
# Excluding packages
726719
software=$(echo "$software" | sed -e "s/apache2.2-common//")
727-
if [ "$nginx" = 'no' ]; then
728-
software=$(echo "$software" | sed -r -e 's/(\s|^)nginx(\s|$)/ /')
729720

730-
fi
731721
if [ "$apache" = 'no' ]; then
732722
software=$(echo "$software" | sed -e "s/apache2 //")
733723
software=$(echo "$software" | sed -e "s/apache2-bin//")
@@ -1039,16 +1029,7 @@ touch $HESTIA/conf/hestia.conf
10391029
chmod 660 $HESTIA/conf/hestia.conf
10401030

10411031
# Web stack
1042-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'no' ] ; then
1043-
write_config_value "WEB_SYSTEM" "apache2"
1044-
write_config_value "WEB_RGROUPS" "www-data"
1045-
write_config_value "WEB_PORT" "80"
1046-
write_config_value "WEB_SSL_PORT" "443"
1047-
write_config_value "WEB_SSL" "mod_ssl"
1048-
write_config_value "STATS_SYSTEM" "awstats"
1049-
fi
1050-
1051-
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
1032+
if [ "$apache" = 'yes' ]; then
10521033
write_config_value "WEB_SYSTEM" "apache2"
10531034
write_config_value "WEB_RGROUPS" "www-data"
10541035
write_config_value "WEB_PORT" "8080"
@@ -1060,7 +1041,7 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
10601041
write_config_value "STATS_SYSTEM" "awstats"
10611042
fi
10621043

1063-
if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
1044+
if [ "$apache" = 'no' ]; then
10641045
write_config_value "WEB_SYSTEM" "nginx"
10651046
write_config_value "WEB_PORT" "80"
10661047
write_config_value "WEB_SSL_PORT" "443"
@@ -1221,35 +1202,32 @@ cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
12211202
# Configure Nginx #
12221203
#----------------------------------------------------------#
12231204

1224-
if [ "$nginx" = 'yes' ]; then
1225-
echo "[ * ] Configuring NGINX..."
1226-
rm -f /etc/nginx/conf.d/*.conf
1227-
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1228-
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1229-
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1230-
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1231-
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1232-
mkdir -p /etc/nginx/conf.d/domains
1233-
mkdir -p /etc/nginx/modules-enabled
1234-
mkdir -p /var/log/nginx/domains
1235-
1236-
# Update dns servers in nginx.conf
1237-
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1238-
for ip in $dns_resolver; do
1239-
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1240-
resolver="$ip $resolver"
1241-
fi
1242-
done
1243-
if [ ! -z "$resolver" ]; then
1244-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1245-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
1205+
echo "[ * ] Configuring NGINX..."
1206+
rm -f /etc/nginx/conf.d/*.conf
1207+
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
1208+
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1209+
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
1210+
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
1211+
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
1212+
mkdir -p /etc/nginx/conf.d/domains
1213+
mkdir -p /etc/nginx/modules-enabled
1214+
mkdir -p /var/log/nginx/domains
1215+
1216+
# Update dns servers in nginx.conf
1217+
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
1218+
for ip in $dns_resolver; do
1219+
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1220+
resolver="$ip $resolver"
12461221
fi
1247-
1248-
update-rc.d nginx defaults > /dev/null 2>&1
1249-
systemctl start nginx >> $LOG
1250-
check_result $? "nginx start failed"
1222+
done
1223+
if [ ! -z "$resolver" ]; then
1224+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
1225+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
12511226
fi
12521227

1228+
update-rc.d nginx defaults > /dev/null 2>&1
1229+
systemctl start nginx >> $LOG
1230+
check_result $? "nginx start failed"
12531231

12541232
#----------------------------------------------------------#
12551233
# 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)