Update vst-install-debian.sh

This commit is contained in:
dpeca 2019-08-25 22:59:14 +02:00 committed by GitHub
commit 8408825141
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1515,24 +1515,32 @@ host_ip=$(host $servername | head -n 1 | awk '{print $NF}')
if [ "$host_ip" != "$ip" ]; then if [ "$host_ip" != "$ip" ]; then
echo "***** PROBLEM: Hostname $servername is not pointing to your server (IP address $ip)" echo "***** PROBLEM: Hostname $servername is not pointing to your server (IP address $ip)"
echo "Without pointing your hostname to your IP, LetsEncrypt SSL will not be generated for your server hostname." echo "Without pointing your hostname to your IP, LetsEncrypt SSL will not be generated for your server hostname."
read -p "Try to point your hostname $servername to IP address $ip and then press ENTER." echo "Try to point your hostname $servername to IP address $ip and then press ENTER."
echo "For forcing LetsEncrypt installation press f and then ENTER."
read -p "If we detect that hostname is still not pointing to your IP, installer will skip LetsEncrypt installation." answer
host_ip=$(host $servername | head -n 1 | awk '{print $NF}') host_ip=$(host $servername | head -n 1 | awk '{print $NF}')
fi fi
if [ "$answer" = "f" ]; then
make_ssl=1
fi
if [ "$host_ip" = "$ip" ]; then if [ "$host_ip" = "$ip" ]; then
ip="$servername" ip="$servername"
make_ssl=1 make_ssl=1
fi fi
# Generating LE SSL if [ $make_ssl -eq 1 ]; then
www_host="www.$servername" # Check if www is also pointing to our IP
www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}') www_host="www.$servername"
if [ "$www_host_ip" != "$ip" ]; then www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}')
echo "=== Deleting www to server hostname" if [ "$www_host_ip" != "$ip" ]; then
$VESTA/bin/v-delete-web-domain-alias 'admin' "$servername" "$www_host" 'no' echo "=== Deleting www to server hostname"
$VESTA/bin/v-delete-dns-on-web-alias 'admin' "$servername" "$www_host" 'no' $VESTA/bin/v-delete-web-domain-alias 'admin' "$servername" "$www_host" 'no'
www_host="" $VESTA/bin/v-delete-dns-on-web-alias 'admin' "$servername" "$www_host" 'no'
www_host=""
fi
fi fi
echo "==="
echo "Hostname $servername is pointing to $host_ip" echo "Hostname $servername is pointing to $host_ip"
if [ $make_ssl -eq 1 ]; then if [ $make_ssl -eq 1 ]; then
@ -1540,8 +1548,9 @@ if [ $make_ssl -eq 1 ]; then
$VESTA/bin/v-add-letsencrypt-domain 'admin' "$servername" "$www_host" 'yes' $VESTA/bin/v-add-letsencrypt-domain 'admin' "$servername" "$www_host" 'yes'
$VESTA/bin/v-update-host-certificate 'admin' "$servername" $VESTA/bin/v-update-host-certificate 'admin' "$servername"
else else
echo "=== We will not generate SSL because of this" echo "We will not generate SSL because of this"
fi fi
echo "==="
echo "UPDATE_HOSTNAME_SSL='yes'" >> $VESTA/conf/vesta.conf echo "UPDATE_HOSTNAME_SSL='yes'" >> $VESTA/conf/vesta.conf
# Secret URL # Secret URL
@ -1557,10 +1566,11 @@ if [ "$port" != "8083" ]; then
$VESTA/bin/v-change-vesta-port $port $VESTA/bin/v-change-vesta-port $port
fi fi
echo "=== Set URL for phpmyadmin and max_length_of_MySQL_username=80" echo "=== Set URL for phpmyadmin"
echo "DB_PMA_URL='https://$servername/phpmyadmin/'" >> $VESTA/conf/vesta.conf echo "DB_PMA_URL='https://$servername/phpmyadmin/'" >> $VESTA/conf/vesta.conf
echo "=== Set max_length_of_MySQL_username=80"
echo "MAX_DBUSER_LEN=80" >> $VESTA/conf/vesta.conf echo "MAX_DBUSER_LEN=80" >> $VESTA/conf/vesta.conf
echo "================================================================"
#----------------------------------------------------------# #----------------------------------------------------------#
# Vesta Access Info # # Vesta Access Info #