@@ -888,6 +888,7 @@ rm -f /usr/sbin/policy-rc.d
888888# Configure system #
889889# ----------------------------------------------------------#
890890
891+ echo " Configure System"
891892# Enable SSH password authentication
892893sed -i " s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
893894
@@ -943,6 +944,7 @@ chmod 755 /usr/bin/rssh
943944# Configure Hestia #
944945# ----------------------------------------------------------#
945946
947+ echo " Configure Hestia"
946948# Installing sudo configuration
947949mkdir -p /etc/sudoers.d
948950cp -f $hestiacp /sudo/admin /etc/sudoers.d/
@@ -1088,6 +1090,7 @@ cp -rf $hestiacp/firewall $HESTIA/data/
10881090$HESTIA /bin/v-change-sys-hostname $servername > /dev/null 2>&1
10891091
10901092# Generating SSL certificate
1093+ echo " Generate ssl certificate"
10911094$HESTIA /bin/v-generate-ssl-cert $( hostname) $email ' US' ' California' \
10921095 ' San Francisco' ' Hestia Control Panel' ' IT' > /tmp/hst.pem
10931096
@@ -1097,6 +1100,7 @@ key_start=$(grep -n "BEGIN RSA" /tmp/hst.pem |cut -f 1 -d:)
10971100key_end=$( grep -n " END RSA" /tmp/hst.pem | cut -f 1 -d:)
10981101
10991102# Adding SSL certificate
1103+ echo " Add ssl certificate to Hestia"
11001104cd $HESTIA /ssl
11011105sed -n " 1,${crt_end} p" /tmp/hst.pem > certificate.crt
11021106sed -n " $key_start ,${key_end} p" /tmp/hst.pem > certificate.key
@@ -1110,6 +1114,7 @@ rm /tmp/hst.pem
11101114# ----------------------------------------------------------#
11111115
11121116if [ " $nginx " = ' yes' ]; then
1117+ echo " Configure Nginx Webserver"
11131118 rm -f /etc/nginx/conf.d/* .conf
11141119 cp -f $hestiacp /nginx/nginx.conf /etc/nginx/
11151120 cp -f $hestiacp /nginx/status.conf /etc/nginx/conf.d/
@@ -1119,6 +1124,7 @@ if [ "$nginx" = 'yes' ]; then
11191124 mkdir -p /etc/nginx/conf.d/domains
11201125 mkdir -p /var/log/nginx/domains
11211126 if [ " $apache " = ' no' ] && [ " $multiphp " = ' yes' ]; then
1127+ echo " Configure Nginx MultiPHP"
11221128 rm -fr $HESTIA /data/templates/web/nginx/*
11231129 for v in " ${multiphp_v[@]} " ; do
11241130 update-rc.d php$v -fpm defaults > /dev/null 2>&1
@@ -1144,7 +1150,14 @@ if [ "$nginx" = 'yes' ]; then
11441150
11451151 # Update dns servers in nginx.conf
11461152 dns_resolver=$( cat /etc/resolv.conf | grep -i ' ^nameserver' | cut -d ' ' -f2 | tr ' \r\n' ' ' | xargs)
1147- sed -i " s/1.0.0.1 1.1.1.1/$dns_resolver /g" /etc/nginx/nginx.conf
1153+ for ip in $dns_resolver ; do
1154+ if [[ $ip =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9]+$ ]]; then
1155+ resolver=" $ip $resolver "
1156+ fi
1157+ done
1158+ if [ ! -z " $resolver " ]; then
1159+ sed -i " s/1.0.0.1 1.1.1.1/$resolver /g" /etc/nginx/nginx.conf
1160+ fi
11481161
11491162 update-rc.d nginx defaults > /dev/null 2>&1
11501163 service nginx start >> $LOG
11571170# ----------------------------------------------------------#
11581171
11591172if [ " $apache " = ' yes' ]; then
1173+ echo " Configure Apache Webserver"
11601174 cp -f $hestiacp /apache2/apache2.conf /etc/apache2/
11611175 cp -f $hestiacp /apache2/status.conf /etc/apache2/mods-enabled/
11621176 cp -f $hestiacp /logrotate/apache2 /etc/logrotate.d/
@@ -1177,6 +1191,7 @@ if [ "$apache" = 'yes' ]; then
11771191 chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
11781192 chmod 751 /var/log/apache2/domains
11791193 if [ " $multiphp " = ' yes' ] ; then
1194+ echo " Configure Apache MultiPHP"
11801195 a2enmod proxy_fcgi setenvif > /dev/null 2>&1
11811196 for v in " ${multiphp_v[@]} " ; do
11821197 a2enconf php$v -fpm-fpm > /dev/null 2>&1
12071222# ----------------------------------------------------------#
12081223
12091224if [ " $phpfpm " = ' yes' ]; then
1225+ echo " Configure PHP-FPM"
12101226 cp -f $hestiacp /php-fpm/www.conf /etc/php/$fpm_v /fpm/pool.d/www.conf
12111227 update-rc.d php$fpm_v -fpm defaults > /dev/null 2>&1
12121228 service php$fpm_v -fpm start >> $LOG
12181234# Configure PHP #
12191235# ----------------------------------------------------------#
12201236
1237+ echo " Configure PHP Timezone"
12211238ZONE=$( timedatectl > /dev/null 2>&1 | grep Timezone| awk ' {print $2}' )
12221239if [ -z " $ZONE " ]; then
12231240 ZONE=' UTC'
@@ -1239,6 +1256,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
12391256# ----------------------------------------------------------#
12401257
12411258if [ " $vsftpd " = ' yes' ]; then
1259+ echo " Configure Vsftpd"
12421260 cp -f $hestiacp /vsftpd/vsftpd.conf /etc/
12431261 touch /var/log/vsftpd.log
12441262 chown root:adm /var/log/vsftpd.log
12581276# ----------------------------------------------------------#
12591277
12601278if [ " $proftpd " = ' yes' ]; then
1279+ echo " Configure ProFTPD server"
12611280 echo " 127.0.0.1 $servername " >> /etc/hosts
12621281 cp -f $hestiacp /proftpd/proftpd.conf /etc/proftpd/
12631282 update-rc.d proftpd defaults > /dev/null 2>&1
12711290# ----------------------------------------------------------#
12721291
12731292if [ " $mysql " = ' yes' ]; then
1293+ echo " Configure MariaDB server"
12741294 mycnf=" my-small.cnf"
12751295 if [ $memory -gt 1200000 ]; then
12761296 mycnf=" my-medium.cnf"
13491369# ----------------------------------------------------------#
13501370
13511371if [ " $postgresql " = ' yes' ]; then
1372+ echo " Configure PostgreSQL database server"
13521373 ppass=$( gen_pass)
13531374 cp -f $hestiacp /postgresql/pg_hba.conf /etc/postgresql/* /main/
13541375 service postgresql restart
13671388# ----------------------------------------------------------#
13681389
13691390if [ " $named " = ' yes' ]; then
1391+ echo " Configure Bind DNS server"
13701392 cp -f $hestiacp /bind/named.conf /etc/bind/
13711393 cp -f $hestiacp /bind/named.conf.options /etc/bind/
13721394 chown root:bind /etc/bind/named.conf
13981420# ----------------------------------------------------------#
13991421
14001422if [ " $exim " = ' yes' ]; then
1423+ echo " Configure Exim mail server"
14011424 gpasswd -a Debian-exim mail > /dev/null 2>&1
14021425 cp -f $hestiacp /exim/exim4.conf.template /etc/exim4/
14031426 cp -f $hestiacp /exim/dnsbl.conf /etc/exim4/
14331456# ----------------------------------------------------------#
14341457
14351458if [ " $dovecot " = ' yes' ]; then
1459+ echo " Configure Dovecot"
14361460 gpasswd -a dovecot mail > /dev/null 2>&1
14371461 cp -rf $hestiacp /dovecot /etc/
14381462 cp -f $hestiacp /logrotate/dovecot /etc/logrotate.d/
14851509# ----------------------------------------------------------#
14861510
14871511if [ " $spamd " = ' yes' ]; then
1512+ echo " Configure SpamAssassin"
14881513 update-rc.d spamassassin defaults > /dev/null 2>&1
14891514 sed -i " s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
14901515 service spamassassin start >> $LOG
15011526# ----------------------------------------------------------#
15021527
15031528if [ " $dovecot " = ' yes' ] && [ " $exim " = ' yes' ] && [ " $mysql " = ' yes' ]; then
1529+ echo " Configure Roundcube"
15041530 if [ " $apache " = ' yes' ]; then
15051531 cp -f $hestiacp /roundcube/apache.conf /etc/roundcube/
15061532 ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
15701596# ----------------------------------------------------------#
15711597
15721598if [ " $fail2ban " = ' yes' ]; then
1599+ echo " Configure Fail2Ban"
15731600 cp -rf $hestiacp /fail2ban /etc/
15741601 if [ " $dovecot " = ' no' ]; then
15751602 fline=$( cat /etc/fail2ban/jail.local | grep -n dovecot-iptables -A 2)
0 commit comments