mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Debian11 installer
This commit is contained in:
parent
d946dbe412
commit
2c91d72277
1 changed files with 74 additions and 8 deletions
|
@ -19,7 +19,19 @@ release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
|
|||
codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
|
||||
vestacp="$VESTA/install/$VERSION/$release"
|
||||
|
||||
if [ "$release" -eq 10 ]; then
|
||||
if [ "$release" -eq 11 ]; then
|
||||
software="nginx apache2 apache2-utils
|
||||
libapache2-mod-fcgid php-fpm php
|
||||
php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
|
||||
vsftpd proftpd-basic bind9 exim4 exim4-daemon-heavy
|
||||
clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
|
||||
roundcube-mysql roundcube-plugins mariadb-server mariadb-common
|
||||
mariadb-client postgresql postgresql-contrib phppgadmin phpmyadmin mc
|
||||
flex whois git idn zip sudo bc ftp lsof ntpdate rrdtool quota
|
||||
e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
|
||||
bsdmainutils cron vesta vesta-nginx vesta-php expect libmail-dkim-perl
|
||||
unrar-free vim-common net-tools unzip iptables"
|
||||
elif [ "$release" -eq 10 ]; then
|
||||
software="nginx apache2 apache2-utils
|
||||
libapache2-mod-fcgid php-fpm php
|
||||
php-common php-cgi php-mysql php-curl php-fpm php-pgsql awstats
|
||||
|
@ -515,9 +527,11 @@ check_result $? 'apt-get upgrade failed'
|
|||
|
||||
# Installing nginx repo
|
||||
apt=/etc/apt/sources.list.d
|
||||
echo "deb http://nginx.org/packages/debian/ $codename nginx" > $apt/nginx.list
|
||||
wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
|
||||
apt-key add /tmp/nginx_signing.key
|
||||
if [ "$release" -ne 11 ]; then
|
||||
echo "deb http://nginx.org/packages/debian/ $codename nginx" > $apt/nginx.list
|
||||
wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
|
||||
apt-key add /tmp/nginx_signing.key
|
||||
fi
|
||||
|
||||
# Installing vesta repo
|
||||
echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list
|
||||
|
@ -801,7 +815,7 @@ if [ "$apache" = 'no' ] && [ "$nginx" = 'yes' ]; then
|
|||
echo "WEB_PORT='80'" >> $VESTA/conf/vesta.conf
|
||||
echo "WEB_SSL_PORT='443'" >> $VESTA/conf/vesta.conf
|
||||
echo "WEB_SSL='openssl'" >> $VESTA/conf/vesta.conf
|
||||
if [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
|
||||
if [ "$release" -eq 9 ] || [ "$release" -eq 10 ] || [ "$release" -eq 11 ]; then
|
||||
if [ "$phpfpm" = 'yes' ]; then
|
||||
echo "WEB_BACKEND='php-fpm'" >> $VESTA/conf/vesta.conf
|
||||
fi
|
||||
|
@ -887,6 +901,22 @@ if [ "$release" -eq 10 ]; then
|
|||
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-73.stpl
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-73.tpl
|
||||
fi
|
||||
if [ "$release" -eq 11 ]; then
|
||||
# Symlink missing templates
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.sh /usr/local/vesta/data/templates/web/nginx/default.sh
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.tpl /usr/local/vesta/data/templates/web/nginx/default.tpl
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/hosting.stpl /usr/local/vesta/data/templates/web/nginx/default.stpl
|
||||
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh /usr/local/vesta/data/templates/web/apache2/hosting.sh
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl /usr/local/vesta/data/templates/web/apache2/hosting.tpl
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl /usr/local/vesta/data/templates/web/apache2/hosting.stpl
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh /usr/local/vesta/data/templates/web/apache2/default.sh
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl /usr/local/vesta/data/templates/web/apache2/default.tpl
|
||||
ln -s /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl /usr/local/vesta/data/templates/web/apache2/default.stpl
|
||||
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.stpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-74.stpl
|
||||
ln -s /usr/local/vesta/data/templates/web/nginx/php-fpm/default.tpl /usr/local/vesta/data/templates/web/nginx/php-fpm/PHP-FPM-74.tpl
|
||||
fi
|
||||
|
||||
# Set nameservers
|
||||
sed -i "s/YOURHOSTNAME1/ns1.$servername/" /usr/local/vesta/data/packages/default.pkg
|
||||
|
@ -985,7 +1015,12 @@ fi
|
|||
#----------------------------------------------------------#
|
||||
|
||||
if [ "$phpfpm" = 'yes' ]; then
|
||||
if [ "$release" -eq 10 ]; then
|
||||
if [ "$release" -eq 11 ]; then
|
||||
cp -f $vestacp/php-fpm/www.conf /etc/php/7.4/fpm/pool.d/www.conf
|
||||
update-rc.d php7.4-fpm defaults
|
||||
service php7.4-fpm start
|
||||
check_result $? "php-fpm start failed"
|
||||
elif [ "$release" -eq 10 ]; then
|
||||
cp -f $vestacp/php-fpm/www.conf /etc/php/7.3/fpm/pool.d/www.conf
|
||||
update-rc.d php7.3-fpm defaults
|
||||
service php7.3-fpm start
|
||||
|
@ -1298,7 +1333,7 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
|
|||
/etc/roundcube/plugins/password/config.inc.php
|
||||
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
|
||||
chmod a+r /etc/roundcube/main.inc.php
|
||||
if [ "$release" -eq 8 ] || [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
|
||||
if [ "$release" -eq 8 ] || [ "$release" -eq 9 ] || [ "$release" -eq 10 ] || [ "$release" -eq 11 ]; then
|
||||
mv -f /etc/roundcube/main.inc.php /etc/roundcube/config.inc.php
|
||||
mv -f /etc/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
|
||||
chmod 640 /etc/roundcube/debian-db-roundcube.php
|
||||
|
@ -1371,6 +1406,11 @@ fi
|
|||
# Configure Admin User #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
if [ "$release" -eq 11 ]; then
|
||||
# Switching to sha512
|
||||
sed -i "s/obscure yescrypt/obscure sha512/g" /etc/pam.d/common-password
|
||||
fi
|
||||
|
||||
# Deleting old admin user
|
||||
if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then
|
||||
chattr -i /home/admin/conf > /dev/null 2>&1
|
||||
|
@ -1474,6 +1514,18 @@ if [ "$release" -eq 10 ]; then
|
|||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'no'
|
||||
fi
|
||||
fi
|
||||
if [ "$release" -eq 11 ]; then
|
||||
if [ -f "/etc/php/7.4/fpm/pool.d/$servername.conf" ]; then
|
||||
sed -i "/^group =/c\group = www-data" /etc/php/7.4/fpm/pool.d/$servername.conf
|
||||
sed -i "/max_execution_time/c\php_admin_value[max_execution_time] = 900" /etc/php/7.4/fpm/pool.d/$servername.conf
|
||||
sed -i "/request_terminate_timeout/c\request_terminate_timeout = 900s" /etc/php/7.4/fpm/pool.d/$servername.conf
|
||||
sed -i "s|80M|800M|g" /etc/php/7.4/fpm/pool.d/$servername.conf
|
||||
sed -i "s|256M|512M|g" /etc/php/7.4/fpm/pool.d/$servername.conf
|
||||
service php7.4-fpm restart
|
||||
ln -s /var/lib/roundcube /var/lib/roundcube/webmail
|
||||
/usr/local/vesta/bin/v-change-web-domain-proxy-tpl 'admin' "$servername" 'hosting-webmail-phpmyadmin' 'jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,woff,woff2' 'no'
|
||||
fi
|
||||
fi
|
||||
|
||||
# Adding cron jobs
|
||||
command="sudo $VESTA/bin/v-update-sys-queue disk"
|
||||
|
@ -1529,6 +1581,9 @@ fi
|
|||
if [ "$release" -eq 10 ]; then
|
||||
apt-get -y install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-curl php7.3-gd php7.3-intl php7.3-mysql php7.3-mysqlnd php7.3-pdo php7.3-soap php7.3-json php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
|
||||
fi
|
||||
if [ "$release" -eq 11 ]; then
|
||||
apt-get -y install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-curl php7.4-gd php7.4-intl php7.4-mysql php7.4-mysqlnd php7.4-pdo php7.4-soap php7.4-json php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
|
||||
fi
|
||||
|
||||
touch /var/log/php-mail.log
|
||||
chmod a=rw /var/log/php-mail.log
|
||||
|
@ -1560,6 +1615,17 @@ if [ "$release" -eq 10 ]; then
|
|||
fi
|
||||
service php7.3-fpm restart
|
||||
fi
|
||||
if [ "$release" -eq 11 ]; then
|
||||
if [ $memory -lt 10000000 ]; then
|
||||
echo "=== Patching php7.4-vps"
|
||||
patch /etc/php/7.4/fpm/php.ini < $vestacp/php/php7.4-vps.patch
|
||||
fi
|
||||
if [ $memory -gt 9999999 ]; then
|
||||
echo "=== Patching php7.4-dedi"
|
||||
patch /etc/php/7.4/fpm/php.ini < $vestacp/php/php7.4-dedi.patch
|
||||
fi
|
||||
service php7.4-fpm restart
|
||||
fi
|
||||
|
||||
# echo "=== Patching rcube_vcard.php"
|
||||
# wget -nv https://c.myvestacp.com/tools/patches/rcube_vcard.patch -O /root/rcube_vcard.patch
|
||||
|
@ -1649,7 +1715,7 @@ fi
|
|||
|
||||
echo "=== Set URL for phpmyadmin"
|
||||
echo "DB_PMA_URL='https://$servername/phpmyadmin/'" >> $VESTA/conf/vesta.conf
|
||||
if [ "$release" -eq 10 ]; then
|
||||
if [ "$release" -eq 10 ] || [ "$release" -eq 11 ]; then
|
||||
echo "=== Set max_length_of_MySQL_username=80"
|
||||
fi
|
||||
echo "MAX_DBUSER_LEN=80" >> $VESTA/conf/vesta.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue