Page 1 of 1

How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Sat Oct 21, 2017 10:10 pm
by dpeca
Image

First, let me say a few introduction words.

In this upgrading proccess I mostly left old conf files (from Debian8).
All daemons works very well with old conf files, as I expected (because every programmer leaves backward compatibility for conf files, for example, if they introduce some new variable in conf file, they will just set default value in case variable does not exists in conf file).

Now we have a full list of fresh conf files (modified in Debian9), and in next few weeks I will make 'diff' for those files, so we will have conf files that are 100% adapted to Debian9, and I will be able to adapt VestaCP installer and installer conf directory tree, so you will can install VestaCP directly to Debian9, not only through upgrade from Debian8 to Debian9.

Anyway, I'll repeat - everything works fine even with old conf files.

I still can not guarantee that absolutely everything works - but I went through all services - checked carefully - checked logs - and I didn't find any issue.

This upgrading manual is for standard VestaCP installation (nginx+apache), but I guess it will works for php-fpm stack too (and for Apache-only), just choose to leave old conf files for php-fpm.


So, here is step by step manual:
apt-get update
apt-get upgrade
apt-get dist-upgrade

sed -i 's/jessie/stretch/g' /etc/apt/sources.list
sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/nginx.list
sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/vesta.list

apt-get update
apt-get upgrade
Configuration file '/etc/spamassassin/local.cf' = N

apt-get dist-upgrade
# during upgrade proccess apt will ask you what to do for some services, choose the following options:
# configuring libc6 = select YES to restart services
# configuring roundcube database = select YES
# configuring phpmyadmin database = select YES
# Configuration file '/etc/systemd/timesyncd.conf' = Y
# Configuration file '/etc/exim4/exim4.conf.template' = N
# Configuration file '/etc/apache2/apache2.conf' = N
# Configuration file '/etc/roundcube/apache.conf' = Y
# Configuration file '/etc/roundcube/defaults.inc.php' = N
# Configuration file '/etc/roundcube/htaccess' = Y
# Configuration file '/etc/roundcube/plugins/jqueryui/config.inc.php' = Y
# configuring roundcube core = select YES = (it will probably show error, select RETRY, open new ssh terminal and see password from /etc/roundcube/debian-db.php = in debian-db-roundcube.php should be the same pass = if it's not, run 'mysql' and type GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY 'password-you-found-in-debian-db'; = enter that password when dialog in first terminal ask for database password) = avoid backuping database = keep the local version currently installed
# Configuration file '/etc/roundcube/plugins/password/config.inc.php' = N
# Configuration file '/etc/ssh/ssh_config' = Y
# configuring clamav-daemon = keep the local version currently installed
# modified /etc/dovecot/conf.d/10-logging.conf = keep the local version currently installed
# modified /etc/dovecot/conf.d/10-mail.conf = keep the local version currently installed
# modified /etc/dovecot/conf.d/15-mailboxes.conf = keep the local version currently installed
# modified /etc/dovecot/conf.d/20-imap.conf = keep the local version currently installed
# modified /etc/dovecot/conf.d/20-pop3.conf = keep the local version currently installed
# Configuration file '/etc/phpmyadmin/apache.conf' = Y
# Configuration file '/etc/phpmyadmin/config.inc.php' = N
# Configuring phpmyadmin = select YES = (open new ssh terminal and see password from /etc/phpmyadmin/config-db.php) = avoid backuping database = keep the local version currently installed
# Configuration file '/etc/vsftpd.conf' = N


reboot

# If you are using PHP via Apache then run this three commands:
a2dismod php5
a2enmod php7.0
service apache2 restart

chown -R admin:admin /var/log/roundcube
chmod -R 0644 /var/log/roundcube
chmod 0755 /var/log/roundcube

echo "\$cfg['blowfish_secret'] = 'qtdRoGmbc9{8IZr323xYcSN]0s)r$9b_JUnb{~XQ';" >> /etc/phpmyadmin/config.inc.php
# change this hash string to randomly hash

sed -i '1s#^#Alias /webmail /var/lib/roundcube\n#' /etc/roundcube/apache.conf
service apache2 reload

sed -i "s/listen %ip%:%proxy_ssl_port%;/listen %ip%:%proxy_ssl_port% http2;/g" /usr/local/vesta/data/templates/web/nginx/hosting.stpl
sed -i "s/listen %ip%:%proxy_ssl_port%;/listen %ip%:%proxy_ssl_port% http2;/g" /usr/local/vesta/data/templates/web/nginx/default.stpl

if [ ! -f "/etc/dovecot/conf.d/15-mailboxes.conf" ]; then
mv /etc/dovecot/conf.d/15-mailboxes.conf.ucf-dist /etc/dovecot/conf.d/15-mailboxes.conf
fi
sed -i "s#namespace inbox {#namespace inbox {\n inbox = yes#" /etc/dovecot/conf.d/15-mailboxes.conf
service dovecot restart




I will appreciate feedbacks, so we can fix bugs if I missed to find them :)

P.S. Sorry for my not-perfectly english :)

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Sun Oct 22, 2017 12:56 am
by dpeca
Image

Here is how to enable http/2 on nginx.

You only need to edit /home/some_username/conf/web/YOURDOMAIN.COM.nginx.ssl.conf and find a line that begin with ''listen'' and add at at the end of line ssl http2 so line looks like:

Code: Select all

listen      111.222.111.222:443 ssl http2;
and then restart nginx:

Code: Select all

service nginx restart
Or better idea is to add this in /usr/local/vesta/data/templates/web/nginx/ in any .stpl file.
(in initial upgrade we already added it to default.stpl and hosting.stpl)

ALPN is also enabled, no need to configure anything.

You can test your site here: https://tools.keycdn.com/http2-test

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Mon Oct 23, 2017 8:52 pm
by imperio
How about a fresh installation on Debian 9?

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Tue Oct 24, 2017 6:21 am
by dpeca
Well, as I said in first post:
dpeca wrote:Now we have a full list of fresh conf files (modified in Debian9), and in next few weeks I will make 'diff' for those files, so we will have conf files that are 100% adapted to Debian9, and I will be able to adapt VestaCP installer and installer conf directory tree, so you will can install VestaCP directly to Debian9, not only through upgrade from Debian8 to Debian9.
But, anyway, Serghey must help us with 'stretch' repository on c.vestacp.com .
I'll do all the rest.

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Fri Oct 27, 2017 1:37 pm
by Mikorist
Thanks !

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Thu Apr 12, 2018 2:48 pm
by rajbdilip
Hi,

Thanks for the great post.

Everything worked great except enabling HTTP2.

For me /home/admin/conf/web/snginx.conf (Username: admin) was a blank file. And when I added the line, the server failed to restart with the following error:

Code: Select all

"listen" directive is not allowed here in /home/admin/conf/web/snginx.conf:1

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Thu Apr 12, 2018 2:55 pm
by dpeca
Things changed meanwhile.
Path is now /home/some_username/conf/web/YOURDOMAIN.COM.nginx.ssl.conf

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Sun Apr 15, 2018 3:36 pm
by rajbdilip
That worked.

Thanks dpeca.

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Mon Apr 30, 2018 12:04 am
by MainDude
Hi,
My I please get some guidance how to install VestaCP on RPI 3B plus using Raspbian stretch? That would be much appreciated.
Thanks

Re: How to sucessfully upgrade Debian8 to Debian9 using VestaCP

Posted: Mon Apr 30, 2018 9:57 am
by mehargags
MainDude wrote:
Mon Apr 30, 2018 12:04 am
Hi,
My I please get some guidance how to install VestaCP on RPI 3B plus using Raspbian stretch? That would be much appreciated.
Thanks
VestaCP is NOT SUPPORTED on ARM architecture