Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
tutoriel:comment_creer_une_webradio [Le 15/04/2008, 15:36] 87.89.222.57, 127.0.0.1 |
tutoriel:comment_creer_une_webradio [Le 11/09/2022, 12:20] (Version actuelle) moths-art Suppression des espaces en fin de ligne (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag>tutoriel}} | + | {{tag>tutoriel radio audio}} |
| ---- | ---- | ||
| Ligne 5: | Ligne 5: | ||
| ====== Comment créer sa webradio ? ====== | ====== Comment créer sa webradio ? ====== | ||
| - | Ce tutoriel a pour but d'expliquer le plus simplement possible l'installation d'une [[wpfr>Net_radio|Webradio]] sous Ubuntu. | + | Ce tutoriel a pour but d'expliquer le plus simplement possible l'installation d'une **[[:radio|Webradio]]** sous Ubuntu. |
| - | + | ||
| - | Les webradios sont des stations plus ou moins semblables aux stations de radio. La particularité d’une webradio est qu’elle est diffusée sur Internet. | + | |
| - | + | ||
| - | ===== Pré-requis ===== | + | |
| - | + | ||
| - | Vérifiez que les [[:depots#universe_et_multiverse|dépôts Universe/Multiverse]] soient activés. | + | |
| ===== Installation ===== | ===== Installation ===== | ||
| - | [[apt://icecast2,mpd|{{ apt.png|Cliquez pour installer les paquets (Ubuntu ≥ 8.04 LTS).}}]] | + | [[:tutoriel:comment_installer_un_paquet|Installez les paquets]] **[[apt>icecast2,mpd|icecast2 mpd]]**. (Les [[:depots#universe_et_multiverse|dépôts Universe/Multiverse]] doivent être activés.) |
| - | + | ||
| - | [[:tutoriel:comment_installer_un_paquet|Installez les paquets]] **icecast2 mpd**. | + | |
| ===== Configuration de MPD ===== | ===== Configuration de MPD ===== | ||
| Ligne 26: | Ligne 17: | ||
| sudo dpkg-reconfigure mpd | sudo dpkg-reconfigure mpd | ||
| - | La configuration de MPD se fait par un simple fichier texte. [[:tutoriel:comment_editer_un_fichier|Éditer le fichier]] **/etc/mpd.conf**. | + | La configuration de MPD se fait par un fichier texte. [[:tutoriel:comment_editer_un_fichier|Éditer le fichier]] **/etc/mpd.conf**. |
| + | Avant la première utilisation de **mpd** , il est nécessaire de charger des musique dans la collection, sinon mpd n'aura aucune musique à lire. ( voir [[:mpd|Lien externe]] ) | ||
| - | Voici un exemple du fichier « mpd.conf » //à modifier en fonction de votre configuration// ! | + | Voici un exemple du fichier /etc/mpd.conf (à modifier en fonction de votre configuration) |
| <file> | <file> | ||
| Ligne 35: | Ligne 27: | ||
| # the user that mpd runs as (see the 'user' config parameter) | # the user that mpd runs as (see the 'user' config parameter) | ||
| # can read the files in this directory. | # can read the files in this directory. | ||
| - | music_directory "/home/pseudo/Musiques" #<----- LE CHEMIN VERS VOS FICHIERS DE MUSIQUES | + | music_directory "/home/pseudo/Musiques" #<----- LE CHEMIN VERS VOS FICHIERS DE MUSIQUE |
| playlist_directory "/var/lib/mpd/playlists" | playlist_directory "/var/lib/mpd/playlists" | ||
| db_file "/var/lib/mpd/tag_cache" | db_file "/var/lib/mpd/tag_cache" | ||
| Ligne 41: | Ligne 33: | ||
| error_file "/var/log/mpd/errors.log" | error_file "/var/log/mpd/errors.log" | ||
| pid_file "/var/run/mpd/pid" | pid_file "/var/run/mpd/pid" | ||
| - | ################################################################ | ||
| - | |||
| - | |||
| - | ######################## DAEMON OPTIONS ######################## | ||
| - | # | ||
| - | # If started as root, MPD will drop root privileges and run as | ||
| - | # this user instead. Otherwise, MPD will run as the user it was | ||
| - | # started by. If left unspecified, MPD will not drop root | ||
| - | # privileges at all (not recommended). | ||
| - | # | ||
| - | user "mpd" | ||
| - | # | ||
| - | # The address and port to listen on. | ||
| - | # | ||
| - | #bind_to_address "127.0.0.1" | ||
| - | #port "6600" | ||
| - | # | ||
| - | # Controls the amount of information that is logged. Can be | ||
| - | # "default", "secure", or "verbose". | ||
| - | # | ||
| - | #log_level "default" | ||
| - | # | ||
| ################################################################ | ################################################################ | ||
| Ligne 72: | Ligne 42: | ||
| # log in with that password are allowed to do. | # log in with that password are allowed to do. | ||
| # | # | ||
| - | password "VOTRE_MOT_DE_PASSE@read,add,control,admin" #<----- REMPLASSER 'VOTRE_MOT_DE_PASSE' | + | password "VOTRE_MOT_DE_PASSE@read,add,control,admin" #<----- REMPLACER 'VOTRE_MOT_DE_PASSE' |
| # | # | ||
| # Specifies what permissions a user who has not logged in with a | # Specifies what permissions a user who has not logged in with a | ||
| Ligne 92: | Ligne 62: | ||
| mount "/mydoom666" #<----- NOM DE LA PLAYLIST SANS L'EXTENSION | mount "/mydoom666" #<----- NOM DE LA PLAYLIST SANS L'EXTENSION | ||
| - | password "VOTRE_MOT_DE_PASSE" #<----- REMPLASSER 'VOTRE_MOT_DE_PASSE' | + | password "VOTRE_MOT_DE_PASSE" #<----- REMPLACER 'VOTRE_MOT_DE_PASSE' |
| quality "5.0" | quality "5.0" | ||
| # bitrate "128" | # bitrate "128" | ||
| Ligne 116: | Ligne 86: | ||
| # restricting your usage of MPD. | # restricting your usage of MPD. | ||
| # | # | ||
| - | connection_timeout "60" | + | connection_timeout "60" |
| max_connections "5" #<----- NOMBRE DE CONNECTION MAXIMUM | max_connections "5" #<----- NOMBRE DE CONNECTION MAXIMUM | ||
| max_playlist_length "16384" | max_playlist_length "16384" | ||
| Ligne 129: | Ligne 99: | ||
| [[:tutoriel:comment_editer_un_fichier|Éditez le fichier]] **/etc/icecast2/icecast.xml**, fichier de configuration de Icecast2. | [[:tutoriel:comment_editer_un_fichier|Éditez le fichier]] **/etc/icecast2/icecast.xml**, fichier de configuration de Icecast2. | ||
| + | Il y a peu de choses à modifier, mis à part les mots de passe. | ||
| - | Il y a pas grand chose à modifier, à part les mots de passe. ;-) | + | <file XML> |
| - | + | ||
| - | Exemple de fichier (à adapter à votre configuration) : | + | |
| - | + | ||
| - | > FIXME Préciser ce qu’il y a à modifier sans montrer l'intégralité du fichier. --- [[utilisateurs:Ner0lph]], le 13/04/2008, à 23:55 | + | |
| - | + | ||
| - | <code XML> | + | |
| - | <icecast> | + | |
| <limits> | <limits> | ||
| <clients>5</clients> | <clients>5</clients> | ||
| Ligne 146: | Ligne 110: | ||
| <header-timeout>15</header-timeout> | <header-timeout>15</header-timeout> | ||
| <source-timeout>10</source-timeout> | <source-timeout>10</source-timeout> | ||
| - | <!-- If enabled, this will provide a burst of data when a client | ||
| - | first connects, thereby significantly reducing the startup | ||
| - | time for listeners that do substantial buffering. However, | ||
| - | it also significantly increases latency between the source | ||
| - | client and listening client. For low-latency setups, you | ||
| - | might want to disable this. --> | ||
| <burst-on-connect>1</burst-on-connect> | <burst-on-connect>1</burst-on-connect> | ||
| - | <!-- same as burst-on-connect, but this allows for being more | ||
| - | specific on how much to burst. Most people won't need to | ||
| - | change from the default 64k. Applies to all mountpoints --> | ||
| <burst-size>65535</burst-size> | <burst-size>65535</burst-size> | ||
| </limits> | </limits> | ||
| Ligne 161: | Ligne 116: | ||
| <authentication> | <authentication> | ||
| <!-- Sources log in with username 'source' --> | <!-- Sources log in with username 'source' --> | ||
| - | <source-password>argounay</source-password> | + | <source-password>VOTRE_MOT_DE_PASSE</source-password> |
| <!-- Relays log in username 'relay' --> | <!-- Relays log in username 'relay' --> | ||
| - | <relay-password>argounay</relay-password> | + | <relay-password>VOTRE_MOT_DE_PASSE</relay-password> |
| <!-- Admin logs in with the username given below --> | <!-- Admin logs in with the username given below --> | ||
| <admin-user>admin</admin-user> | <admin-user>admin</admin-user> | ||
| - | <admin-password>argounay</admin-password> | + | <admin-password>VOTRE_MOT_DE_PASSE</admin-password> |
| </authentication> | </authentication> | ||
| - | <!-- Uncomment this if you want directory listings --> | ||
| - | <!-- | ||
| - | <directory> | ||
| - | <yp-url-timeout>15</yp-url-timeout> | ||
| - | <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url> | ||
| - | </directory> | ||
| - | --> | ||
| - | |||
| - | <!-- This is the hostname other people will use to connect to your server. | ||
| - | It affects mainly the urls generated by Icecast for playlists and yp | ||
| - | listings. --> | ||
| <hostname>127.0.0.1</hostname> | <hostname>127.0.0.1</hostname> | ||
| - | + | </file> | |
| - | <!-- You can use these two if you only want a single listener --> | + | |
| - | <!--<port>8000</port> --> | + | |
| - | <!--<bind-address>127.0.0.1</bind-address>--> | + | |
| - | + | ||
| - | <!-- You may have multiple <listener> elements --> | + | |
| - | <listen-socket> | + | |
| - | <port>8000</port> | + | |
| - | <!-- <bind-address>127.0.0.1</bind-address> --> | + | |
| - | </listen-socket> | + | |
| - | <!-- | + | |
| - | <listen-socket> | + | |
| - | <port>8001</port> | + | |
| - | </listen-socket> | + | |
| - | --> | + | |
| - | + | ||
| - | <!--<master-server>127.0.0.1</master-server>--> | + | |
| - | <!--<master-server-port>8001</master-server-port>--> | + | |
| - | <!--<master-update-interval>120</master-update-interval>--> | + | |
| - | <!--<master-password>hackme</master-password>--> | + | |
| - | + | ||
| - | <!-- setting this makes all relays on-demand unless overridden, this is | + | |
| - | useful for master relays which do not have <relay> definitions here. | + | |
| - | The default is 0 --> | + | |
| - | <!--<relays-on-demand>1</relays-on-demand>--> | + | |
| - | + | ||
| - | <!-- | + | |
| - | <relay> | + | |
| - | <server>127.0.0.1</server> | + | |
| - | <port>8001</port> | + | |
| - | <mount>/example.ogg</mount> | + | |
| - | <local-mount>/different.ogg</local-mount> | + | |
| - | <on-demand>0</on-demand> | + | |
| - | + | ||
| - | <relay-shoutcast-metadata>0</relay-shoutcast-metadata> | + | |
| - | </relay> | + | |
| - | --> | + | |
| - | + | ||
| - | <!-- Only define a <mount> section if you want to use advanced options, | + | |
| - | like alternative usernames or passwords | + | |
| - | <mount> | + | |
| - | <mount-name>/example-complex.ogg</mount-name> | + | |
| - | + | ||
| - | <username>othersource</username> | + | |
| - | <password>hackmemore</password> | + | |
| - | + | ||
| - | <max-listeners>1</max-listeners> | + | |
| - | <dump-file>/tmp/dump-example1.ogg</dump-file> | + | |
| - | <burst-size>65536</burst-size> | + | |
| - | <fallback-mount>/example2.ogg</fallback-mount> | + | |
| - | <fallback-override>1</fallback-override> | + | |
| - | <fallback-when-full>1</fallback-when-full> | + | |
| - | <intro>/example_intro.ogg</intro> | + | |
| - | <hidden>1</hidden> | + | |
| - | <no-yp>1</no-yp> | + | |
| - | <authentication type="htpasswd"> | + | |
| - | <option name="filename" value="myauth"/> | + | |
| - | <option name="allow_duplicate_users" value="0"/> | + | |
| - | </authentication> | + | |
| - | <on-connect>/home/icecast/bin/stream-start</on-connect> | + | |
| - | <on-disconnect>/home/icecast/bin/stream-stop</on-disconnect> | + | |
| - | </mount> | + | |
| - | + | ||
| - | <mount> | + | |
| - | <mount-name>/auth_example.ogg</mount-name> | + | |
| - | <authentication type="url"> | + | |
| - | <option name="mount_add" value="http://myauthserver.net/notify_mount.php"/> | + | |
| - | <option name="mount_remove" value="http://myauthserver.net/notify_mount.php"/> | + | |
| - | <option name="listener_add" value="http://myauthserver.net/notify_listener.php"/> | + | |
| - | <option name="listener_remove" value="http://myauthserver.net/notify_listener.php"/> | + | |
| - | </authentication> | + | |
| - | </mount> | + | |
| - | + | ||
| - | --> | + | |
| - | + | ||
| - | <fileserve>1</fileserve> | + | |
| - | + | ||
| - | <!-- set the mountpoint for a shoutcast source to use, the default if not | + | |
| - | specified is /stream but you can change it here if an alternative is | + | |
| - | wanted or an extension is required | + | |
| - | <shoutcast-mount>/live.nsv</shoutcast-mount> | + | |
| - | --> | + | |
| - | + | ||
| - | <paths> | + | |
| - | <!-- basedir is only used if chroot is enabled --> | + | |
| - | <basedir>/usr/share/icecast2</basedir> | + | |
| - | + | ||
| - | <!-- Note that if <chroot> is turned on below, these paths must both | + | |
| - | be relative to the new root, not the original root --> | + | |
| - | <logdir>/var/log/icecast2</logdir> | + | |
| - | <webroot>/usr/share/icecast2/web</webroot> | + | |
| - | <adminroot>/usr/share/icecast2/admin</adminroot> | + | |
| - | <!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> --> | + | |
| - | + | ||
| - | <!-- Aliases: treat requests for 'source' path as being for 'dest' path | + | |
| - | May be made specific to a port or bound address using the "port" | + | |
| - | and "bind-address" attributes. | + | |
| - | --> | + | |
| - | <!-- | + | |
| - | <alias source="/foo" dest="/bar"/> | + | |
| - | --> | + | |
| - | <!-- Aliases: can also be used for simple redirections as well, | + | |
| - | this example will redirect all requests for http://server:port/ to | + | |
| - | the status page | + | |
| - | --> | + | |
| - | <alias source="/" dest="/status.xsl"/> | + | |
| - | </paths> | + | |
| - | + | ||
| - | <logging> | + | |
| - | <accesslog>access.log</accesslog> | + | |
| - | <errorlog>error.log</errorlog> | + | |
| - | <!-- <playlistlog>playlist.log</playlistlog> --> | + | |
| - | <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --> | + | |
| - | <logsize>10000</logsize> <!-- Max size of a logfile --> | + | |
| - | <!-- If logarchive is enabled (1), then when logsize is reached | + | |
| - | the logfile will be moved to [error|access|playlist].log.DATESTAMP, | + | |
| - | otherwise it will be moved to [error|access|playlist].log.old. | + | |
| - | Default is non-archive mode (i.e. overwrite) | + | |
| - | --> | + | |
| - | <!-- <logarchive>1</logarchive> --> | + | |
| - | </logging> | + | |
| - | + | ||
| - | <security> | + | |
| - | <chroot>0</chroot> | + | |
| - | <!-- | + | |
| - | <changeowner> | + | |
| - | <user>nobody</user> | + | |
| - | <group>nogroup</group> | + | |
| - | </changeowner> | + | |
| - | --> | + | |
| - | </security> | + | |
| - | </icecast> | + | |
| - | </code> | + | |
| Pour faire tourner Icecast2 en tache de fond, [[:tutoriel:comment_editer_un_fichier|éditez le fichier]] **/etc/default/icecast2** et modifiez à la fin du fichier pour obtenir : | Pour faire tourner Icecast2 en tache de fond, [[:tutoriel:comment_editer_un_fichier|éditez le fichier]] **/etc/default/icecast2** et modifiez à la fin du fichier pour obtenir : | ||
| <file>ENABLE=true</file> | <file>ENABLE=true</file> | ||
| - | |||
| - | Terminé ! :-D | ||
| Relancer les services mpd et icecast2 : | Relancer les services mpd et icecast2 : | ||
| Ligne 326: | Ligne 136: | ||
| sudo /etc/init.d/mpd restart | sudo /etc/init.d/mpd restart | ||
| sudo /etc/init.d/icecast2 restart | sudo /etc/init.d/icecast2 restart | ||
| - | |||
| - | Puis créer la base de donnée de MPD : | ||
| - | |||
| - | sudo mpd –create-db | ||
| <note> | <note> | ||
| Ligne 336: | Ligne 142: | ||
| La playlist se trouve à l’adresse : http://adresse.com:8000/nom_de_la_playlist.m3u. | La playlist se trouve à l’adresse : http://adresse.com:8000/nom_de_la_playlist.m3u. | ||
| - | Vous avez choisi le nom de cette playlist lors de la configuration du fichier « mpd.conf ». (Que vous pouvez modifier a tout moment, il faudra juste penser a relancer les services pour que les modifications soient prises en compte.</note> | + | Vous avez choisi le nom de cette playlist lors de la configuration du fichier « mpd.conf ». (Que vous pouvez modifier a tout moment, il faudra juste penser a relancer les services pour que les modifications soient prises en compte. |
| + | |||
| + | Bien entendu, il vous faut ensuite installer et démarrer un client MPD avant que icecast2 ne puisse jouer quoi que ce soit</note> | ||
| ===== Client de MPD ===== | ===== Client de MPD ===== | ||
| - | ==== GMPC ==== | + | ==== PhpMp2 ==== |
| - | **GMPC** est un client qui permet l’utilisation de MPD avec une [[http://i49.servimg.com/u/f49/11/19/52/01/09040810.jpg|interface graphique]]. | + | PhpMp2 est un client qui tourne sur un serveur web (avec php). |
| - | + | Ainsi si vous avez un serveur web vous pouvez l'installer et contrôler MPD de n'importe quelle machine connectée sur le net ayant un navigateur. | |
| - | {{ mydoom666_gmpc2.png }} | + | |
| - | + | ||
| - | <note tip> | + | |
| - | * Plus de captures : http://sarine.nl/gmpc-screenshots | + | |
| - | * Plus d’informations sur GMPC : http://www.musicpd.org/gmpc.shtml | + | |
| - | * Plus de clients pour MPD : http://www.musicpd.org/clients.shtml | + | |
| - | </note> | + | |
| - | + | ||
| - | [[:tutoriel:comment_installer_un_paquet|Installez le paquet]] **gmpc** pour installer GMPC. | + | |
| + | Vous pouvez le télécharger à https://www.musicpd.org/phpMp2.shtml | ||
| + | Il faut décompresser l'archive dans un répertoire accessible sur votre serveur web. | ||
| + | {{tutoriel:phpmp2-mpd.jpg|}} | ||
| ===== Ouvrir le port dans le pare-feu ===== | ===== Ouvrir le port dans le pare-feu ===== | ||
| - | Dernière étape, ouvrir le port 8000 dans le pare-feu. Le port 8000 (par défaut) est celui utilisé par Icecast2 pour envoyer les flux aux clients. Pour cela, utilisez [[:Firestarter]]. | + | Dernière étape, ouvrir le port 8000 dans le [[:pare-feu]]. Le port 8000 (par défaut) est celui utilisé par Icecast2 pour envoyer les flux aux clients. Pour cela, utilisez [[:Gufw]].\\ |
| - | <note help>[[:firestarter#onglet_politique|Comment ajouter une règle à Iptables avec Firestarter]]</note> | + | |
| Il est possible d’administrer votre serveur a distance en ouvrant le port 6600 (par défaut). Il suffira ensuite dans GMPC de bien spécifier l’adresse distante du serveur. | Il est possible d’administrer votre serveur a distance en ouvrant le port 6600 (par défaut). Il suffira ensuite dans GMPC de bien spécifier l’adresse distante du serveur. | ||
| - | <note important>Attention, **ces ports doivent être ouverts** dans votre routeur et redirigés vers l’adresse IP de la machine serveur.</note> | + | <note important>**ces ports doivent être ouverts** dans votre routeur et redirigés vers l’adresse IP de la machine serveur.</note> |
| - | ===== Informations supplémentaires ===== | + | ===== Ressources Supplémentaires ===== |
| - | * http://www.icecast.org/ | + | ==== Sites officiels ==== |
| - | * http://www.musicpd.org/ | + | * https://www.icecast.org/ |
| + | * https://www.musicpd.org/ | ||
| * [[wpfr>Net_radio]] | * [[wpfr>Net_radio]] | ||
| - | ===== Source ===== | + | ==== Pour aller plus loin ==== |
| - | * http://www.mydoom666.com/2008/04/creer-sa-webradio-sous-ubuntu | + | * http://benjamin.sansinteret.info/blog/post/2008/11/28/Tutorial-Creer-une-webradio-avec-MPD-et-Icecast-sous-Linux-Gentoo-ou-Debian |
| + | * [[http://www.generation-linux.fr/index.php?post/2009/01/17/Mise-en-place-d-une-webradio-avec-Icecast-et-Liquidsoap| Mise en place d'une webradio avec Icecast et Liquidsoap ]] | ||
| ---- | ---- | ||
| //Contributeurs : [[utilisateurs:Mydoom666]], [[utilisateurs:Ner0lph]].// | //Contributeurs : [[utilisateurs:Mydoom666]], [[utilisateurs:Ner0lph]].// | ||