This document describes how to set up an Icecast2 server for broadcasting audio over the Internet.
File | Description | Required? |
---|---|---|
icecast-2.3.1 | Icecast is a streaming media server which currently supports Ogg Vorbis and MP3 audio streams. | Yes |
ices-0.4 | Source client for broadcasting in MP3 format to an icecast2 server. | Yes |
lame-3.96.1 | LAME is an LGPL MP3 encoder. | Optional |
Library | Description | Required? |
---|---|---|
libshout-2.2 | Library for communicating with and sending data to an icecast server. | Yes |
libogg | Manipulates ogg bitstreams. | Yes |
libvorbis | Supports the Vorbis General Audio Compression Codec. | Yes |
libxml2 | Used to parse the config files. | Yes |
libxslt | Used for building the web-frontend. | Yes |
curl-7.1x | Icecast may be compiled without curl, however this will disable all Directory server interaction. | Optional |
The Server opens one or several ports (8000 by default) for the broadcast, it runs a daemon (icecast2) which waits for audio content that will be provided by the client(s) (ices0) in mp3 or ogg format.
One server can broadcast several audio streams simultaneously; also it provides the audio stream information throught a web interface.
The client reads an ogg or mp3 file and sends it to the server.
Any user who wants to listen the audio will connect to the server through an audio program; such as, Windows Media Player®, Winamp, XMMS, Media Player, etc...
$ tar -zxvf libshout-2.2.tar.gz $ cd libshout-2.2 $ ./configure --prefix=/usr $ make $ su # make install # exit
$ tar -zxvf icecast-2.3.1.tar.gz $ cd icecast-2.3.1 $ ./configure $ make $ su # make install # exit
$ tar -zxvf lame-3.96.1.tar.gz $ cd lame-3.96.1 $ ./configure --prefix=/usr $ make $ su # make install # exit
$ tar -zxvf ices-0.4.tar.gz $ cd ices-0.4 $ ./configure --with-lame $ make $ su # make install # exit
$ su - # groupadd icecast2 # useradd icecast2 -g icecast2
# cd /usr/local/bin # chown icecast2.icecast2 icecast ices # mkdir /usr/local/share/icecast/log # chown -R icecast2.icecast2 /usr/local/share/icecast
# vim /usr/local/etc/icecast.xmland change the lines:
... <hostname>localhost</hostname> ... <logdir>/usr/local/var/log/icecast</logdir> <webroot>/usr/local/share/icecast/web</webroot> <adminroot>/usr/local/share/icecast/admin</adminroot> ... <chroot>0</chroot> <!-- <changeowner> <user>nobody</user> <group>nogroup</group> </changeowner> --> ...to:
... <hostname>your_hostname or ip</hostname> ... <logdir>/log</logdir> <webroot>/web</webroot> <adminroot>/admin</adminroot> ... <chroot>1</chroot> <changeowner> <user>icecast2</user> <group>icecast2</group> </changeowner> ...
# cp /usr/local/etc/ices.conf.dist /usr/local/etc/ices.conf # vim /usr/local/etc/ices.confand change the lines:
... <File>playlist.txt</File> ... <Background>0</Background> <Verbose>0</Verbose> ... <Hostname>localhost</Hostname> <Password>letmein</Password> ... <Bitrate>128</Bitrate> <Reencode>0</Reencode> ...to:
... <File>/tmp/playlist.txt</File> ... <Background>1</Background> <Verbose>1</Verbose> ... <Hostname>icecast2 server's hostname or ip</Hostname> <Password>icecast2 server's source password (hackme by default)</Password> ... <Bitrate>64</Bitrate> <Reencode>1</Reencode> ...
cd /path/to/music's/dir find `pwd` -name \*.mp3 > /tmp/playlist.txt
# icecast -c /usr/local/etc/icecast.xml &
# ices -c /usr/local/etc/ices.conf &
case "$1" in start) /usr/local/bin/icecast -c /usr/local/etc/icecast.xml > /dev/null & ;; stop) killall icecast ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac
case "$1" in start) /usr/local/bin/ices -c /usr/local/etc/ices.conf >/dev/null & ;; stop) killall --signal SIGINT ices ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac
# chmod 755 /etc/init.d/icecast2 # chmod 755 /etc/init.d/ices0 # cd /etc/init.d/rc3.d # ln -s ../icecast2 S80icecast2 # ln -s ../ices0 S81ices0 # cd /etc/init.d/rc5.d # ln -s ../icecast2 S80icecast2 # ln -s ../ices0 S81ices0 # cd /etc/init.d/rc0.d # ln -s ../ices0 S80ices0 # ln -s ../icecast2 S81icecast2 # cd /etc/init.d/rc6.d # ln -s ../ices0 S80ices0 # ln -s ../icecast2 S81icecast2