installer_un_serveur_stun_turn_bigbluebutton
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| installer_un_serveur_stun_turn_bigbluebutton [2021/05/07 16:15] – créée n1c0 | installer_un_serveur_stun_turn_bigbluebutton [2023/04/11 21:50] (Version actuelle) – [Lier BigBlueButton au serveur coturn] Benjamin Labomedia | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Installer un serveur | + | ====== Installer un serveur TURN/STUN pour BigBlueButton ====== |
| + | Un serveur TURN/STUN permet à ceux qui se connectent aux Internets à travers un firewall restrictif (comme dans les entreprises ou les administrations de manière générale) d' | ||
| + | |||
| + | Normalement, | ||
| + | |||
| + | Dans ce tutoriel, traduit, adapté et augmenté à partir du [[https:// | ||
| + | |||
| + | On considère que le nom de domaine **coturn.mondomaine.org** pointe sur le serveur. | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | ==== Certificat TLS ==== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | On installe et met à jour snap : | ||
| + | |||
| + | <code bash> | ||
| + | snap install core; sudo snap refresh core | ||
| + | </ | ||
| + | |||
| + | On installe certbot : | ||
| + | |||
| + | <code bash> | ||
| + | snap install --classic certbot | ||
| + | </ | ||
| + | |||
| + | On fait un lien symbolique vers l’exécutable de certbot pour disposer de la commande dans le PATH : | ||
| + | |||
| + | <code bash> | ||
| + | ln -s / | ||
| + | </ | ||
| + | |||
| + | On crée le certificat pour le nom de domaine coturn.mondomaine.org, | ||
| + | |||
| + | <code bash> | ||
| + | certbot certonly --standalone --preferred-challenges http -d coturn.mondomaine.org | ||
| + | </ | ||
| + | |||
| + | ==== Coturn ==== | ||
| + | |||
| + | On installe le paquet **coturn** : | ||
| + | |||
| + | <code bash> | ||
| + | apt install coturn | ||
| + | </ | ||
| + | |||
| + | Le serveur **coturn** écoutera sur les ports : | ||
| + | * 443 (TCP/UDP) : accès au certificat TLS | ||
| + | * 3478 (TCP/UDP) : port d' | ||
| + | * 5349 (TCP/UDP) : port d' | ||
| + | |||
| + | Et communiquera avec les ports du serveur BigBlueButton via l' | ||
| + | |||
| + | Le serveur coturn fonctionne en tant que l’utilisateur **turnserver** et il devra être en mesure d' | ||
| + | |||
| + | On crée un dossier **/ | ||
| + | |||
| + | Aller dans le dossier **/ | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/bash -e | ||
| + | for certfile in fullchain.pem privkey.pem ; do | ||
| + | cp -L / | ||
| + | chown turnserver: | ||
| + | mv / | ||
| + | done | ||
| + | systemctl kill -sUSR2 coturn.service | ||
| + | </ | ||
| + | |||
| + | Rendre ce fichier executable : | ||
| + | |||
| + | <code bash> | ||
| + | chmod 0755 coturn | ||
| + | </ | ||
| + | |||
| + | ===== Configuration ===== | ||
| + | |||
| + | Le fichier de configuration de coturn est **/ | ||
| + | |||
| + | Dans ce fichier, on va modifier plusieurs variables et paramètres tel que montré ci-dessous. | ||
| + | |||
| + | * Remplacer <IP> par l'IP du serveur sur lequel coturn fonctionne, pas celle du serveur BigBlueButton. | ||
| + | * Remplacer < | ||
| + | |||
| + | <code bash> | ||
| + | listening-port=3478 | ||
| + | tls-listening-port=5349 | ||
| + | |||
| + | listening-ip=< | ||
| + | relay-ip=< | ||
| + | |||
| + | min-port=32769 | ||
| + | max-port=65535 | ||
| + | |||
| + | static-auth-secret=< | ||
| + | realm=coturn.mondomaine.org | ||
| + | |||
| + | cert=/ | ||
| + | pkey=/ | ||
| + | cipher-list=" | ||
| + | dh-file=/ | ||
| + | |||
| + | # If running coturn version older than 4.5.2, uncomment these rules and ensure | ||
| + | # that you have listening-ip set to ipv4 addresses only. | ||
| + | denied-peer-ip=0.0.0.0-0.255.255.255 | ||
| + | denied-peer-ip=127.0.0.0-127.255.255.255 | ||
| + | denied-peer-ip=:: | ||
| + | # Private (LAN) addresses | ||
| + | # If you are running BigBlueButton within a LAN, you might need to add an " | ||
| + | # IPv4 Private-Use | ||
| + | denied-peer-ip=10.0.0.0-10.255.255.255 | ||
| + | denied-peer-ip=172.16.0.0-172.31.255.255 | ||
| + | denied-peer-ip=192.168.0.0-192.168.255.255 | ||
| + | # Other IPv4 Special-Purpose addresses | ||
| + | denied-peer-ip=100.64.0.0-100.127.255.255 | ||
| + | denied-peer-ip=169.254.0.0-169.254.255.255 | ||
| + | denied-peer-ip=192.0.0.0-192.0.0.255 | ||
| + | denied-peer-ip=192.0.2.0-192.0.2.255 | ||
| + | denied-peer-ip=198.18.0.0-198.19.255.255 | ||
| + | denied-peer-ip=198.51.100.0-198.51.100.255 | ||
| + | denied-peer-ip=203.0.113.0-203.0.113.255 | ||
| + | # IPv6 Unique-Local | ||
| + | denied-peer-ip=fc00:: | ||
| + | # IPv6 Link-Local Unicast | ||
| + | denied-peer-ip=fe80:: | ||
| + | # Other IPv6 Special-Purpose assignments | ||
| + | denied-peer-ip=:: | ||
| + | denied-peer-ip=64: | ||
| + | denied-peer-ip=64: | ||
| + | denied-peer-ip=2001:: | ||
| + | denied-peer-ip=2001: | ||
| + | denied-peer-ip=2002:: | ||
| + | </ | ||
| + | |||
| + | Il faut aussi décommenter les paramètres suivants : | ||
| + | |||
| + | <code bash> | ||
| + | verbose | ||
| + | fingerprint | ||
| + | lt-cred-mech | ||
| + | use-auth-secret | ||
| + | keep-address-family | ||
| + | no-cli | ||
| + | no-tlsv1 | ||
| + | no-tlsv1_1 | ||
| + | # Block connections to IP ranges which shouldn' | ||
| + | no-multicast-peers | ||
| + | </ | ||
| + | |||
| + | Sauver le fichier. | ||
| + | |||
| + | ==== Fichier dhp.pem ==== | ||
| + | |||
| + | On voit qu'on a besoin de créer le fichier de clef custom DH TLS **/ | ||
| + | |||
| + | <code bash> | ||
| + | openssl dhparam -dsaparam -out / | ||
| + | </ | ||
| + | |||
| + | ==== Configuration du démarrage du service ==== | ||
| + | |||
| + | Quand le service **coturn** démarrera, il faut qu'il se lie (bind) au port 5349 (TLS). Il faut aussi augmenter le nombre de fichier que le service peut gérer. On crée un dossier **/ | ||
| + | |||
| + | <code bash> | ||
| + | mkdir -p / | ||
| + | </ | ||
| + | |||
| + | Dedans, on crée un fichier override.conf dans lequel on met : | ||
| + | |||
| + | <code bash> | ||
| + | [Service] | ||
| + | LimitNOFILE=1048576 | ||
| + | AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
| + | ExecStart= | ||
| + | ExecStart=/ | ||
| + | Restart=always | ||
| + | </ | ||
| + | |||
| + | ==== Logs (et rotation) ==== | ||
| + | |||
| + | On crée le dossier de logs de coturn en lui donnant les bons droits : | ||
| + | |||
| + | <code bash> | ||
| + | mkdir -p / | ||
| + | </ | ||
| + | |||
| + | Puis on configure la rotation en créant un fichier **/ | ||
| + | |||
| + | <code bash> | ||
| + | / | ||
| + | { | ||
| + | rotate 7 | ||
| + | daily | ||
| + | missingok | ||
| + | notifempty | ||
| + | compress | ||
| + | postrotate | ||
| + | / | ||
| + | endscript | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Redémarrer le serveur coturn ! (voir ci-dessous) | ||
| + | |||
| + | ===== Commandes ===== | ||
| + | |||
| + | A faire la 1ère fois seulement, on copie les clefs TLS dans le dossier / | ||
| + | |||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | On s’assure que le daemon prend en compte le fichier override.conf créé plus haut : | ||
| + | |||
| + | <code bash> | ||
| + | systemctl daemon-reload | ||
| + | </ | ||
| + | |||
| + | On redémarre le service : | ||
| + | |||
| + | <code bash> | ||
| + | systemctl restart coturn | ||
| + | </ | ||
| + | |||
| + | ===== Lier BigBlueButton au serveur coturn ===== | ||
| + | |||
| + | Sur le serveur qui héberge BigBlueButton, | ||
| + | |||
| + | Remplacer < | ||
| + | |||
| + | <code xml> | ||
| + | <beans xmlns=" | ||
| + | xmlns: | ||
| + | xsi: | ||
| + | http:// | ||
| + | "> | ||
| + | |||
| + | <bean id=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <!--bean id=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <!--bean id=" | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <!-- Turn servers are configured with a secret that's compatible with | ||
| + | | ||
| + | as supported by the coturn and rfc5766-turn-server turn servers --> | ||
| + | |||
| + | <bean id=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <bean id=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | <bean id=" | ||
| + | < | ||
| + | <set> | ||
| + | <ref bean=" | ||
| + | <!--ref bean=" | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <set> | ||
| + | <ref bean=" | ||
| + | <ref bean=" | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <set> | ||
| + | <!--ref bean=" | ||
| + | <!--ref bean=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Redémarrer BigBlueButton : | ||
| + | |||
| + | <code bash> | ||
| + | bbb-conf --restart | ||
| + | </ | ||
| + | |||
| + | Pour tester si le serveur coturn jour son rôle de relay, utiliser la méthode décrite dans le [[https:// | ||
| + | |||
| + | {{tag> | ||
installer_un_serveur_stun_turn_bigbluebutton.1620404121.txt.gz · Dernière modification : de n1c0
