Difference between revisions of "Guide/Server/de"

Jump to navigation Jump to search
5,677 bytes added ,  18:07, 3 December 2019
no edit summary
(Created page with "Zurück Category:Handbuch")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Guide/de|Zurück]]
[[Guide/de|Zurück]] | [[Guide/Server|English]] | [[Guide/Server/de|Deutsch]]
----
= TCP / IP =




XMPP verwendet die TCP/IP Ports


* 5222 für eine Client-zu-Server Verbindung (C2S)
* 5269 für eine Server-zu-Server Verbindung (S2S)
https://tools.ietf.org/html/rfc6120#section-14.7
= Domain Name System (DNS) =
Für die verschiedenen Dienste von XMPP werden in der Regel die folgenden Subdomains verwendet. Es folgt eine Übersicht von Subdomain, welche jedoch nicht zwinkend so benannte werden müssen.
* xmpp.domain.tld
* conference.domain.tld oder chat.domain.tld
* pubsub.domain.tld
* proxy.domain.tld
* uploads.domain.tld oder files.domain.tls
'domain.tld' ist durch die eigene Domain zu ersetzen.
== Service record (SRV record) ==
_xmpp-server._tcp.domain.tld. 150 IN    SRV 5 0 5269 xmpp.domain.tld.
_xmpp-client._tcp.domain.tld. 150 IN    SRV 5 0 5222 xmpp.domain.tld.
_xmpps-client._tcp.domain.tld. 113 IN  SRV 0 5 5223 xmpp.domain.tld.
dig SRV _xmpp-server._tcp.domain.tld
dig SRV _xmpp-client._tcp.domain.tld
dig SRV _xmpps-client._tcp.domain.tld
== WebSockets und BOSH (TXT record) ==
_xmppconnect.domain.tld. 86327 IN TXT "_xmpp-client-websocket=wss://domain.tld:443/xmpp-websocket"
_xmppconnect.domain.tld. 86327 IN TXT "_xmpp-client-xbosh=https://domain.tld:433/http-bind"
dig TXT _xmppconnect.domain.tld
* https://tools.ietf.org/html/rfc6120#section-3.2
* https://xmpp.org/extensions/xep-0156.html
* https://de.wikipedia.org/wiki/TXT_Resource_Record
* https://wiki.xmpp.org/web/SRV_Records
* https://prosody.im/doc/dns
* https://tools.ietf.org/html/rfc7395
= Ejabberd =
= Prosody =
Prosody ist ein in Lua geschriebener XMPP Server unter der MIT Lizenz. https://prosody.im.
Dokumentation findet man auf der Homepage: https://prosody.im/doc und bei den jeweiligen Modulen: https://modules.prosody.im/
Die Konfigurationsdateien sind in /etc/prosody/
Die Konfiguration aus dem Paket ist mit ein paar wenigen Anpassungen direkt nutzbar. Im folgendem Beispiel werden sehr viele Module und Optionen aufgelistet. Welche Module benötigt werden ist abhängig vom Einsatzgebiet. Es soll nur als Referenzbeispiel dienen.
== BOSH und WebSocket ==
Für BOSH und WebSocket wird ein Web-Server als Proxy verwendet.
=== Apache 2 Proxy Setup ===
a2enmod rewrite proxy proxy_http  # Module für BOSH
a2enmod proxy proxy_wstunnel      # Module für WebSocket
Setup for HTTP Port 80. Rewrite to HTTPS.
    <VirtualHost *:80>
        ServerAdmin webmaster@domain.tld
        DocumentRoot /var/www/domain.tld
        ServerName www.domain.tld
        ServerAlias domain.tld
        ServerSignature Off
        Header set Access-Control-Allow-Origin "*"
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    </VirtualHost>
    <VirtualHost *:443>                                                                                                                                                                                               
        ServerAdmin webmaster@domain.tld
        DocumentRoot /var/www/domain.tld
        ServerName www.domain.tld
        ServerAlias domain.tld
        ServerSignature Off                                               
        SSLEngine on                                                       
        SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"                             
        SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"                                                                         
        ErrorLog ${APACHE_LOG_DIR}/error.log                                                                                               
        SSLProxyEngine on                                                         
  <Location /http-bind>                                                                       
      Order allow,deny                                                             
      Allow from all                                                                           
  </Location>                                                                     
  RewriteEngine On                             
  RewriteRule ^/http-bind$ https://domain.tld:5281/http-bind [P,L]
                                                   
    <IfModule mod_proxy.c>                                               
    <IfModule mod_proxy_wstunnel.c>                                 
    ProxyTimeout 900                                               
        ProxyPreserveHost On                       
        ProxyPass /xmpp-websocket "wss://domain.tld:5281/ws"
    </IfModule>                                                         
    </IfModule>                                         
                         
    </VirtualHost>   
    <VirtualHost *:443>
        ServerAdmin webmaster@domain.tld
        DocumentRoot /var/www/domain.tld
        ServerName uploads.domain.tld
        ServerSignature Off
        SSLEngine on
        SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
        SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"
        ErrorLog ${APACHE_LOG_DIR}/error.log
        SSLProxyEngine on
        RewriteEngine On
        RewriteRule ^/upload/(.*) https://uploads.domain.tld:5281/upload/$1 [P,L]
    </VirtualHost>
=== cfg.lua ===
    Component "uploads.domain.tld" "http_upload"
    http_external_url = "https://uploads.domain.tld"
    http_upload_expire_after = 60 * 60 * 7
* https://prosody.im/doc/websocket
* https://prosody.im/doc/setting_up_bosh
= Spam =
https://github.com/JabberSPAM/blacklist
[[Category:XMPP-DE]]
[[Category:Handbuch]]
[[Category:Handbuch]]
161

edits

Navigation menu