Roundcube Installation: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(35 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
= Roundcube Webmail unter Debian 12 installieren =
+
=Roundcube Webmail=
*apt install php php-cli php-common php-curl php-gd php-intl php-mbstring php-mysql php-xml php-zip php-imagick php-apcu libapache2-mod-php unzip php-imap mariadb-server mariadb-client
+
{{#drawio:roundcube}}
  
 +
==Einführung==
 +
Roundcube ist ein webbasierter IMAP-Client der direkt im Browser läuft.
 +
Er wird auf dem Mailserver installiert und ermöglicht den Zugriff auf Mails über HTTPS.
  
 +
==Voraussetzungen==
 +
* Funktionierender Postfix + Dovecot auf demselben Server
 +
* Apache2, MariaDB, PHP 8.1+
  
== Einführung ==
+
==Installation==
Roundcube ist ein webbasiertes E-Mail-Client-Programm, das es ermöglicht, E-Mails von IMAP-Servern wie web.de, GMX oder Gmail direkt über den Browser abzurufen. Diese Anleitung beschreibt die Installation von Roundcube auf Debian 12.
+
;Pakete installieren
 +
*apt update
 +
*apt install apache2 mariadb-server php php-cli php-common php-curl php-gd php-intl php-mbstring php-mysql php-xml php-zip php-imagick php-apcu libapache2-mod-php unzip
  
== Voraussetzungen ==
+
;Roundcube herunterladen (Hier gibt es aktuelle Versionen: https://roundcube.net/download/ )
* Ein funktionierender '''Mailserver''' mit '''IMAP''' (z. B. Dovecot) und '''SMTP''' (z. B. Postfix)
+
*cd /root
* Ein '''Debian 12'''-Server mit '''Apache2''', '''MariaDB''' und '''PHP 8.2'''
+
*wget https://github.com/roundcube/roundcubemail/releases/download/1.7.1/roundcubemail-1.7.1-complete.tar.gz
* Eine registrierte '''Domain''' (z. B. ''webmail.example.com'')
+
*tar -xzvf roundcubemail-1.7.1-complete.tar.gz
* '''Let's Encrypt''' oder ein anderes SSL-Zertifikat für HTTPS
+
*mv roundcubemail-1.7.1 /var/www/roundcube
  
= Dateien herunterladen =
+
;Berechtigungen setzen
== In das temporäre Verzeichnis wechseln ==
+
*chown -R www-data:www-data /var/www/roundcube/
* cd /tmp
+
*chmod -R 750 /var/www/roundcube/
  
== Die aktuelle Version von Roundcube herunterladen ==
+
==Apache-Konfiguration==
Die aktuelle Version ist unter https://github.com/roundcube/roundcubemail/releases verfügbar.
+
;Module aktivieren
* wget https://github.com/roundcube/roundcubemail/releases/download/1.6.0/roundcubemail-1.6.0-complete.tar.gz
+
*a2enmod ssl rewrite headers
  
== Archiv entpacken und bereinigen ==
+
;Für die Installation brauchen wir diese Konfiguration
* tar xvf roundcubemail-1.6.6-complete.tar.gz
 
* rm roundcubemail-1.6.6-complete.tar.gz
 
 
 
== Dateien ins Webserver-Verzeichnis verschieben ==
 
* mv roundcubemail-1.6.6 /var/www/
 
* mv /var/www/roundcubemail-1.6.6 /var/www/roundcube
 
 
 
= Apache-Konfiguration erstellen =
 
== Virtuelle Host-Datei erstellen ==
 
* nano /etc/apache2/sites-available/roundcube.conf
 
  
 +
;Virtuelle Host-Datei erstellen
 +
*vi /etc/apache2/sites-available/roundcube.conf
 
<pre>
 
<pre>
 
<VirtualHost *:80>
 
<VirtualHost *:80>
    ServerAdmin webmaster@example.com
+
    ServerName mail.it2XX.int
    DocumentRoot /var/www/roundcube/
+
    Redirect permanent / https://mail.it2XX.int/
    ServerName webmail.example.com
+
</VirtualHost>
    ServerAlias webmail.example.com
+
<VirtualHost *:443>
    <Directory /var/www/roundcube/>
+
    ServerName mail.it2XX.int
 +
    SSLEngine on
 +
    SSLCertificateFile /etc/ssl/own.crt
 +
    SSLCertificateKeyFile /etc/ssl/own.key
 +
    ServerAdmin technik@it2XX.int
 +
    DocumentRoot /var/www/roundcube
 +
    <Directory /var/www/roundcube>
 
         Options +FollowSymlinks
 
         Options +FollowSymlinks
 
         AllowOverride All
 
         AllowOverride All
 
         Require all granted
 
         Require all granted
          <IfModule mod_dav.c>
+
        <IfModule mod_dav.c>
 
             Dav off
 
             Dav off
          </IfModule>
+
        </IfModule>
 
         SetEnv HOME /var/www/roundcube
 
         SetEnv HOME /var/www/roundcube
 
         SetEnv HTTP_HOME /var/www/roundcube
 
         SetEnv HTTP_HOME /var/www/roundcube
    </Directory>
+
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
+
    ErrorLog ${APACHE_LOG_DIR}/mail-error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
+
    CustomLog ${APACHE_LOG_DIR}/mail-access.log combined
 
</VirtualHost>
 
</VirtualHost>
 
</pre>
 
</pre>
  
== Konfiguration aktivieren und Apache neu starten ==
+
*a2ensite roundcube.conf
* a2ensite roundcube.conf
+
*systemctl restart apache2
* systemctl restart apache2
 
  
= Datenbank einrichten =
+
==Datenbank einrichten==
== MariaDB starten ==
+
*mysql -u root
* mysql -u root -p
+
<syntaxhighlight lang="sql">
 +
CREATE DATABASE roundcubemail;
 +
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY '123Start$';
 +
GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost';
 +
FLUSH PRIVILEGES;
 +
EXIT;
 +
</syntaxhighlight>
  
== Datenbank und Benutzer erstellen ==
+
==Installer aufrufen==
* CREATE DATABASE roundcube;
+
;Installation über den Webinstaller abschließen
* CREATE USER 'roundcubeuser'@'localhost' IDENTIFIED BY 'sicherespasswort';
+
*https://mail.it2XX.int/installer
* GRANT ALL PRIVILEGES ON roundcube.* TO 'roundcubeuser'@'localhost';
 
* FLUSH PRIVILEGES;
 
* EXIT;
 
  
= Berechtigungen setzen =
+
;Einstellungen im Installer
* chown -R www-data:www-data /var/www/roundcube/
+
{| class="wikitable"
* chmod -R 750 /var/www/roundcube/
+
! Parameter !! Wert
 +
|-
 +
| Database Server || localhost
 +
|-
 +
| Database name || roundcubemail
 +
|-
 +
| Database username || roundcube
 +
|-
 +
| Database password || 123Start$
 +
|-
 +
| imap_host || ssl://mail.it2XX.int:993
 +
|-
 +
| smtp_host || ssl://mail.it2XX.int:465
 +
|}
  
= Sicherheitsmaßnahmen =
+
;Datenbank initialisieren
== Installer-Verzeichnis nach der Installation entfernen ==
+
*Initialize database → Test klicken
* rm -rf /var/www/roundcube/installer
 
  
== Konfigurationsdateien absichern ==
+
==Installation abschließen==
* chmod 640 /var/www/roundcube/config/config.inc.php
+
;Installer-Verzeichnis entfernen
* chown root:www-data /var/www/roundcube/config/config.inc.php
+
*rm -rf /var/www/roundcube/installer
  
== Apache-Sicherheitsheader setzen ==
+
;Konfigurationsdatei absichern
* nano /etc/apache2/conf-available/security.conf
+
*chmod 640 /var/www/roundcube/config/config.inc.php
<pre>
+
*chown root:www-data /var/www/roundcube/config/config.inc.php
Header always set X-Frame-Options DENY
+
 
Header always set X-XSS-Protection "1; mode=block"
+
==Für den Betrieb brauchen wir diese Konfiguration==
Header always set X-Content-Type-Options nosniff
+
Die roten Zeilen müssen geändert oder ergänzt werden-
</pre>
+
 
* a2enmod headers
+
;Virtuelle Host-Datei erstellen
* systemctl restart apache2
+
*vi /etc/apache2/sites-available/roundcube.conf
 +
<VirtualHost *:80>
 +
    ServerName mail.it2XX.int
 +
    Redirect permanent / https://mail.it2XX.int/
 +
</VirtualHost>
 +
<VirtualHost *:443>
 +
    ServerName mail.it2XX.int
 +
    SSLEngine on
 +
    SSLCertificateFile /etc/ssl/own.crt
 +
    SSLCertificateKeyFile /etc/ssl/own.key
 +
    ServerAdmin technik@it2XX.int
 +
    <span style="color:red;"><nowiki>DocumentRoot /var/www/roundcube/public_html</nowiki></span>
 +
    <span style="color:red;"><nowiki><Directory /var/www/roundcube/public_html></nowiki></span>
 +
        Options +FollowSymlinks
 +
        AllowOverride All
 +
        Require all granted
 +
        <IfModule mod_dav.c>
 +
            Dav off
 +
        </IfModule>
 +
        SetEnv HOME /var/www/roundcube
 +
        SetEnv HTTP_HOME /var/www/roundcube
 +
    </Directory>
 +
    ErrorLog ${APACHE_LOG_DIR}/mail-error.log
 +
    CustomLog ${APACHE_LOG_DIR}/mail-access.log combined
 +
</VirtualHost>
 +
 
 +
 
 +
*systemctl restart apache2
  
= Installation abschließen =
+
==Test==
* Die Roundcube-Installation aufrufen: https://webmail.example.com/installer
+
;Roundcube aufrufen und einloggen
* Nach Abschluss der Installation das installer-Verzeichnis löschen
+
*https://mail.it2XX.int
** rm -rf /var/www/roundcube/installer
 
  
Falls es Probleme gibt, kann die offizielle Dokumentation unter https://roundcube.net/help konsultiert werden.
+
[[Kategorie:Mail]]

Aktuelle Version vom 10. Juni 2026, 14:02 Uhr

Roundcube Webmail

Einführung

Roundcube ist ein webbasierter IMAP-Client der direkt im Browser läuft. Er wird auf dem Mailserver installiert und ermöglicht den Zugriff auf Mails über HTTPS.

Voraussetzungen

  • Funktionierender Postfix + Dovecot auf demselben Server
  • Apache2, MariaDB, PHP 8.1+

Installation

Pakete installieren
  • apt update
  • apt install apache2 mariadb-server php php-cli php-common php-curl php-gd php-intl php-mbstring php-mysql php-xml php-zip php-imagick php-apcu libapache2-mod-php unzip
Roundcube herunterladen (Hier gibt es aktuelle Versionen
https://roundcube.net/download/ )
Berechtigungen setzen
  • chown -R www-data:www-data /var/www/roundcube/
  • chmod -R 750 /var/www/roundcube/

Apache-Konfiguration

Module aktivieren
  • a2enmod ssl rewrite headers
Für die Installation brauchen wir diese Konfiguration
Virtuelle Host-Datei erstellen
  • vi /etc/apache2/sites-available/roundcube.conf
<VirtualHost *:80>
    ServerName mail.it2XX.int
    Redirect permanent / https://mail.it2XX.int/
</VirtualHost>
<VirtualHost *:443>
    ServerName mail.it2XX.int
    SSLEngine on
    SSLCertificateFile /etc/ssl/own.crt
    SSLCertificateKeyFile /etc/ssl/own.key
    ServerAdmin technik@it2XX.int
    DocumentRoot /var/www/roundcube
    <Directory /var/www/roundcube>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
        <IfModule mod_dav.c>
            Dav off
        </IfModule>
        SetEnv HOME /var/www/roundcube
        SetEnv HTTP_HOME /var/www/roundcube
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/mail-error.log
    CustomLog ${APACHE_LOG_DIR}/mail-access.log combined
</VirtualHost>
  • a2ensite roundcube.conf
  • systemctl restart apache2

Datenbank einrichten

  • mysql -u root
CREATE DATABASE roundcubemail;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY '123Start$';
GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Installer aufrufen

Installation über den Webinstaller abschließen
Einstellungen im Installer
Parameter Wert
Database Server localhost
Database name roundcubemail
Database username roundcube
Database password 123Start$
imap_host ssl://mail.it2XX.int:993
smtp_host ssl://mail.it2XX.int:465
Datenbank initialisieren
  • Initialize database → Test klicken

Installation abschließen

Installer-Verzeichnis entfernen
  • rm -rf /var/www/roundcube/installer
Konfigurationsdatei absichern
  • chmod 640 /var/www/roundcube/config/config.inc.php
  • chown root:www-data /var/www/roundcube/config/config.inc.php

Für den Betrieb brauchen wir diese Konfiguration

Die roten Zeilen müssen geändert oder ergänzt werden-

Virtuelle Host-Datei erstellen
  • vi /etc/apache2/sites-available/roundcube.conf
<VirtualHost *:80>
    ServerName mail.it2XX.int
    Redirect permanent / https://mail.it2XX.int/
</VirtualHost>
<VirtualHost *:443>
    ServerName mail.it2XX.int
    SSLEngine on
    SSLCertificateFile /etc/ssl/own.crt
    SSLCertificateKeyFile /etc/ssl/own.key
    ServerAdmin technik@it2XX.int
    DocumentRoot /var/www/roundcube/public_html 
    <Directory /var/www/roundcube/public_html>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
        <IfModule mod_dav.c>
            Dav off
        </IfModule>
        SetEnv HOME /var/www/roundcube
        SetEnv HTTP_HOME /var/www/roundcube
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/mail-error.log
    CustomLog ${APACHE_LOG_DIR}/mail-access.log combined
</VirtualHost>


  • systemctl restart apache2

Test

Roundcube aufrufen und einloggen