@@ -52,7 +52,6 @@ installer_dependencies="apt-transport-https curl dirmngr gnupg wget software-pro
5252help () {
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
175173eval 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
407404install_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'
413408if [ " $apache " = ' yes' ] && [ " $nginx " = ' no' ] ; then
414409 echo ' - Apache Web Server'
415410fi
@@ -559,11 +554,9 @@ echo "Adding required repositories to proceed with installation:"
559554echo
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
569562echo " [ * ] PHP"
704697
705698# Excluding packages
706699software=$( 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
711701if [ " $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
10181008touch $HESTIA /conf/hestia.conf
10191009chmod 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
10401021fi
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
12291204fi
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 #
0 commit comments