Skip to content

Commit ff2bf71

Browse files
author
hestiacp
authored
official debian installer
1 parent 7aa2a47 commit ff2bf71

File tree

1 file changed

+44
-33
lines changed

1 file changed

+44
-33
lines changed

install/vst-install-debian.sh

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/bin/bash
22

3-
# Hestia Debian installer v.06
3+
# Vesta Debian installer v.05
44

55
#----------------------------------------------------------#
66
# Variables&Functions #
77
#----------------------------------------------------------#
88
export PATH=$PATH:/sbin
99
export DEBIAN_FRONTEND=noninteractive
10-
RHOST='apt.hestiacp.com'
11-
CHOST='c.hestiacp.com'
10+
RHOST='apt.vestacp.com'
11+
CHOST='c.vestacp.com'
1212
VERSION='debian'
1313
VESTA='/usr/local/vesta'
1414
memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
1515
arch=$(uname -i)
1616
os='debian'
1717
release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
1818
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
19-
vestacp="https://$CHOST/$VERSION/$release"
19+
vestacp="http://$CHOST/$VERSION/$release"
2020

2121
if [ "$release" -eq 9 ]; then
2222
software="nginx apache2 apache2-utils apache2-suexec-custom
@@ -29,7 +29,7 @@ if [ "$release" -eq 9 ]; then
2929
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
3030
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
3131
bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
32-
unrar-free vim-common net-tools"
32+
unrar-free vim-common vesta-ioncube vesta-softaculous net-tools"
3333
elif [ "$release" -eq 8 ]; then
3434
software="nginx apache2 apache2-utils apache2.2-common
3535
apache2-suexec-custom libapache2-mod-ruid2
@@ -42,7 +42,7 @@ elif [ "$release" -eq 8 ]; then
4242
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
4343
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
4444
bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
45-
unrar-free vim-common net-tools"
45+
unrar-free vim-common vesta-ioncube vesta-softaculous net-tools"
4646
else
4747
software="nginx apache2 apache2-utils apache2.2-common
4848
apache2-suexec-custom libapache2-mod-ruid2
@@ -55,7 +55,7 @@ else
5555
flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota
5656
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
5757
bsdmainutils cron vesta vesta-nginx vesta-php expect unrar-free
58-
vim-common net-tools"
58+
vim-common vesta-ioncube vesta-softaculous net-tools"
5959
fi
6060

6161
# Defining help function
@@ -76,6 +76,7 @@ help() {
7676
-t, --spamassassin Install SpamAssassin [yes|no] default: yes
7777
-i, --iptables Install Iptables [yes|no] default: yes
7878
-b, --fail2ban Install Fail2ban [yes|no] default: yes
79+
-o, --softaculous Install Softaculous [yes|no] default: yes
7980
-q, --quota Filesystem Quota [yes|no] default: no
8081
-l, --lang Default language default: en
8182
-y, --interactive Interactive install [yes|no] default: yes
@@ -85,7 +86,7 @@ help() {
8586
-f, --force Force installation
8687
-h, --help Print this help
8788
88-
Example: bash $0 -e demo@hestiacp.com -p p4ssw0rd --apache no --phpfpm yes"
89+
Example: bash $0 -e demo@vestacp.com -p p4ssw0rd --apache no --phpfpm yes"
8990
exit 1
9091
}
9192

@@ -163,6 +164,7 @@ for arg; do
163164
--iptables) args="${args}-i " ;;
164165
--fail2ban) args="${args}-b " ;;
165166
--remi) args="${args}-r " ;;
167+
--softaculous) args="${args}-o " ;;
166168
--quota) args="${args}-q " ;;
167169
--lang) args="${args}-l " ;;
168170
--interactive) args="${args}-y " ;;
@@ -196,6 +198,7 @@ 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:fh" Option; do
196198
i) iptables=$OPTARG ;; # Iptables
197199
b) fail2ban=$OPTARG ;; # Fail2ban
198200
r) remi=$OPTARG ;; # Remi repo
201+
o) softaculous=$OPTARG ;; # Softaculous plugin
199202
q) quota=$OPTARG ;; # FS Quota
200203
l) lang=$OPTARG ;; # Language
201204
y) interactive=$OPTARG ;; # Interactive install
@@ -229,6 +232,7 @@ else
229232
fi
230233
set_default_value 'iptables' 'yes'
231234
set_default_value 'fail2ban' 'yes'
235+
set_default_value 'softaculous' 'yes'
232236
set_default_value 'quota' 'no'
233237
set_default_value 'interactive' 'yes'
234238
set_default_lang 'en'
@@ -270,7 +274,7 @@ if [ ! -e '/usr/bin/wget' ]; then
270274
fi
271275

272276
# Checking repository availability
273-
wget -q "https://gpg.hestiacp.com/deb_signing.key" -O /dev/null
277+
wget -q "$vestacp/deb_signing.key" -O /dev/null
274278
check_result $? "No access to Vesta repository"
275279

276280
# Check installed packages
@@ -305,13 +309,13 @@ fi
305309
# Printing nice ascii aslogo
306310
clear
307311
echo
308-
echo ' _ _ _ _ ____ ____ '
309-
echo ' | | | | ___ ___| |_(_) __ _ / ___| _ \ '
310-
echo ' | |_| |/ _ \/ __| __| |/ _` | | | |_) |'
311-
echo ' | _ | __/\__ \ |_| | (_| | |___| __/ '
312-
echo ' |_| |_|\___||___/\__|_|\__,_|\____|_| '
312+
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|'
313+
echo ' _| _| _| _| _| _| _|'
314+
echo ' _| _| _|_|_| _|_| _| _|_|_|_|'
315+
echo ' _| _| _| _| _| _| _|'
316+
echo ' _| _|_|_|_| _|_|_| _| _| _|'
313317
echo
314-
echo ' Hestia Control Panel'
318+
echo ' Vesta Control Panel'
315319
echo -e "\n\n"
316320

317321
echo 'Following software will be installed on your system:'
@@ -470,8 +474,8 @@ wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
470474
apt-key add /tmp/nginx_signing.key
471475

472476
# Installing vesta repo
473-
echo "deb http://$RHOST/ $codename main" > $apt/hestia.list
474-
wget https://gpg.hestiacp.com/deb_signing.key -O deb_signing.key
477+
echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list
478+
wget $CHOST/deb_signing.key -O deb_signing.key
475479
apt-key add deb_signing.key
476480

477481

@@ -613,6 +617,9 @@ if [ "$postgresql" = 'no' ]; then
613617
software=$(echo "$software" | sed -e 's/php-pgsql//')
614618
software=$(echo "$software" | sed -e 's/phppgadmin//')
615619
fi
620+
if [ "$softaculous" = 'no' ]; then
621+
software=$(echo "$software" | sed -e 's/vesta-softaculous//')
622+
fi
616623
if [ "$iptables" = 'no' ] || [ "$fail2ban" = 'no' ]; then
617624
software=$(echo "$software" | sed -e 's/fail2ban//')
618625
fi
@@ -978,8 +985,9 @@ if [ "$mysql" = 'yes' ]; then
978985
check_result $? "mysql start failed"
979986

980987
# Securing MySQL installation
981-
mysqladmin -u root password $vpass
982-
echo -e "[client]\npassword='$vpass'\n" > /root/.my.cnf
988+
mpass=$(gen_pass)
989+
mysqladmin -u root password $mpass
990+
echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf
983991
chmod 600 /root/.my.cnf
984992
mysql -e "DELETE FROM mysql.user WHERE User=''"
985993
mysql -e "DROP DATABASE test" >/dev/null 2>&1
@@ -1001,9 +1009,10 @@ fi
10011009
#----------------------------------------------------------#
10021010

10031011
if [ "$postgresql" = 'yes' ]; then
1012+
ppass=$(gen_pass)
10041013
wget $vestacp/postgresql/pg_hba.conf -O /etc/postgresql/*/main/pg_hba.conf
10051014
service postgresql restart
1006-
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$vpass'"
1015+
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
10071016

10081017
# Configuring phpPgAdmin
10091018
if [ "$apache" = 'yes' ]; then
@@ -1262,7 +1271,7 @@ if [ "$iptables" = 'yes' ]; then
12621271
fi
12631272

12641273
# Get public ip
1265-
pub_ip=$(curl -s https://hestiacp.com/what-is-my-ip/)
1274+
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
12661275

12671276
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
12681277
$VESTA/bin/v-change-sys-ip-nat $ip $pub_ip
@@ -1291,13 +1300,13 @@ fi
12911300

12921301
# Configuring mysql host
12931302
if [ "$mysql" = 'yes' ]; then
1294-
$VESTA/bin/v-add-database-host mysql localhost root $vpass
1303+
$VESTA/bin/v-add-database-host mysql localhost root $mpass
12951304
$VESTA/bin/v-add-database admin default default $(gen_pass) mysql
12961305
fi
12971306

12981307
# Configuring pgsql host
12991308
if [ "$postgresql" = 'yes' ]; then
1300-
$VESTA/bin/v-add-database-host pgsql localhost postgres $vpass
1309+
$VESTA/bin/v-add-database-host pgsql localhost postgres $ppass
13011310
$VESTA/bin/v-add-database admin db db $(gen_pass) pgsql
13021311
fi
13031312

@@ -1330,6 +1339,11 @@ if [ "$quota" = 'yes' ]; then
13301339
$VESTA/bin/v-add-sys-quota
13311340
fi
13321341

1342+
# Enabling softaculous plugin
1343+
if [ "$softaculous" = 'yes' ]; then
1344+
$VESTA/bin/v-add-vesta-softaculous
1345+
fi
1346+
13331347
# Starting vesta service
13341348
update-rc.d vesta defaults
13351349
service vesta start
@@ -1347,9 +1361,6 @@ $VESTA/bin/v-add-cron-vesta-autoupdate
13471361
# Vesta Access Info #
13481362
#----------------------------------------------------------#
13491363

1350-
# Sending install notification to hestiacp.com
1351-
wget https://hestiacp.com/notify/?os=$os\&version=$release -O /dev/null -q
1352-
13531364
# Comparing hostname and ip
13541365
host_ip=$(host $servername| head -n 1 | awk '{print $NF}')
13551366
if [ "$host_ip" = "$ip" ]; then
@@ -1370,20 +1381,20 @@ Thank you.
13701381
13711382
--
13721383
Sincerely yours
1373-
HestiaCP.com team
1384+
vestacp.com team
13741385
" > $tmpfile
13751386

13761387
send_mail="$VESTA/web/inc/mail-wrapper.php"
1377-
cat $tmpfile | $send_mail -s "Hestia Control Panel" $email
1388+
cat $tmpfile | $send_mail -s "Vesta Control Panel" $email
13781389

13791390
# Congrats
13801391
echo '======================================================='
13811392
echo
1382-
echo ' _ _ _ _ ____ ____ '
1383-
echo ' | | | | ___ ___| |_(_) __ _ / ___| _ \ '
1384-
echo ' | |_| |/ _ \/ __| __| |/ _` | | | |_) |'
1385-
echo ' | _ | __/\__ \ |_| | (_| | |___| __/ '
1386-
echo ' |_| |_|\___||___/\__|_|\__,_|\____|_| '
1393+
echo ' _| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_| '
1394+
echo ' _| _| _| _| _| _| _| '
1395+
echo ' _| _| _|_|_| _|_| _| _|_|_|_| '
1396+
echo ' _| _| _| _| _| _| _| '
1397+
echo ' _| _|_|_|_| _|_|_| _| _| _| '
13871398
echo
13881399
echo
13891400
cat $tmpfile

0 commit comments

Comments
 (0)