Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Sv translation
languageen
Remarque

This page is no longer being updated. From BlueMind 4.8, please refer to the new BlueMind documentation

Introduction

This page describes the roll-out procedure for a BlueMind Edge server as a postfix and proxy relay.

Postulate

  • BlueMind is installed on the main server
  • the role bm-edge-role is installed on the so-called "Edge" server 
  • the Edge server's nginx web server is set up as a proxy relay that serves as a main server
Volet

On this page:

Sommaire

Related:

Diagramme Gliffy
namebm-edge-role-principe

Roll-out procedure

  1. Install BlueMind on the main server following the usual procedure


    Remarque

    The storage space for BlueMind backups must be accessible on this new server at /var/backups/bluemind

  2. Install the subscription on the secondary server as a file

    Info

    Reminder: the text file for the subscription can be installed on a server manually

    • for Ubuntu / Debian as /etc/apt/sources.list.d/bm.list
    • for RedHat / CentOS as /etc/yum.repos.d/bm.repo
  3. Install the package bm-edge-role on the edge server

    Tabs group
    borderall-sides
    navcolornavy
    Debian/UbuntuRedHat/CentOS
  4. Add the smtp relay role to the edge server in the main server's admin panel:
    • log into BlueMind on the main server as admin0@global.virt
    • browse to System management > Application servers
    • click New > Host
    • fill in the information for the new server:
    • click "Create & edit" or "Create" then click the corresponding row to edit it
    • in the Server roles tab:
      • enable the role "Mail relay"
      • if you are using the BlueMind nginx on this server, also enable the role "Edge reverse proxy HTTPS (DMZ)"
      • click Save
    • back in the servers list, the server is shown with the mail relay tag mail/smtp-edge:
  5. Set up the domain so that the edge server is used as a mail relay:
    • still signed in as admin0@global.virt, browse to System management > Manage domains
    • click the row for the domain you want to configure
    • in the Mail system tab, select the edge server you have created as mail server and click Save:
  6. Set up the server to send outgoing messages through the relay:
    • still signed in as admin0@global.virt, browse to System Management > System Configuration
    • in the Mail tab, fill in the Relay host field with the IP address or the edge server's host name and click Save:


Nginx

Setting up web access

Info

If you are using the BlueMind nginx, and therefore you have enabled the role "Mail relay" on this server (see above), then this section doesn't apply to you – please move on to paragraph 4.2 below.

  1. Log in as root on the edge server
  2. Browse to the folder /etc/nginx/sites-available:

    Bloc de code
    bm35-edge.bluemind.loc:~# cd /etc/nginx/sites-available
  3. Create a configuration file bm-proxy and edit it, e.g. using vim:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# vim bm-proxy
  4. Add the following command lines:

    Bloc de code
    server {
      listen 80;
      # <bluemind_external_url> is the external url users use connect to
      server_name <bluemind_external_url>;
    
      location / {
    	return 301 https://<bluemind_external_url>$request_uri;
      }
    }
    
    server {
      listen 443 ssl http2;
      server_name <bluemind_external_url>;
    
      ssl_certificate /etc/ssl/certs/bm_cert.pem;
      ssl_certificate_key /etc/ssl/certs/bm_cert.pem;
      ssl_session_timeout 5m;
      ssl_prefer_server_ciphers on;
    
      ssl_protocols TLSv1.2;
      ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA';
      add_header Strict-Transport-Security max-age=15768000; # six months
    
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
     location / {
    	# <internal_srv> is the main BlueMind server
        proxy_pass https://<internal_srv>;
      }
    
      location /webmail/ {
        client_max_body_size 0m;
        proxy_pass https://<internal_srv>/webmail/;
      }
    
      location /Microsoft-Server-ActiveSync {
        proxy_pass https://<internal_srv>/Microsoft-Server-ActiveSync;
        proxy_read_timeout 1200s;
        proxy_headers_hash_bucket_size 128;
        proxy_headers_hash_max_size 2048;
        client_max_body_size 0m;
        proxy_pass_header Server;
      } 
    
      location /eventbus {
        proxy_pass https://<internal_srv>;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }
    
      location /api/filehosting/ {
        client_max_body_size 0m;
        proxy_pass https://<internal_srv>$request_uri;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    
      location /api/attachment/ {
        client_max_body_size 0m;
        proxy_pass https://<internal_srv>$request_uri;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    
      location /fh/ {
        proxy_pass https://<internal_srv>/fh/;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    }
    
  5. Save file and exit the editor
  6. Run the following commands to set up the configuration:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# ln -s /etc/nginx/sites-available/bm-proxy /etc/nginx/sites-enabled/
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# rm /etc/nginx/sites-enabled/default
  7. Reload the nginx server configuration:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# service bm-nginx reload

Setting up the mail service

  1. On the edge server, copy the main server's configuration file located at /etc/nginx/global.d/bm-proxy-mail.conf. You can use scp to do this:

    Bloc de code
    bm35-edge.bluemind.loc:~# scp root@srv1.bluemind.loc:/etc/nginx/global.d/bm-mail-proxy.conf /etc/nginx/global.d/
  2. Edit the file /etc/nginx/global.d/bm-mail-proxy.conf on the relay server and replace the IP address in the line auth_http by the main server's IP address

  3. Reload the nginx configuration:

    Bloc de code
    bm35-edge.bluemind.loc:~# service bm-nginx reload

Setting up XMPP

For the server to manage the XMPP flow:

  1. create a file /etc/nginx/global.d/bm-xmpp-proxy.conf with the following contents:

    Bloc de code
    stream {
        upstream backend_xmpp {
            least_conn;
    
                    server 1.2.3.4:5222;
                    server 1.2.3.5:5222 backup;
        }
    
        server {
            listen 5222;
            proxy_pass backend_xmpp ;
        }
    }

    and replacing 1.2.3.4 by the main server's IP address or the server with the XMPP role if appropriate

  2. Reload the nginx configuration:

    Bloc de code
    bm35-edge.bluemind.loc:~# service bm-nginx reload

Apache Proxy

Info

BlueMind advises against using Apache as a reverse proxy.

You can also use Apache as a proxy instead of Nginx. To do this, you need a version of Apache equal to or above 2.4 and enable the following modules:

  • mod_ssl
  • mod_proxy and mod_proxy_wstunnel
  • mod_rewrite

VirtualHost example for Apache:

Bloc de code
<VirtualHost *:80>
        Redirect / https://<bluemind_external_url>/
</VirtualHost>

<VirtualHost *:443>
        SSLEngine On

        SSLCertificateFile     "/etc/ssl/certs/bm_cert.pem"
        SSLCertificateKeyFile  "/etc/ssl/certs/bm_cert.pem"

        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyVerify none

        # Websocket proxy
        RewriteEngine on
        RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
        RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
        RewriteRule .* wss://<internal_srv>%{REQUEST_URI} [P]

        ProxyPreserveHost On
        <Location />
                ProxyPass https://<internal_srv>/
                ProxyPassReverse https://<internal_srv>/
        </Location>
</VirtualHost>
Sv translation
languagede
Remarque

Diese Seite ist nicht mehr aktuell. Ab der Version BlueMind 4.8 finden Sie alle Infos in der neuen Dokumentation

Präsentation

In diesem Dokument wird das Verfahren für die Bereitstellung eines BlueMind Edge-Servers als Postfix- und Proxy-Relay beschrieben.

Prinzip

  • BlueMind ist auf dem Hauptserver installiert
  • die Rolle bm-edge-role ist auf dem sogenannten "Edge"-Server installiert
  • der nginx-Webserver des Edge-Servers ist als Proxy-Relay konfiguriert, das den Hauptserver bedient
Volet

Auf dieser Seite:

Sommaire

Verwandt:

Diagramme Gliffy
displayNamebm-edge-role-principe
namebm-edge-role-principe
pagePin1

Ablauf der Bereitstellung

  1. Installieren Sie BlueMind auf dem Hauptserver nach dem üblichen Verfahren

    Remarque

    Der Speicherplatz für BlueMind-Backups muss auf diesem neuen Server unter /var/backups/bluemind zugänglich sein

  2. Installieren Sie das Abonnement auf dem sekundären Server als Datei

    Info

    Zur Erinnerung: Die Textdatei, die dem Abonnement entspricht, kann manuell auf einem Server installiert werden

    • für Ubuntu / Debian als /etc/apt/sources.list.d/bm.list
    • für RedHat / CentOS als /etc/yum.repos.d/bm.repo
  3. installieren Sie das Paket bm-edge-role auf dem Edge-Server:

    Tabs group
    borderall-sides
    navcolornavy
    Debian/UbuntuRedHat/CentOS
  4. Dem Edge-Server im Administrationsbereich des Hauptservers die Rolle des smtp-Relays hinzufügen:
    • Auf dem Hauptserver mit dem Benutzer admin0@global.virt die Verbindung zu BlueMind herstellen
    • Navigieren Sie zu Systemadministration > Application Servers
    • Klicken Sie auf die Schaltfläche Neu > Server
    • Geben Sie die neuen Serverinformationen ein und klicken Sie auf Erstellen

      Klicken Sie auf "Erstellen & Editieren" oder auf "Erstellen" und in der Liste der Server auf die entsprechende Zeile
    • Gehen Sie auf die Registerkarte Server-Rollen:

      • Aktivieren Sie die Rolle "Mail-Relay"
      • Wenn Sie nginx von BlueMind auf diesem Serververwenden, aktivieren Sie auch die Rolle „HTTPS-Proxy Relay (DMZ)"
      • Klicken Sie auf "Speichern"
    • In der Liste der Server erscheint der Edge-Server nun mit dem Tag, das mit dem Mail/Smtp-Edge-Mail-Relay verknüpft ist
  5. Die Domain für die Verwendung dieses Servers als Mail-Relaykonfigurieren
    • Bleiben Sie als Benutzer admin0@global.virt angemeldet und gehen Sie zu Systemadministration > Überwachte Domains
    • klicken Sie auf die Zeile, die der zu konfigurierenden Domain entspricht
    • Wählen Sie auf der Registerkarte Messaging den Edge-Server als Mail-Relay aus und klicken Sie auf Speichern:
  6. Konfiguration des Servers, um ausgehende E-Mails über das Relay zu schicken:
    • Bleiben Sie als Benutzer admin0@global.virt angemeldet und gehen Sie zu Systemadministration > Systemkonfiguration
    • Füllen Sie in der Registerkarte Messaging das Feld Relay mit der IP-Adresse oder dem Hostnamen des Edge-Servers aus und klicken Sie auf Speichern:

Nginx

Konfigurieren des Webzugriffs

Info

Wenn Sie nginx von BlueMind verwenden und daher die „Proxy-Relay“-Rolle auf diesem Server aktiviert haben (siehe oben), betrifft dieser Abschnitt Sie nicht. Sie können zu Punkt 4.2 unten übergehen.

  1. Melden Sie sich als root auf dem Edge-Server an
  2. Gehen Sie zum Ordner /etc/nginx/sites-available

    Bloc de code
    bm35-edge.bluemind.loc:~# cd /etc/nginx/sites-available
  3. Erstellen Sie eine bm-proxy-Konfigurationsdatei und bearbeiten Sie diese z.B. mit vim:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# vim bm-proxy
  4. Fügen Sie die folgenden Zeilen ein:

    Bloc de code
    server {
      listen 80;
      # <url_externe_bluemind> désigne l'url externe à laquelle les utilisateurs se connectent
      server_name <url_externe_bluemind>;
    
      location / {
    	return 301 https://<url_externe_bluemind>$request_uri;
      }
    }
    
    server {
      listen 443 ssl http2;
      server_name <url_externe_bluemind>;
    
      ssl_certificate /etc/ssl/certs/bm_cert.pem;
      ssl_certificate_key /etc/ssl/certs/bm_cert.pem;
      ssl_session_timeout 5m;
      ssl_prefer_server_ciphers on;
    
      ssl_protocols TLSv1.2;
      ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA';
      add_header Strict-Transport-Security max-age=15768000; # six months
    
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
     location / {
    	# <srv_interne> est le serveur BlueMind principal
        proxy_pass https://<srv_interne>;
      }
    
      location /webmail/ {
        client_max_body_size 0m;
        proxy_pass https://<srv_interne>/webmail/;
      }
    
      location /Microsoft-Server-ActiveSync {
        proxy_pass https://<srv_interne>/Microsoft-Server-ActiveSync;
        proxy_read_timeout 1200s;
        proxy_headers_hash_bucket_size 128;
        proxy_headers_hash_max_size 2048;
        client_max_body_size 0m;
        proxy_pass_header Server;
      } 
    
      location /eventbus {
        proxy_pass https://<srv_interne>;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
      }
    
      location /api/filehosting/ {
        client_max_body_size 0m;
        proxy_pass https://<srv_interne>$request_uri;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    
      location /api/attachment/ {
        client_max_body_size 0m;
        proxy_pass https://<srv_interne>$request_uri;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    
      location /fh/ {
        proxy_pass https://<srv_interne>/fh/;
        proxy_http_version 1.1;
        proxy_buffering off;
      }
    }
    
  5. Speichern Sie die Datei und schließen Sie den Editor
  6. Führen Sie die folgenden Befehle aus, um die Konfiguration einzurichten:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# ln -s /etc/nginx/sites-available/bm-proxy /etc/nginx/sites-enabled/
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# rm /etc/nginx/sites-enabled/default
  7. Laden Sie die nginx-Serverkonfiguration neu:

    Bloc de code
    bm35-edge.bluemind.loc:/etc/nginx/sites-available# service bm-nginx reload

Messaging-Konfiguration

  1. Kopieren Sie auf dem Edge-Server die Hauptserver-Konfigurationsdatei, die sich unter /etc/nginx/global.d/bm-proxy-mail.conf befindet. Dies kann mit scp erfolgen:

    Bloc de code
    bm35-edge.bluemind.loc:~# scp root@srv1.bluemind.loc:/etc/nginx/global.d/bm-mail-proxy.conf /etc/nginx/global.d/
  2. Bearbeiten Sie die Datei /etc/nginx/global.d/bm-mail-proxy.conf auf dem Edge-Server und ersetzen Sie die IP-Adresse der Zeile auth_http durch die IP-Adresse des Hauptservers

  3. Laden Sie die nginx-Konfiguration neu:

    Bloc de code
    bm35-edge.bluemind.loc:~# service bm-nginx reload

XMPP-Konfiguration

Um zu erreichen, dass der Server das XMPP-Stream-Management unterstützt:

  1. erstellen Sie die Datei /etc/nginx/global.d/bm-xmpp-proxy.conf mit folgendem Inhalt:

    Bloc de code
    stream {
        upstream backend_xmpp {
            least_conn;
    
                    server 1.2.3.4:5222;
                    server 1.2.3.5:5222 backup;
        }
    
        server {
            listen 5222;
            proxy_pass backend_xmpp ;
        }
    }

    Indem Sie 1.2.3.4 durch die IP-Adresse des Hauptservers oder ggf. des Servers mit der XMPP-Rolle ersetzen

  2. Laden Sie die nginx-Konfiguration neu:

    Bloc de code
    bm35-edge.bluemind.loc:~# service bm-nginx reload

Apache-Proxy

Info

BlueMind rät jedoch davon ab, Apache als Reverse-Proxy zu verwenden

Es ist auch möglich, Apache als Proxy anstelle von Nginx zu verwenden. Dazu müssen Sie eine Version >=2.4 von Apache verwenden und die folgenden Module aktivieren:

  • mod_ssl
  • mod_proxy und mod_proxy_wstunnel
  • mod_rewrite

VirtualHost-Beispiel für Apache:

Bloc de code
<VirtualHost *:80>
        Redirect / https://<url_externe_bluemind>/
</VirtualHost>

<VirtualHost *:443>
        SSLEngine On

        SSLCertificateFile     "/etc/ssl/certs/bm_cert.pem"
        SSLCertificateKeyFile  "/etc/ssl/certs/bm_cert.pem"

        SSLProxyEngine On
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
        SSLProxyVerify none

        # Websocket proxy
        RewriteEngine on
        RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
        RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
        RewriteRule .* wss://<srv_interne>%{REQUEST_URI} [P]

        ProxyPreserveHost On
        <Location />
                ProxyPass https://<srv_interne>/
                ProxyPassReverse https://<srv_interne>/
        </Location>
</VirtualHost>

Speichern

Speichern

Speichern

Speichern

Speichern