cosmetic fixes for CentOS and Amazon installers

This commit is contained in:
Serghey Rodin 2018-06-21 18:01:24 +03:00
commit 5fc8339a8d
2 changed files with 39 additions and 40 deletions

View file

@ -18,6 +18,7 @@ release='6'
codename="${os}_$release" codename="${os}_$release"
vestacp="$VESTA/install/$VERSION/$release" vestacp="$VESTA/install/$VERSION/$release"
# Defining software pack for all distros
software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded
php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt
php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-fpm php-pgsql php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-fpm php-pgsql
@ -92,7 +93,7 @@ set_default_value() {
fi fi
} }
# Define function to set default language value # Defining function to set default language value
set_default_lang() { set_default_lang() {
if [ -z "$lang" ]; then if [ -z "$lang" ]; then
eval lang=$1 eval lang=$1
@ -112,9 +113,6 @@ set_default_lang() {
# Verifications # # Verifications #
#----------------------------------------------------------# #----------------------------------------------------------#
# Creating temporary file
tmpfile=$(mktemp -p /tmp)
# Translating argument to --gnu-long-options # Translating argument to --gnu-long-options
for arg; do for arg; do
delim="" delim=""
@ -226,7 +224,6 @@ if [ "$iptables" = 'no' ]; then
fail2ban='no' fail2ban='no'
fi fi
# Checking root permissions # Checking root permissions
if [ "x$(id -u)" != 'x0' ]; then if [ "x$(id -u)" != 'x0' ]; then
check_result 1 "Script can be run executed only by root" check_result 1 "Script can be run executed only by root"
@ -247,16 +244,18 @@ if [ ! -e '/usr/bin/wget' ]; then
fi fi
# Checking repository availability # Checking repository availability
wget -q "http://c.vestacp.com/GPG.txt" -O /dev/null wget -q "c.vestacp.com/GPG.txt" -O /dev/null
check_result $? "No access to Vesta repository" check_result $? "No access to Vesta repository"
# Checking installed packages # Checking installed packages
tmpfile=$(mktemp -p /tmp)
rpm -qa > $tmpfile rpm -qa > $tmpfile
for pkg in exim mysql-server httpd nginx vesta; do for pkg in exim mysql-server httpd nginx vesta; do
if [ ! -z "$(grep $pkg $tmpfile)" ]; then if [ ! -z "$(grep $pkg $tmpfile)" ]; then
conflicts="$pkg $conflicts" conflicts="$pkg $conflicts"
fi fi
done done
rm -f $tmpfile
if [ ! -z "$conflicts" ] && [ -z "$force" ]; then if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!' echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
echo echo
@ -277,7 +276,7 @@ fi
# Brief Info # # Brief Info #
#----------------------------------------------------------# #----------------------------------------------------------#
# Printing nice ascii as logo # Printing nice ASCII logo
clear clear
echo echo
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|' echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
@ -289,7 +288,7 @@ echo
echo ' Vesta Control Panel' echo ' Vesta Control Panel'
echo -e "\n\n" echo -e "\n\n"
echo 'Following software will be installed on your system:' echo 'The following software will be installed on your system:'
# Web stack # Web stack
if [ "$nginx" = 'yes' ]; then if [ "$nginx" = 'yes' ]; then
@ -310,16 +309,16 @@ if [ "$named" = 'yes' ]; then
echo ' - Bind DNS Server' echo ' - Bind DNS Server'
fi fi
# Mail Stack # Mail stack
if [ "$exim" = 'yes' ]; then if [ "$exim" = 'yes' ]; then
echo -n ' - Exim mail server' echo -n ' - Exim Mail Server'
if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
echo -n ' + ' echo -n ' + '
if [ "$clamd" = 'yes' ]; then if [ "$clamd" = 'yes' ]; then
echo -n 'Antivirus ' echo -n 'ClamAV '
fi fi
if [ "$spamd" = 'yes' ]; then if [ "$spamd" = 'yes' ]; then
echo -n 'Antispam' echo -n 'SpamAssassin'
fi fi
fi fi
echo echo
@ -328,9 +327,9 @@ if [ "$exim" = 'yes' ]; then
fi fi
fi fi
# DB stack # Database stack
if [ "$mysql" = 'yes' ]; then if [ "$mysql" = 'yes' ]; then
if [ $release = 7 ]; then if [ $release -ge 7 ]; then
echo ' - MariaDB Database Server' echo ' - MariaDB Database Server'
else else
echo ' - MySQL Database Server' echo ' - MySQL Database Server'
@ -438,7 +437,7 @@ fi
# Install repositories # # Install repositories #
#----------------------------------------------------------# #----------------------------------------------------------#
# Updating system packages # Updating system
yum -y update yum -y update
check_result $? 'yum update failed' check_result $? 'yum update failed'
@ -463,7 +462,7 @@ echo "baseurl=http://$RHOST/$REPO/$release/\$basearch/" >> $vrepo
echo "enabled=1" >> $vrepo echo "enabled=1" >> $vrepo
echo "gpgcheck=1" >> $vrepo echo "gpgcheck=1" >> $vrepo
echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" >> $vrepo echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" >> $vrepo
wget http://c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA wget c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
#----------------------------------------------------------# #----------------------------------------------------------#
@ -476,53 +475,53 @@ cd $vst_backups
mkdir nginx httpd php php-fpm vsftpd proftpd named exim dovecot clamd \ mkdir nginx httpd php php-fpm vsftpd proftpd named exim dovecot clamd \
spamassassin mysql postgresql mongodb vesta spamassassin mysql postgresql mongodb vesta
# Backing up Nginx configuration # Backup Nginx configuration
service nginx stop > /dev/null 2>&1 service nginx stop > /dev/null 2>&1
cp -r /etc/nginx/* $vst_backups/nginx > /dev/null 2>&1 cp -r /etc/nginx/* $vst_backups/nginx > /dev/null 2>&1
# Backing up Apache configuration # Backup Apache configuration
service httpd stop > /dev/null 2>&1 service httpd stop > /dev/null 2>&1
cp -r /etc/httpd/* $vst_backups/httpd > /dev/null 2>&1 cp -r /etc/httpd/* $vst_backups/httpd > /dev/null 2>&1
# Backing up PHP configuration # Backup PHP-FPM configuration
service php-fpm stop >/dev/null 2>&1 service php-fpm stop >/dev/null 2>&1
cp /etc/php.ini $vst_backups/php > /dev/null 2>&1 cp /etc/php.ini $vst_backups/php > /dev/null 2>&1
cp -r /etc/php.d $vst_backups/php > /dev/null 2>&1 cp -r /etc/php.d $vst_backups/php > /dev/null 2>&1
cp /etc/php-fpm.conf $vst_backups/php-fpm > /dev/null 2>&1 cp /etc/php-fpm.conf $vst_backups/php-fpm > /dev/null 2>&1
mv -f /etc/php-fpm.d/* $vst_backups/php-fpm/ > /dev/null 2>&1 mv -f /etc/php-fpm.d/* $vst_backups/php-fpm/ > /dev/null 2>&1
# Backing up Bind configuration # Backup Bind configuration
yum remove bind-chroot > /dev/null 2>&1 yum remove bind-chroot > /dev/null 2>&1
service named stop > /dev/null 2>&1 service named stop > /dev/null 2>&1
cp /etc/named.conf $vst_backups/named >/dev/null 2>&1 cp /etc/named.conf $vst_backups/named >/dev/null 2>&1
# Backing up Vsftpd configuration # Backup Vsftpd configuration
service vsftpd stop > /dev/null 2>&1 service vsftpd stop > /dev/null 2>&1
cp /etc/vsftpd/vsftpd.conf $vst_backups/vsftpd >/dev/null 2>&1 cp /etc/vsftpd/vsftpd.conf $vst_backups/vsftpd >/dev/null 2>&1
# Backing up ProFTPD configuration # Backup ProFTPD configuration
service proftpd stop > /dev/null 2>&1 service proftpd stop > /dev/null 2>&1
cp /etc/proftpd.conf $vst_backups/proftpd >/dev/null 2>&1 cp /etc/proftpd.conf $vst_backups/proftpd >/dev/null 2>&1
# Backing up Exim configuration # Backup Exim configuration
service exim stop > /dev/null 2>&1 service exim stop > /dev/null 2>&1
cp -r /etc/exim/* $vst_backups/exim >/dev/null 2>&1 cp -r /etc/exim/* $vst_backups/exim >/dev/null 2>&1
# Backing up ClamAV configuration # Backup ClamAV configuration
service clamd stop > /dev/null 2>&1 service clamd stop > /dev/null 2>&1
cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1 cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1
cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1 cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1
# Backing up SpamAssassin configuration # Backup SpamAssassin configuration
service spamassassin stop > /dev/null 2>&1 service spamassassin stop > /dev/null 2>&1
cp -r /etc/mail/spamassassin/* $vst_backups/spamassassin >/dev/null 2>&1 cp -r /etc/mail/spamassassin/* $vst_backups/spamassassin >/dev/null 2>&1
# Backing up Dovecot configuration # Backup Dovecot configuration
service dovecot stop > /dev/null 2>&1 service dovecot stop > /dev/null 2>&1
cp /etc/dovecot.conf $vst_backups/dovecot > /dev/null 2>&1 cp /etc/dovecot.conf $vst_backups/dovecot > /dev/null 2>&1
cp -r /etc/dovecot/* $vst_backups/dovecot > /dev/null 2>&1 cp -r /etc/dovecot/* $vst_backups/dovecot > /dev/null 2>&1
# Backing up MySQL/MariaDB configuration and data # Backup MySQL/MariaDB configuration and data
service mysql stop > /dev/null 2>&1 service mysql stop > /dev/null 2>&1
service mysqld stop > /dev/null 2>&1 service mysqld stop > /dev/null 2>&1
service mariadb stop > /dev/null 2>&1 service mariadb stop > /dev/null 2>&1
@ -531,18 +530,18 @@ cp /etc/my.cnf $vst_backups/mysql > /dev/null 2>&1
cp /etc/my.cnf.d $vst_backups/mysql > /dev/null 2>&1 cp /etc/my.cnf.d $vst_backups/mysql > /dev/null 2>&1
mv /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1 mv /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1
# Backing up MySQL/MariaDB configuration and data # Backup MySQL/MariaDB configuration and data
service postgresql stop > /dev/null 2>&1 service postgresql stop > /dev/null 2>&1
mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1 mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1
# Backing up Vesta configuration and data # Backup Vesta
service vesta stop > /dev/null 2>&1 service vesta stop > /dev/null 2>&1
mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1 mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1
mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1 mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1
#----------------------------------------------------------# #----------------------------------------------------------#
# Package Exludes # # Package Excludes #
#----------------------------------------------------------# #----------------------------------------------------------#
# Excluding packages # Excluding packages
@ -652,7 +651,7 @@ if [ -e '/etc/sysconfig/selinux' ]; then
setenforce 0 2>/dev/null setenforce 0 2>/dev/null
fi fi
# Disable iptables # Disabling iptables
service iptables stop service iptables stop
# Configuring NTP synchronization # Configuring NTP synchronization

View file

@ -669,7 +669,7 @@ if [ -e '/etc/sysconfig/selinux' ]; then
setenforce 0 2>/dev/null setenforce 0 2>/dev/null
fi fi
# Disablng iptables # Disabling iptables
service iptables stop service iptables stop
# Configuring NTP synchronization # Configuring NTP synchronization
@ -903,13 +903,13 @@ if [ "$apache" = 'yes' ]; then
echo > proxy_ajp.conf echo > proxy_ajp.conf
fi fi
if [ -e "/etc/httpd/conf.modules.d/00-dav.conf" ]; then if [ -e "/etc/httpd/conf.modules.d/00-dav.conf" ]; then
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-dav.conf cd /etc/httpd/conf.modules.d
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-lua.conf sed -i "s/^/#/" 00-dav.conf 00-lua.conf 00-proxy.conf
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-proxy.conf
fi fi
echo > /etc/httpd/conf.d/vesta.conf echo > /etc/httpd/conf.d/vesta.conf
touch /etc/httpd/logs/access_log /etc/httpd/logs/error_log cd /var/log/httpd
chmod 640 /etc/httpd/logs/access_log /etc/httpd/logs/error_log touch access_log error_log suexec.log
chmod 640 access_log error_log suexec.log
chmod -f 777 /var/lib/php/session chmod -f 777 /var/lib/php/session
chmod a+x /var/log/httpd chmod a+x /var/log/httpd
mkdir -p /var/log/httpd/domains mkdir -p /var/log/httpd/domains
@ -1035,7 +1035,7 @@ if [ "$mysql" = 'yes' ]; then
if [ "$apache" = 'yes' ]; then if [ "$apache" = 'yes' ]; then
cp -f $vestacp/pma/phpMyAdmin.conf /etc/httpd/conf.d/ cp -f $vestacp/pma/phpMyAdmin.conf /etc/httpd/conf.d/
fi fi
cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/ cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/config.inc.php
sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php
fi fi
@ -1324,7 +1324,7 @@ if [ "$quota" = 'yes' ]; then
$VESTA/bin/v-add-sys-quota $VESTA/bin/v-add-sys-quota
fi fi
# Enabling softaculous plugin # Enabling Softaculous plugin
if [ "$softaculous" = 'yes' ]; then if [ "$softaculous" = 'yes' ]; then
$VESTA/bin/v-add-vesta-softaculous $VESTA/bin/v-add-vesta-softaculous
fi fi
@ -1350,7 +1350,7 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
wget vestacp.com/notify/?$codename -O /dev/null -q wget vestacp.com/notify/?$codename -O /dev/null -q
# Comparing hostname and IP # Comparing hostname and IP
host_ip=$(host $servername| head -n 1 |awk '{print $NF}') host_ip=$(host $servername |head -n 1 |awk '{print $NF}')
if [ "$host_ip" = "$ip" ]; then if [ "$host_ip" = "$ip" ]; then
ip="$servername" ip="$servername"
fi fi