TASTE-OF-IT

ISPConfig Server-Panel – Update von Roundcube

roundcube - Logo

roundcube - Logo

Das Thema ist nicht direkt dem Server-Control-Panel ISPConfig zugehörig, jedoch nutze ich Roundcube nur dort. Der Webmail bietet eine gute und kostenlose Möglichkeit seine Mails im Browser zu bearbeiten. Nachfolgend die Beschreibung wie ich Roundcube welches per “https://www.meine-domain/webmail” aufrufbar ist, aktualisiert habe. Ich nutze den Skin Larry, beschreibe aber in einem Nachfolgeartikel die Umstellung auf das neue und responsive Theme Elastic.

Status Quo

Artikel wird stetig durch die neuste Version von Roundcube aktualisiert.

Roundcube 1.4.0 ist seit 9.11.2019 als Stable erschienen und bietet diverse Neuerungen, darunter:

Quelle: https://roundcube.net/news/2019/11/09/roundcube-1.4.0-released

benötigtes Paket

# apt install rsync

Backup Roundcube

Zuerst wird das alte Verzeichnis gesichert, dann noch die Datenbank. Die eigentlichen Dateien für die Konfiguration liegen unter /etc/roundcube/, die Programmdaten unter /var/lib/roundcube und /usr/share/roundcube. Achtung der Pfad /var/lib/roundcube wird in Teilen über symbolische Links verarbeitet, was bei einer Rücksicherung wichtig ist aber in der Sicherung mit tar und dem Parameter h berücksichtigt wird – siehe man tar:

# ls -hals /var/lib/roundcube/
insgesamt 308K
4,0K drwxr-xr-x  8 root root 4,0K Aug 23 00:21 .
4,0K drwxr-xr-x 71 root root 4,0K Jun  4 18:19 ..
4,0K drwxr-xr-x  2 root root 4,0K Aug 23 00:20 bin
184K -rw-r--r--  1 root root 181K Aug 10 21:04 CHANGELOG
4,0K -rw-r--r--  1 root root  940 Aug 10 21:04 composer.json-dist
   0 lrwxrwxrwx  1 root root   14 Jun 14 03:36 config -> /etc/roundcube
   0 lrwxrwxrwx  1 root root   23 Jun 14 03:36 .htaccess -> /etc/roundcube/htaccess
4,0K -rw-r--r--  1 root root 2,6K Aug 23 00:21 .htaccess.new
4,0K -rw-r--r--  1 root root 2,6K Mär  6  2020 .htaccess_old
 16K -rw-r--r--  1 root root  13K Aug 10 21:04 index.php
 16K -rw-r--r--  1 root root  13K Aug 10 21:04 INSTALL
 36K -rw-r--r--  1 root root  35K Aug 10 21:04 LICENSE
   0 lrwxrwxrwx  1 root root   19 Jun 14 03:36 logs -> ../../log/roundcube
4,0K drwxr-xr-x 35 root root 4,0K Aug 23 00:20 plugins
   0 lrwxrwxrwx  1 root root   28 Jun 14 03:36 program -> /usr/share/roundcube/program
4,0K -rw-r--r--  1 root root 3,8K Aug 10 21:04 README.md
4,0K drwxr-xr-x  5 root root 4,0K Aug 23 00:20 skins
4,0K drwxr-xr-x  7 root root 4,0K Aug 10 21:04 SQL
4,0K drwxr-x---  2 root root 4,0K Nov 20  2019 temp
8,0K -rw-r--r--  1 root root 4,1K Aug 10 21:04 UPGRADING
4,0K drwxr-xr-x  9 root root 4,0K Aug 23 00:20 vendor

Das Backup sieht dann wie folgt aus – Parameter “h” sichert auch symbolische Links und die Dateien. “h” muss beim Restore mit angegeben werden:

# cd /usr/local/src/
# tar czfh roundcube-files.tar.gz /var/lib/roundcube/
# tar czf roundcube-config.tar.gz /etc/roundcube/
mysqldump -u <Roundcube-Admin_User>-p "Roundcube-Datenbank-Name"> roundcubedb.sql

Installation Roundcube 1.4.10

Achtung – Wer evtl. eine ältere “/etc/roundcube/config.inc.php” verwendet und bei der Installation diese aktualisieren lässt, der muss sie neu konfigurieren, kann aber auch die alte verwenden, ein Backup wird automatisch im selben Verzeichnis erstellt.

# cd /usr/local/src/
# wget https://github.com/roundcube/roundcubemail/releases/download/1.4.10/roundcubemail-1.4.10-complete.tar.gz
# tar xfvz roundcubemail-1.4.10.tar.gz
# cd roundcubemail-1.4.10/
# ./bin/installto.sh /var/lib/roundcube/
Upgrading from 1.4.8. Do you want to continue? (y/N)
Copying files to target location....htaccess.new
.htaccess.new
done.

NOTICE: New .htaccess file saved as .htaccess.new.
NOTICE: JavaScript dependencies installation skipped...

Running update script at target...
Executing database schema update.
Updating database schema (2016081200)... [OK]
Updating database schema (2016100900)... [OK]
Updating database schema (2016112200)... [OK]
Updating database schema (2018021600)... [OK]
Updating database schema (2018122300)... [OK]
Updating database schema (2019092900)... [OK]
This instance of Roundcube is up-to-date.
Have fun!
All done.

Da bei einem Test die Weboberfläche nicht korrekt geladen wurde und ich feststellte, dass die Verzeichnisrechte nicht korrekt waren, habe ich diese neu gesetzt:

chown -R root:root /var/lib/roundcube/*
chown -R root:root /usr/share/roundcube/*
chown -R root:root /etc/roundcube/*
chown www-data:www-data /etc/roundcube/config.inc.php
chown www-data:www-data /etc/roundcube/debian-db.php
chown www-data:www-data /etc/roundcube/defaults.inc.php

Nun noch die alte .htaccess überprüfen und ggf. durch die neue überschreiben:

# cp /var/lib/roundcube/.htaccess.new /etc/roundcube/htaccess

Danach habe ich noch diese Regeln in der .htaccess aktiviert:

nano /var/lib/roundcube/.htaccess
# HSTS - HTTP Strict Transport Security
Header always set Strict-Transport-Security "max-age=31536000; preload" env=HTTPS

# X-Xss-Protection
# This header is used to configure the built in reflective XSS protection found in Internet Explorer, Chrome and Safari (Webkit). 
Header set X-XSS-Protection "1; mode=block"

# X-Content-Type-Options
# It prevents Google Chrome and Internet Explorer from trying to mime-sniff the content-type of a response away from the one being declared by the server.
Header set X-Content-Type-Options: "nosniff"

# CSP - Content Security Policy
# for better privacy/security ask browsers to not set the Referer
# more flags for script, stylesheets and images available, read RFC for more information
# Note: "Referrer-Policy: same-origin" is already set by php code.
Header set Content-Security-Policy "referrer no-referrer"

Roundcube ist wieder aktuell

Das war es schon und ist recht einfach. Final ist dann folgendes installiert Roundcube 1.4.0 mit den Plugins

Nacharbeiten

# rm -R /usr/local/src/roundcubemail-1.4.10/
# rm roundcubemail-1.4.10-complete.tar.gz

Installation Skin Elastic

Die Installation beschreibe ich hier: https://www.taste-of-it.de/roundcube-skin-elastic-installieren/

Have Fun …

Fehler – Datenbankfehler

Nach der Installation wird im Browser der Fehler “Datenbankfehler! Unable to connect to database!” angezeigt.

Roundcube Datenbankfehler

Das Updatescript zeigte folgenden Fehler:

Running update script at target...
Executing database schema update.
ERROR: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO)
ERROR: Failed to connect to database
All done.

Die Ursache ist die Datei /etc/roundcube/config.inc.php. Hier ist folgendes aktiv:

$config['db_dsnw'] = 'mysql://roundcube:@localhost/roundcubemail';

Die Datenbankkonfiguration ist jedoch bereits in der Datei “/etc/roundcube/debian-db-roundcube.php” eingetragen. Somit muss die config.inc.php angepasst werden und wie folgt abgeändert werden.

<?php
include_once("/etc/roundcube/debian-db-roundcube.php");
...
//$config['db_dsnw'] = 'mysql://roundcube:@localhost/roundcubemail';
...
Die mobile Version verlassen