I need to install streaming audio server with Icecast (OGG/MP3) for one of my great client in service of http://html5.svnlabs.com/. Icecast was designed to stream any audio file using ices and icegenerator for MP3 and OGG/Vorbis audio files.
I already did lot of work using Shoutcast, SAMCast and SAM Broadcaster, Its very easy to use audio casting server online.
Today we will try to install Icecast 2.3.3 on CentOS x86_64 Server…
Setup Icecast Server
Download source and rpm needed
# yum groupinstall “Development Tools”
# yum install -y curl-devel libtheora-devel libvorbis-devel libxslt-devel speex-devel libxslt
# rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# cd /home
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# mkdir -p /usr/src/icecast
# cd /usr/src/icecast
# wget http://downloads.xiph.org/releases/icecast/icecast-2.3.3.tar.gz
Unzip Icecast source
# tar xf icecast-2.3.3.tar.gz
# cd icecast-2.3.3
Configure, Compile and Install
# ./configure –prefix=/opt/icecast/2.3.3
# make
# make install
You might find icecast binary .. please confirm 😉
# ls /opt/icecast/2.3.3/bin/
Configure icecast with icecast.xml
# cd /opt/icecast/2.3.3/etc
# vi icecast.xml
Find more help here to setup xml file http://icecast.org/docs/icecast-2.3.1/icecast2_config_file.html
Create icecast user & group
# groupadd -g 200 icecast
# useradd -d /var/log/icecast -m -g icecast -s /bin/bash -u 200 icecast
Before start icecast server check permission and make log folder
# mkdir -p /var/run/icecast
# chown -R icecast:icecast /var/run/icecast
Start the icecast server
# /opt/icecast/2.3.3/bin/icecast -c /opt/icecast/2.3.3/etc/icecast.xml -b  (background)
You will find Icecast server running here
http://Server-IP:8000/
Icegenerator – MP3 streaming client
Compile libshout and lib3lib (ID3 support), run ldconfig
# cd /usr/src/icecast
# wget http://downloads.us.xiph.org/releases/libshout/libshout-2.3.1.tar.gz
# tar xf libshout-2.3.1.tar.gz
# cd libshout-2.3.1
# ./configure –prefix=/opt/icecast/2.3.3
# make
# make install
Install icegenerator
# cd /usr/src/icecast
# wget http://netcologne.dl.sourceforge.net/project/icegenerator/icegenerator/0.5.5-pre2/icegenerator-0.5.5-pre2.tar.gz
# tar xfz icegenerator-0.5.5-pre2.tar.gz
# cd icegenerator-0.5.5-pre2
# ./configure
# make
# make install
Now configure icegenerator to create MP3 radio station
# vi /usr/local/etc/svnlabs
IP=127.0.0.1
PORT=8000
SERVER=2
MOUNT=/svnlabs
PASSWORD=password***
FORMAT=1
MP3PATH=m3u:/var/www/html/svnlabs.m3u
LOOP=1
SHUFFLE=1
NAME=SVNLabs MixStreams
DESCRIPTION=SVN Labs Softwares
GENRE=svnlabs
URL=http://Server-IP:8000/
LOG=2
LOGPATH=/var/log/icecast/icegen.log
BITRATE=48000
SOURCE=source
You can even use MP3 folder path
MP3PATH=pth://var/www/html/songs
Create playlist file
# vi /usr/local/etc/svnlabs.m3u
/var/www/html/songs/svnlabs1.mp3
/var/www/html/songs/svnlabs2.mp3
Or try ….
# find /var/www/html/songs/ -name “*.mp3” > /var/www/html/svnlabs.m3u
Make sure you have setup all paths
# su – icecast -c “export LD_LIBRARY_PATH=/opt/icecast/2.3.3/lib:$LD_LIBRARY_PATH; /usr/local/bin/icegenerator -f /usr/local/etc/svnlabs”
Get more help from here for icegenerator variables http://www.becrux.com/index.php?page=projects&name=icegenerator
http://Server-IP:8000/svnlabs
Start other radio station using Running Icecast Server
# /usr/local/bin/icegenerator -f /usr/local/etc/indie