Skip to content

Commit 5fc8339

Browse files
author
Serghey Rodin
committed
cosmetic fixes for CentOS and Amazon installers
1 parent ca39565 commit 5fc8339

File tree

2 files changed

+39
-40
lines changed

2 files changed

+39
-40
lines changed

install/vst-install-amazon.sh

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ release='6'
1818
codename="${os}_$release"
1919
vestacp="$VESTA/install/$VERSION/$release"
2020

21+
# Defining software pack for all distros
2122
software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded
2223
php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt
2324
php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-fpm php-pgsql
@@ -92,7 +93,7 @@ set_default_value() {
9293
fi
9394
}
9495

95-
# Define function to set default language value
96+
# Defining function to set default language value
9697
set_default_lang() {
9798
if [ -z "$lang" ]; then
9899
eval lang=$1
@@ -112,9 +113,6 @@ set_default_lang() {
112113
# Verifications #
113114
#----------------------------------------------------------#
114115

115-
# Creating temporary file
116-
tmpfile=$(mktemp -p /tmp)
117-
118116
# Translating argument to --gnu-long-options
119117
for arg; do
120118
delim=""
@@ -226,7 +224,6 @@ if [ "$iptables" = 'no' ]; then
226224
fail2ban='no'
227225
fi
228226

229-
230227
# Checking root permissions
231228
if [ "x$(id -u)" != 'x0' ]; then
232229
check_result 1 "Script can be run executed only by root"
@@ -247,16 +244,18 @@ if [ ! -e '/usr/bin/wget' ]; then
247244
fi
248245

249246
# Checking repository availability
250-
wget -q "http://c.vestacp.com/GPG.txt" -O /dev/null
247+
wget -q "c.vestacp.com/GPG.txt" -O /dev/null
251248
check_result $? "No access to Vesta repository"
252249

253250
# Checking installed packages
251+
tmpfile=$(mktemp -p /tmp)
254252
rpm -qa > $tmpfile
255253
for pkg in exim mysql-server httpd nginx vesta; do
256254
if [ ! -z "$(grep $pkg $tmpfile)" ]; then
257255
conflicts="$pkg $conflicts"
258256
fi
259257
done
258+
rm -f $tmpfile
260259
if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
261260
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
262261
echo
@@ -277,7 +276,7 @@ fi
277276
# Brief Info #
278277
#----------------------------------------------------------#
279278

280-
# Printing nice ascii as logo
279+
# Printing nice ASCII logo
281280
clear
282281
echo
283282
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
@@ -289,7 +288,7 @@ echo
289288
echo ' Vesta Control Panel'
290289
echo -e "\n\n"
291290

292-
echo 'Following software will be installed on your system:'
291+
echo 'The following software will be installed on your system:'
293292

294293
# Web stack
295294
if [ "$nginx" = 'yes' ]; then
@@ -310,16 +309,16 @@ if [ "$named" = 'yes' ]; then
310309
echo ' - Bind DNS Server'
311310
fi
312311

313-
# Mail Stack
312+
# Mail stack
314313
if [ "$exim" = 'yes' ]; then
315-
echo -n ' - Exim mail server'
314+
echo -n ' - Exim Mail Server'
316315
if [ "$clamd" = 'yes' ] || [ "$spamd" = 'yes' ] ; then
317316
echo -n ' + '
318317
if [ "$clamd" = 'yes' ]; then
319-
echo -n 'Antivirus '
318+
echo -n 'ClamAV '
320319
fi
321320
if [ "$spamd" = 'yes' ]; then
322-
echo -n 'Antispam'
321+
echo -n 'SpamAssassin'
323322
fi
324323
fi
325324
echo
@@ -328,9 +327,9 @@ if [ "$exim" = 'yes' ]; then
328327
fi
329328
fi
330329

331-
# DB stack
330+
# Database stack
332331
if [ "$mysql" = 'yes' ]; then
333-
if [ $release = 7 ]; then
332+
if [ $release -ge 7 ]; then
334333
echo ' - MariaDB Database Server'
335334
else
336335
echo ' - MySQL Database Server'
@@ -438,7 +437,7 @@ fi
438437
# Install repositories #
439438
#----------------------------------------------------------#
440439

441-
# Updating system packages
440+
# Updating system
442441
yum -y update
443442
check_result $? 'yum update failed'
444443

@@ -463,7 +462,7 @@ echo "baseurl=http://$RHOST/$REPO/$release/\$basearch/" >> $vrepo
463462
echo "enabled=1" >> $vrepo
464463
echo "gpgcheck=1" >> $vrepo
465464
echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA" >> $vrepo
466-
wget http://c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
465+
wget c.vestacp.com/GPG.txt -O /etc/pki/rpm-gpg/RPM-GPG-KEY-VESTA
467466

468467

469468
#----------------------------------------------------------#
@@ -476,53 +475,53 @@ cd $vst_backups
476475
mkdir nginx httpd php php-fpm vsftpd proftpd named exim dovecot clamd \
477476
spamassassin mysql postgresql mongodb vesta
478477

479-
# Backing up Nginx configuration
478+
# Backup Nginx configuration
480479
service nginx stop > /dev/null 2>&1
481480
cp -r /etc/nginx/* $vst_backups/nginx > /dev/null 2>&1
482481

483-
# Backing up Apache configuration
482+
# Backup Apache configuration
484483
service httpd stop > /dev/null 2>&1
485484
cp -r /etc/httpd/* $vst_backups/httpd > /dev/null 2>&1
486485

487-
# Backing up PHP configuration
486+
# Backup PHP-FPM configuration
488487
service php-fpm stop >/dev/null 2>&1
489488
cp /etc/php.ini $vst_backups/php > /dev/null 2>&1
490489
cp -r /etc/php.d $vst_backups/php > /dev/null 2>&1
491490
cp /etc/php-fpm.conf $vst_backups/php-fpm > /dev/null 2>&1
492491
mv -f /etc/php-fpm.d/* $vst_backups/php-fpm/ > /dev/null 2>&1
493492

494-
# Backing up Bind configuration
493+
# Backup Bind configuration
495494
yum remove bind-chroot > /dev/null 2>&1
496495
service named stop > /dev/null 2>&1
497496
cp /etc/named.conf $vst_backups/named >/dev/null 2>&1
498497

499-
# Backing up Vsftpd configuration
498+
# Backup Vsftpd configuration
500499
service vsftpd stop > /dev/null 2>&1
501500
cp /etc/vsftpd/vsftpd.conf $vst_backups/vsftpd >/dev/null 2>&1
502501

503-
# Backing up ProFTPD configuration
502+
# Backup ProFTPD configuration
504503
service proftpd stop > /dev/null 2>&1
505504
cp /etc/proftpd.conf $vst_backups/proftpd >/dev/null 2>&1
506505

507-
# Backing up Exim configuration
506+
# Backup Exim configuration
508507
service exim stop > /dev/null 2>&1
509508
cp -r /etc/exim/* $vst_backups/exim >/dev/null 2>&1
510509

511-
# Backing up ClamAV configuration
510+
# Backup ClamAV configuration
512511
service clamd stop > /dev/null 2>&1
513512
cp /etc/clamd.conf $vst_backups/clamd >/dev/null 2>&1
514513
cp -r /etc/clamd.d $vst_backups/clamd >/dev/null 2>&1
515514

516-
# Backing up SpamAssassin configuration
515+
# Backup SpamAssassin configuration
517516
service spamassassin stop > /dev/null 2>&1
518517
cp -r /etc/mail/spamassassin/* $vst_backups/spamassassin >/dev/null 2>&1
519518

520-
# Backing up Dovecot configuration
519+
# Backup Dovecot configuration
521520
service dovecot stop > /dev/null 2>&1
522521
cp /etc/dovecot.conf $vst_backups/dovecot > /dev/null 2>&1
523522
cp -r /etc/dovecot/* $vst_backups/dovecot > /dev/null 2>&1
524523

525-
# Backing up MySQL/MariaDB configuration and data
524+
# Backup MySQL/MariaDB configuration and data
526525
service mysql stop > /dev/null 2>&1
527526
service mysqld stop > /dev/null 2>&1
528527
service mariadb stop > /dev/null 2>&1
@@ -531,18 +530,18 @@ cp /etc/my.cnf $vst_backups/mysql > /dev/null 2>&1
531530
cp /etc/my.cnf.d $vst_backups/mysql > /dev/null 2>&1
532531
mv /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1
533532

534-
# Backing up MySQL/MariaDB configuration and data
533+
# Backup MySQL/MariaDB configuration and data
535534
service postgresql stop > /dev/null 2>&1
536535
mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1
537536

538-
# Backing up Vesta configuration and data
537+
# Backup Vesta
539538
service vesta stop > /dev/null 2>&1
540539
mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1
541540
mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1
542541

543542

544543
#----------------------------------------------------------#
545-
# Package Exludes #
544+
# Package Excludes #
546545
#----------------------------------------------------------#
547546

548547
# Excluding packages
@@ -652,7 +651,7 @@ if [ -e '/etc/sysconfig/selinux' ]; then
652651
setenforce 0 2>/dev/null
653652
fi
654653

655-
# Disable iptables
654+
# Disabling iptables
656655
service iptables stop
657656

658657
# Configuring NTP synchronization

install/vst-install-rhel.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ if [ -e '/etc/sysconfig/selinux' ]; then
669669
setenforce 0 2>/dev/null
670670
fi
671671

672-
# Disablng iptables
672+
# Disabling iptables
673673
service iptables stop
674674

675675
# Configuring NTP synchronization
@@ -903,13 +903,13 @@ if [ "$apache" = 'yes' ]; then
903903
echo > proxy_ajp.conf
904904
fi
905905
if [ -e "/etc/httpd/conf.modules.d/00-dav.conf" ]; then
906-
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-dav.conf
907-
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-lua.conf
908-
sed -i "s/^/#/" /etc/httpd/conf.modules.d/00-proxy.conf
906+
cd /etc/httpd/conf.modules.d
907+
sed -i "s/^/#/" 00-dav.conf 00-lua.conf 00-proxy.conf
909908
fi
910909
echo > /etc/httpd/conf.d/vesta.conf
911-
touch /etc/httpd/logs/access_log /etc/httpd/logs/error_log
912-
chmod 640 /etc/httpd/logs/access_log /etc/httpd/logs/error_log
910+
cd /var/log/httpd
911+
touch access_log error_log suexec.log
912+
chmod 640 access_log error_log suexec.log
913913
chmod -f 777 /var/lib/php/session
914914
chmod a+x /var/log/httpd
915915
mkdir -p /var/log/httpd/domains
@@ -1035,7 +1035,7 @@ if [ "$mysql" = 'yes' ]; then
10351035
if [ "$apache" = 'yes' ]; then
10361036
cp -f $vestacp/pma/phpMyAdmin.conf /etc/httpd/conf.d/
10371037
fi
1038-
cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/
1038+
cp -f $vestacp/pma/config.inc.conf /etc/phpMyAdmin/config.inc.php
10391039
sed -i "s/%blowfish_secret%/$(gen_pass)/g" /etc/phpMyAdmin/config.inc.php
10401040
fi
10411041

@@ -1324,7 +1324,7 @@ if [ "$quota" = 'yes' ]; then
13241324
$VESTA/bin/v-add-sys-quota
13251325
fi
13261326

1327-
# Enabling softaculous plugin
1327+
# Enabling Softaculous plugin
13281328
if [ "$softaculous" = 'yes' ]; then
13291329
$VESTA/bin/v-add-vesta-softaculous
13301330
fi
@@ -1350,7 +1350,7 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
13501350
wget vestacp.com/notify/?$codename -O /dev/null -q
13511351

13521352
# Comparing hostname and IP
1353-
host_ip=$(host $servername| head -n 1 |awk '{print $NF}')
1353+
host_ip=$(host $servername |head -n 1 |awk '{print $NF}')
13541354
if [ "$host_ip" = "$ip" ]; then
13551355
ip="$servername"
13561356
fi

0 commit comments

Comments
 (0)