Créez votre web radio sous Debian/Linux avec Shoutcast
dimanche, 17 septembre 2006
SHOUTcast est un logiciel de diffusion pour webradios de la société Nullsoft.
Il vous permet donc de diffuser de la musique ou autre fichier sonore sur internet, depuis divers clients tel que RealPlayer
Nous allons voir ici comment l’installer sous Debian/Linux sur un serveur dédié.
- Par Flying Jack, Webmaster du site nipournicontre.com
wget http://www.shoutcast.com/downloads/sc1-9-7/shoutcast-1-9-7-linux-glibc6.tar.gz
gunzip shoutcast-1-9-7-linux-glibc6.tar.gz
tar xf shoutcast-1-9-7-linux-glibc6.tar
rm shoutcast-1-9-7-linux-glibc6.tar
Editer le fichier vi sc_serv.conf et reperer la ligne Password= et remplacer changeme par votre mot de passe.
Faites de meme pour MaxUser=
En admettant que nous avons 100 Mbps sur une dedibox, et que vous encodez de chez vous a 128 kbps, combien d’utilisateur théoriques maximums pouvez vous avoir ?
Réponse:
– 100 x 1024 = 102400 kbps
– 102400/128 = 800 utilisateurs.
Perso, j’ai mis 500 users max.
Sauvegardez, fermez.
Lancer le sc_serv pour vérifier que tout fonctionne.
Rendez-vous dans le repertoire et executez:
./sc_serv
Vous verrez la console de log de ShoutCast apparaitre.
Connectez vous maintenant sur le port 8000 de votre serveur:
http://ip_de_votre_dedibox:8000
Vous devriez tomber sur la page d’acceuil de votre shoutcast.
Lancer le serveur Shoutcast au demarrage du serveur
cp sc_serv /usr/local/bin/
chmod 755 /usr/local/bin/sc_serv
chown root:root /usr/local/bin/sc_serv
cp sc_serv.conf /etc
chmod 644 /etc/sc_serv.conf
chown root:root /etc/sc_serv.conf
Créez le shell suivant: /etc/init.d/shoutcast
#!/bin/bash
NAME= »Mon ShoutCast »
SRV_BIN=/usr/local/bin/sc_serv
SRV_CFG=/etc/sc_serv.conf# On va faire tourner shoutcast en tant que nobody:nogroup
# On peut bien sur creer un autre user (sans shell,…) si on veut, bien sur
SRV_UID=nobody
SRV_GID=nogroupSSD_BIN=/sbin/start-stop-daemon
SSD_GENERAL_OPTS= »–quiet »case « $1 » in
start)
echo « Starting $NAME »;
$SSD_BIN $SSD_GENERAL_OPTS –chuid ${SRV_UID}:${SRV_GID} –user $SRV_UID \
–group $SRV_GID –start –background –exec $SRV_BIN $SRV_CFG
;;
stop)
echo « Stopping $NAME »;
$SSD_BIN $SSD_GENERAL_OPTS –chuid ${SRV_UID}:${SRV_GID} –user $SRV_UID \
–group $SRV_GID –stop –exec $SRV_BIN $SRV_CFG
;;
restart|force-reload)
echo « Restart »;
;;
*)
echo « Usage: {start|stop|restart|force-reload} » >&2
exit 1
;;
esac
On applique les droits:
chown root:root /etc/init.d/shoutcast
chmod 755 /etc/init.d/shoutcast
On teste si tout marche bien en lancant shoutcast:
/etc/init.d/shoutcast start
On vérifie si il tourne:
ps aux | grep sc_serv
On doit voir ceci:
nobody 1991 0.0 0.4 46680 4324 ? Ss Jul20 0:00 /usr/local/bin/sc_serv /etc/sc_serv.conf
On arrete shoutcast:
/etc/init.d/shoutcast stop
On vérifie qu’il ne tourne plus:
ps aux | grep sc_serv
On ne doit rien obtenir.
On active shoutcast au démarrage:
update-rc.d shoutcast defaults 90
Voila, votre web radio devrait être opérationnelle, vous pouvez diffuser vos musiques préférées.
Mais avant toute chose, pensez à faire un tour sur la SACEM!
http://www.sacem.fr/portailSacem/jsp/ep â?¦ ypeId=8585
Publié par Webmaster | 3 commentaires
Avant: Installation de Webmin
Apres: Verifiez la securite de votre serveur: installer rkhunter
le jeudi 12 Oct 2006 a 17:17
Le commentaire pour cet articles a été supprimé par erreur.
Toutes mes excuses.
le lundi 21 Déc 2009 a 12:10
pour le script bash /etc/init.d/shoutcast c’est sa car ton script ne marche pas.
___________________________
#!/bin/bash
NAME= »Mon ShoutCast »
SRV_BIN=/usr/local/bin/sc_serv
SRV_CFG=/etc/sc_serv.conf
# On va faire tourner shoutcast en tant que nobody:nogroup
# On peut bien sur creer un autre user (sans shell,…) si on veut, bien sur
SRV_UID=nobody
SRV_GID=nogroup
SSD_BIN=/sbin/start-stop-daemon
SSD_GENERAL_OPTS= »–quiet »
case « $1 » in
start)
echo « Starting $NAME »;
$SSD_BIN $SSD_GENERAL_OPTS –chuid ${SRV_UID}:${SRV_GID} –user $SRV_UID \
–group $SRV_GID –start –background –exec $SRV_BIN $SRV_CFG
;;
stop)
echo « Stopping $NAME »;
$SSD_BIN $SSD_GENERAL_OPTS –chuid ${SRV_UID}:${SRV_GID} –user $SRV_UID \
–group $SRV_GID –stop –exec $SRV_BIN $SRV_CFG
;;
restart|force-reload)
echo « Restart »;
;;
*)
echo « Usage: {start|stop|restart|force-reload} » >&2
exit 1
;;
esac
le jeudi 24 Mai 2012 a 1:09
Bonjour voici les petits problemes que j ai
> /etc/init.d/shoutcast
/etc/init.d/shoutcast: line 2:
: command not found
/etc/init.d/shoutcast: line 3: ShoutCast�
: command not found
/etc/init.d/shoutcast: line 4:
: command not found
/etc/init.d/shoutcast: line 7:
: command not found
/etc/init.d/shoutcast: line 12:
: command not found
/etc/init.d/shoutcast: line 15:
: command not found
/etc/init.d/shoutcast: line 16: syntax error near unexpected token `in
‘
/etc/init.d/shoutcast: line 16: ` case “$1? in