@@ -71,7 +71,6 @@ installer_dependencies="apt-transport-https curl dirmngr gnupg wget ca-certifica
7171help () {
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
214212eval 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
453450install_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+
459456if [ " $apache " = ' yes' ] && [ " $nginx " = ' no' ] ; then
460457 echo ' - Apache Web Server'
461458fi
@@ -605,11 +602,10 @@ echo "Adding required repositories to proceed with installation:"
605602echo
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
615611echo " [ * ] PHP"
752748
753749# Excluding packages
754750software=$( 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+
758752if [ " $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
1000994chmod 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"
10211007fi
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+
10281015fi
10291016
10301017if [ " $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
12101191fi
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 #
0 commit comments