From e609c6b70981f4a76cee10fc96b7ef5e66517722 Mon Sep 17 00:00:00 2001 From: Gregory Colpart Date: Sat, 28 Dec 2019 23:22:14 +0100 Subject: [PATCH] setup RTMP pour Nginx --- HowtoCeph.md | 4 ++-- HowtoDebian/Repository.md | 5 +++-- HowtoDocker.md | 2 +- HowtoElasticsearch.md | 2 +- HowtoGoAccess.md | 4 ++-- HowtoIcinga.md | 2 +- HowtoInfluxDB.md | 4 ++-- HowtoMySQL.md | 4 +++- HowtoNginx.md | 37 ++++++++++++++++++++++++++++++++++++- HowtoNodeJS.md | 6 +++--- HowtoTideways.md | 4 ++-- 11 files changed, 56 insertions(+), 18 deletions(-) diff --git a/HowtoCeph.md b/HowtoCeph.md index b85cc57a..6d3b6027 100644 --- a/HowtoCeph.md +++ b/HowtoCeph.md @@ -127,7 +127,7 @@ On commence par installer `ceph-deploy`, l'outil qui permet de déployer un clus ~~~ # apt update && apt install apt-transport-https -# wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - +# wget https://download.ceph.com/keys/release.asc -O /etc/apt/trusted.gpg.d/ceph.asc # echo deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list # apt update && apt install ceph-deploy ~~~ @@ -247,7 +247,7 @@ L'installation du client est analogue à celle des nœuds. On install Ceph sur l ~~~ # apt install apt-transport-https -# wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - +# wget https://download.ceph.com/keys/release.asc -O /etc/apt/trusted.gpg.d/ceph.asc # echo deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list # apt update && apt install ceph-common ~~~ diff --git a/HowtoDebian/Repository.md b/HowtoDebian/Repository.md index d08c9aaa..c9f86a84 100644 --- a/HowtoDebian/Repository.md +++ b/HowtoDebian/Repository.md @@ -162,7 +162,8 @@ Vous avez maintenant un dépôt Debian ! Pour télécharger des packages de votre archive, il est tout d'abord nécessaire d'installer la clé GPG qui a servi à signer les packages : ~~~ -# apt-key adv --fetch-key +# wget http://mondepot.fqdn.org/debian/ma_clef.gpg.asc -O /etc/apt/trusted.gpg.d/ma_clef.gpg.asc +# dos2unix /etc/apt/trusted.gpg.d/ma_clef.gpg.asc ~~~ Une fois que cela est fait, il ne vous reste plus qu'à ajouter votre dépôt dans votre _sources.list_ : @@ -175,4 +176,4 @@ deb http://debian.example.com/debian/ jessie main Parce que `reprepro` se veut un utilitaire simple créer des dépôts Debian (comparé à `dak` ou encore `mini-dak`), certaines choses ne sont pas possible : * Il n'est pas possible d'avoir plusieurs versions du même package dans une même distribution. La version plus ancienne est automatiquement remplacée par la plus récente. Il est cependant possible d'avoir des versions différentes pour chaque distribution. -* Un package ne peut pas avoir la même version dans plusieurs distributions tout en ayant un SHAsum différent. Dans ce cas, il est nécessaire de changer la version du package pour les distinguer (ex. `1.3.3-1+jessie` sur jessie et `1.3.3-1+wheezy` sur wheezy). Ceci n'est cependant pas un problème si le package est le même (même SHAsum) à travers plusieurs distributions. \ No newline at end of file +* Un package ne peut pas avoir la même version dans plusieurs distributions tout en ayant un SHAsum différent. Dans ce cas, il est nécessaire de changer la version du package pour les distinguer (ex. `1.3.3-1+jessie` sur jessie et `1.3.3-1+wheezy` sur wheezy). Ceci n'est cependant pas un problème si le package est le même (même SHAsum) à travers plusieurs distributions. diff --git a/HowtoDocker.md b/HowtoDocker.md index c6a34467..e13dd4ea 100644 --- a/HowtoDocker.md +++ b/HowtoDocker.md @@ -78,7 +78,7 @@ Il est conseillé d'utiliser le paquet docker-ce des dépôts du projet Docker : ~~~ # apt install apt-transport-https # echo "deb http://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker.list -# curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +# wget https://download.docker.com/linux/debian/gpg -O /etc/apt/trusted.gpg.d/docker.asc # apt update # apt install docker-ce ~~~ diff --git a/HowtoElasticsearch.md b/HowtoElasticsearch.md index 7dd73db9..84269ff4 100644 --- a/HowtoElasticsearch.md +++ b/HowtoElasticsearch.md @@ -15,7 +15,7 @@ Vu le développement actif d'Elasticsearch, nous préconisons l'installation des ~~~ # apt install apt-transport-https # echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" >> /etc/apt/sources.list.d/elastic.list -# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - +# wget https://artifacts.elastic.co/GPG-KEY-elasticsearch -O /etc/apt/trusted.gpg.d/elastic.asc # apt update # apt install elasticsearch ~~~ diff --git a/HowtoGoAccess.md b/HowtoGoAccess.md index 2b20dc3d..ef81faf1 100644 --- a/HowtoGoAccess.md +++ b/HowtoGoAccess.md @@ -15,7 +15,7 @@ Si besoin d'une version plus récente, l'upstream distribue des paquets Debian a ~~~ # echo "deb http://deb.goaccess.io $(lsb_release -cs) main" >> /etc/apt/sources.list.d/goaccess.list -# wget -O - http://deb.goaccess.io/gnugpg.key | apt-key add - +# wget http://deb.goaccess.io/gnugpg.key -O /etc/apt/trusted.gpg.d/goaccess.asc # apt update && apt install goaccess ~~~ @@ -94,4 +94,4 @@ Error occured at: src/parser.c - parse_log - xxxx No log format was found on your conf file. ~~~ -Si cette erreur survient, il faut modifier le fichier de conf /etc/goaccess.conf pour décomenter les valeurs logformat correspondant. \ No newline at end of file +Si cette erreur survient, il faut modifier le fichier de conf /etc/goaccess.conf pour décomenter les valeurs logformat correspondant. diff --git a/HowtoIcinga.md b/HowtoIcinga.md index b7f9a32c..059ef542 100644 --- a/HowtoIcinga.md +++ b/HowtoIcinga.md @@ -19,7 +19,7 @@ Sur Debian 9, tous les paquets (*icinga2* et *icingaweb2*) sont disponibles dans > >~~~ ># echo 'deb http://packages.icinga.com/debian icinga-jessie main' >/etc/apt/sources.list.d/icinga.list -># wget -O - http://packages.icinga.com/icinga.key | apt-key add - +># wget http://packages.icinga.com/icinga.key -O /etc/apt/trusted.gpg.d/icinga.asc > ># cat /etc/apt/preferences.d/icinga2 >Package: * diff --git a/HowtoInfluxDB.md b/HowtoInfluxDB.md index 43b66317..20dc4f04 100644 --- a/HowtoInfluxDB.md +++ b/HowtoInfluxDB.md @@ -13,7 +13,7 @@ title: Howto InfluxDB Nous utilisons les dépôts fournis par InfluxData pour avoir une version stable plus récente. ~~~ -# curl -sL https://repos.influxdata.com/influxdb.key | apt-key add - +# wget https://repos.influxdata.com/influxdb.key -O /etc/apt/trusted.gpg.d/influxdb.asc # echo "deb https://repos.influxdata.com/debian stretch stable" > /etc/apt/sources.list.d/influxdb.list # apt update # apt install influxdb @@ -187,4 +187,4 @@ Et on peut augmenter l'intervalle de vérification de la rétention : # The interval of time when retention policy enforcement checks run. check-interval = "24h" -~~~ \ No newline at end of file +~~~ diff --git a/HowtoMySQL.md b/HowtoMySQL.md index cd61e39d..4674e4f5 100644 --- a/HowtoMySQL.md +++ b/HowtoMySQL.md @@ -104,9 +104,11 @@ Pour installer MySQL 5.7 distribuée par Oracle sous Debian 9, on ajoute le dép ~~~ # echo "deb http://repo.mysql.com/apt/debian stretch mysql-5.7" > /etc/apt/sources.list.d/mysql57.list -# apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5 +# wget 'http://keys.gnupg.net/pks/lookup?op=get&search=0x8C718D3B5072E1F5' -O /etc/apt/trusted.gpg.d/mysql57.asc ~~~ +> *Note:* la clé GPG peut aussi être récupérée via https://dev.mysql.com/doc/refman/en/checking-gpg-signature.html + On peut ensuite installer les paquets : ~~~ diff --git a/HowtoNginx.md b/HowtoNginx.md index cda73d4d..36a82566 100644 --- a/HowtoNginx.md +++ b/HowtoNginx.md @@ -388,7 +388,6 @@ Puis ajouter dans votre VirtualHost : } ~~~ - ### Mode maintenance Il est possible de déclencher très facilement un mode maintenance avec une page spécifique. @@ -458,6 +457,7 @@ gzip_comp_level 6; gzip_types text/html text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/ecmascript application/xml application/xml+rss application/json image/svg+xml ~~~ + ## Monitoring ### log2mail @@ -630,6 +630,41 @@ location / { ~~~ +## RTMP + + + + +~~~ +# apt install libnginx-mod-rtmp +~~~ + +Configuration à ajouter à nginx.conf : + +~~~ +rtmp { + server { + listen 1935; + application live { + live on; + } + } +} +~~~ + +Publication d'un flux RTMP : + +~~~ +$ ffmpeg -thread_queue_size 0 -f v4l2 -i /dev/video0 -f flv "rtmp://127.0.0.1/live/foo" +~~~ + +Lecture d'un flux : + +~~~ +$ ffplay -probesize 32 -sync ext "rtmp://127.0.0.1/live/foo +~~~ + + ## FAQ ### Configuration en ligne diff --git a/HowtoNodeJS.md b/HowtoNodeJS.md index 10e234be..bd77dd6c 100644 --- a/HowtoNodeJS.md +++ b/HowtoNodeJS.md @@ -32,7 +32,7 @@ Nous préconisons l'installation des paquets Debian distribués par NodeSource ( ~~~ # echo "deb http://deb.nodesource.com/node_10.x stretch main" >> /etc/apt/sources.list.d/nodesource.list -# wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O - | apt-key add - +# wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O /etc/apt/trusted.gpg.d/nodesource.asc # apt update && apt install nodejs $ nodejs -v @@ -109,7 +109,7 @@ Installation via un paquet Debian : ~~~ # echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list -# wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +# wget https://dl.yarnpkg.com/debian/pubkey.gpg -O /etc/apt/trusted.gpg.d/yarn.asc # apt update && apt install yarn ~~~ @@ -231,4 +231,4 @@ sh: 1: node_modules/cross-env/dist/bin/cross-env.js: Permission denied […] ~~~ -Lorsque _npm_ lève une erreur _Permission denied_ alors que tout semble exister avec les bons droits, il faut vérifier que la partition courante ne soit pas montée en **noexec**. \ No newline at end of file +Lorsque _npm_ lève une erreur _Permission denied_ alors que tout semble exister avec les bons droits, il faut vérifier que la partition courante ne soit pas montée en **noexec**. diff --git a/HowtoTideways.md b/HowtoTideways.md index 7b5fe071..ed8138dd 100644 --- a/HowtoTideways.md +++ b/HowtoTideways.md @@ -12,7 +12,7 @@ Tideways est un APM pour les applications PHP. Il permet d'analyser des traces e ~~~ # echo 'deb http://s3-eu-west-1.amazonaws.com/tideways/packages debian main' > /etc/apt/sources.list.d/tideways.list -# wget -qO - https://s3-eu-west-1.amazonaws.com/tideways/packages/EEB5E8F4.gpg | apt-key add - +# wget https://s3-eu-west-1.amazonaws.com/tideways/packages/EEB5E8F4.gpg -O /etc/apt/trusted.gpg.d/tideways.gpg # apt update # apt install tideways-php tideways-daemon ~~~ @@ -30,4 +30,4 @@ SetEnv TIDEWAYS_SAMPLERATE 25 ~~~ Si le framework n'est pas connu par Tideways, il suffit de ne pas mettre la directive. -La variable `TIDEWAYS_SAMPLERATE` permet de définir le taux de requêtes (pourcentage) qui sera analysé via le profiler Tideways. \ No newline at end of file +La variable `TIDEWAYS_SAMPLERATE` permet de définir le taux de requêtes (pourcentage) qui sera analysé via le profiler Tideways.