@@ -11,6 +11,7 @@ RHOST='apt.hestiacp.com'
1111GPG=' gpg.hestiacp.com'
1212VERSION=' debian'
1313HESTIA=' /usr/local/hestia'
14+ LOG=" /root/hst_install_backups/$( date +%s) .log"
1415memory=$( grep ' MemTotal' /proc/meminfo | tr ' ' ' \n' | grep [0-9])
1516arch=$( uname -i)
1617os=' debian'
@@ -274,28 +275,28 @@ apt-get -qq update
274275# Checking wget
275276if [ ! -e ' /usr/bin/wget' ]; then
276277 echo " Install missing wget..."
277- apt-get -y install wget > /dev/null 2>&1
278+ apt-get -y install wget >> $LOG
278279 check_result $? " Can't install wget"
279280fi
280281
281282# Checking dirmngr
282283if [ ! -e ' /usr/bin/dirmngr' ]; then
283284 echo " Install missing dirmngr..."
284- apt-get -y install dirmngr > /dev/null 2>&1
285+ apt-get -y install dirmngr >> $LOG
285286 check_result $? " Can't install dirmngr"
286287fi
287288
288289# Checking screen
289290if [ ! -e ' /usr/bin/screen' ]; then
290291 echo " Install missing screen..."
291- apt-get -y install screen > /dev/null 2>&1
292+ apt-get -y install screen >> $LOG
292293 check_result $? " Can't install screen"
293294fi
294295
295296# Check if apt-transport-https is installed
296297if [ ! -e ' /usr/lib/apt/methods/https' ]; then
297298 echo " Install missing apt-transport-https..."
298- apt-get -y install apt-transport-https > /dev/null 2>&1
299+ apt-get -y install apt-transport-https >> $LOG
299300 check_result $? " Can't install apt-transport-https"
300301fi
301302
468469hst_backups=" /root/hst_install_backups/$( date +%s) "
469470echo " Installation backup directory: $hst_backups "
470471
472+ # Print Log File Path
473+ echo " Installation Log File: $LOG "
474+
471475# Printing start message and sleeping for 2 seconds
472476echo -e " \n\nWe will now install HestiaCP and all required packages. The process will take around 10-15 minutes...\n"
473477sleep 2
493497
494498# Updating system
495499echo " Upgrade System using apt-get..."
496- apt-get -y upgrade > /dev/null 2>&1
500+ apt-get -y upgrade >> $LOG
497501check_result $? ' apt-get upgrade failed'
498502
499503# Define apt conf location
@@ -503,13 +507,13 @@ apt=/etc/apt/sources.list.d
503507echo " deb http://nginx.org/packages/mainline/$VERSION / $codename nginx" \
504508 > $apt /nginx.list
505509wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
506- apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
510+ apt-key add /tmp/nginx_signing.key >> $LOG
507511
508512if [ " $multiphp " = ' yes' ] || [ " $phpfpm " = ' yes' ]; then
509513 # Installing sury php repo
510514 echo " deb https://packages.sury.org/php/ $codename main" > $apt /php.list
511- wget https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key > /dev/null 2>&1
512- apt-key add /tmp/php_signing.key > /dev/null 2>&1
515+ wget https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key >> $LOG
516+ apt-key add /tmp/php_signing.key >> $LOG
513517fi
514518
515519# Installing MariaDB repo
@@ -519,7 +523,7 @@ screen -dm apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C7
519523# Installing hestia repo
520524echo " deb https://$RHOST / $codename main" > $apt /hestia.list
521525wget --quiet https://gpg.hestiacp.com/deb_signing.key -O /tmp/deb_signing.key
522- apt-key add /tmp/deb_signing.key > /dev/null 2>&1
526+ apt-key add /tmp/deb_signing.key >> $LOG
523527
524528
525529# ----------------------------------------------------------#
@@ -697,7 +701,7 @@ echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
697701chmod a+x /usr/sbin/policy-rc.d
698702
699703# Installing apt packages
700- apt-get -y install $software > /dev/null 2>&1
704+ apt-get -y install $software >> $LOG
701705check_result $? " apt-get install failed"
702706
703707# Restoring autostart policy
@@ -948,11 +952,11 @@ if [ "$nginx" = 'yes' ]; then
948952 ln -s $HESTIA /data/templates/web/nginx/PHP-72.tpl $HESTIA /data/templates/web/nginx/default.tpl
949953 ln -s $HESTIA /data/templates/web/nginx/PHP-72.stpl $HESTIA /data/templates/web/nginx/default.stpl
950954 chmod a+x $HESTIA /data/templates/web/nginx/* .sh
951- service php7.2-fpm start > /dev/null 2>&1
955+ service php7.2-fpm start >> $LOG
952956 check_result $? " php7.2-fpm start failed"
953957 fi
954958 update-rc.d nginx defaults > /dev/null 2>&1
955- service nginx start > /dev/null 2>&1
959+ service nginx start >> $LOG
956960 check_result $? " nginx start failed"
957961fi
958962
@@ -1011,7 +1015,7 @@ if [ "$apache" = 'yes' ]; then
10111015 fi
10121016 fi
10131017 update-rc.d apache2 defaults > /dev/null 2>&1
1014- service apache2 start > /dev/null 2>&1
1018+ service apache2 start >> $LOG
10151019 check_result $? " apache2 start failed"
10161020else
10171021 update-rc.d apache2 disable > /dev/null 2>&1
10261030if [ " $phpfpm " = ' yes' ]; then
10271031 cp -f $hestiacp /php-fpm/www.conf /etc/php/7.2/fpm/pool.d/www.conf
10281032 update-rc.d php7.2-fpm defaults > /dev/null 2>&1
1029- service php7.2-fpm start > /dev/null 2>&1
1033+ service php7.2-fpm start >> $LOG
10301034 check_result $? " php-fpm start failed"
10311035fi
10321036
@@ -1088,15 +1092,15 @@ if [ "$mysql" = 'yes' ]; then
10881092
10891093 # Configuring MariaDB
10901094 cp -f $hestiacp /mysql/$mycnf /etc/mysql/my.cnf
1091- mysql_install_db > /dev/null 2>&1
1095+ mysql_install_db >> $LOG
10921096
10931097 update-rc.d mysql defaults
10941098 service mysql start
10951099 check_result $? " mariadb start failed"
10961100
10971101 # Securing MariaDB installation
10981102 mpass=$( gen_pass)
1099- mysqladmin -u root password $mpass > /dev/null 2>&1
1103+ mysqladmin -u root password $mpass >> $LOG
11001104 echo -e " [client]\npassword='$mpass '\n" > /root/.my.cnf
11011105 chmod 600 /root/.my.cnf
11021106
@@ -1224,9 +1228,9 @@ if [ "$exim" = 'yes' ]; then
12241228 rm -f /etc/alternatives/mta
12251229 ln -s /usr/sbin/exim4 /etc/alternatives/mta
12261230 update-rc.d -f sendmail remove > /dev/null 2>&1
1227- service sendmail stop > /dev/null 2>&1
1231+ service sendmail stop >> $LOG
12281232 update-rc.d -f postfix remove > /dev/null 2>&1
1229- service postfix stop > /dev/null 2>&1
1233+ service postfix stop >> $LOG
12301234
12311235 update-rc.d exim4 defaults
12321236 service exim4 start
@@ -1273,7 +1277,7 @@ if [ "$clamd" = 'yes' ]; then
12731277 systemctl daemon-reload
12741278 fi
12751279 echo " Updating ClamAV..."
1276- /usr/bin/freshclam > /dev/null 2>&1
1280+ /usr/bin/freshclam >> $LOG
12771281 service clamav-daemon start
12781282 check_result $? " clamav-daemon start failed"
12791283fi
12861290if [ " $spamd " = ' yes' ]; then
12871291 update-rc.d spamassassin defaults > /dev/null 2>&1
12881292 sed -i " s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
1289- service spamassassin start > /dev/null 2>&1
1293+ service spamassassin start >> $LOG
12901294 check_result $? " spamassassin start failed"
12911295 unit_files=" $( systemctl list-unit-files | grep spamassassin) "
12921296 if [[ " $unit_files " =~ " disabled" ]]; then
14121416# Special thanks to Pavel Galkin (https://skurudo.ru)
14131417# https://github.com/skurudo/phpmyadmin-fixer
14141418
1415- source $hestiacp /phpmyadmin/pma.sh > /dev/null 2>&1
1419+ source $hestiacp /phpmyadmin/pma.sh >> $LOG
14161420
14171421
14181422# ----------------------------------------------------------#
@@ -1481,7 +1485,7 @@ if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
14811485 fi
14821486 echo " </IfModule>" >> remoteip.conf
14831487 sed -i " s/LogFormat \" %h/LogFormat \" %a/g" /etc/apache2/apache2.conf
1484- a2enmod remoteip > /dev/null 2>&1
1488+ a2enmod remoteip >> $LOG
14851489 service apache2 restart
14861490fi
14871491
0 commit comments