Installing the Icecast streaming media server
12 February 2005
This page describes the installation exactly. Rather than describing what you're doing, I'll show you what to do. You'll do the work of acquiring and installing software from within the Terminal application, using a web browser only for the testing steps.
I assure you that the UNIX commands I'll direct you to invoke have been taken directly from a Terminal window - these are the commands I just used to do a clean install - rather than having been composed after the fact. This is *exactly* what worked for me. I've taken pains to choose forms of the commands which should make sense to you even if you're new to UNIX.
Get and install fink and the prerequisites for Icecast
Icecast depends upon several external libraries, at least two of which - libxslt and libxml2 - would compile under Mac OS X in their latest versions.
So I've opted to use the fink versions, which I've heard do compile. The fink binary installer and install instructions may be found at
http://fink.sourceforge.net/download/index.php
In order to have canonical packages find libraries installed by Fink one has to issue the following commmnads (which I've placed into my ~/.tcshrc file:
setenv CFLAGS -I/sw/include
setenv LDFLAGS -L/sw/lib
setenv CXXFLAGS $CFLAGS
setenv CPPFLAGS $CXXFLAGS
setenv ACLOCAL_FLAGS "-I /sw/share/aclocal"
setenv PKG_CONFIG_PATH "/sw/lib/pkgconfig"
|
If a package does not use these variables, you may need to add the -I/sw/include (for headers) and -L/sw/lib (for libraries) to the compile lines yourself. Some packages may use similar non-standard variables such as EXTRA_CFLAGS or --with-qt-dir= configure options. ./configure --help will usually give you a list of the extra configure options.
Once installed, I start up a Terminal window and use fink to install the dependencies:
% sudo apt-get install libxslt
% sudo apt-get install libxml2
% sudo apt-get install curl
|
Then it's time to get the Ogg Vorbis libraries:
% curl -O -# http://downloads.xiph.org/releases/ogg/libogg-1.1.2.tar.gz
######################################################################## 100.0% % gnutar zxf libogg-1.1.2.tar.gz
% cd libogg-1.1.2
% ./configure
% make
% sudo make install
% cd ..
% curl -O -# http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.0.tar.gz
######################################################################## 100.0%
% gnutar zxf libvorbis-1.1.0.tar.gz
% cd libvorbis-1.1.0
% ./configure
% make
% sudo make install
% cd ..
|
NOTE: in libvorbis-1.1.0 I uncovered several typos which prevent a Mac OS X deployment. MikeS, on the #icecast IRC channel, checked in the required fixes. Until the fixes get rolled into the releases, you'll get errors in envelope.c. Edit ./lib/envelope.c and remove white space from the beginning of lines 281, 364, and 370.
Get Icecast (and a required fix to 2.2.0)
Fink has an Icecast, but it's a scandalously obsolete version, so we need to get the current version.
% curl -O -# http://downloads.xiph.org/releases/icecast/icecast-2.2.0.tar.gz
% gnutar zxf icecast-2.2.0.tar.gz
% cd icecast-2.2.0
% cd src
% curl -O -# http://svn.xiph.org/icecast/trunk/icecast/src/fserve.c
% cd ..
% ./configure
% make
% sudo make install
|
The documentation is rooted at file:///usr/local/share/doc/icecast/index.html and a sample configuration file is placed at file:///usr/local/etc/icecast.xml
Icecast needs to run as root, but one can minimize the security issues by modifying the icecast.xml like this:
<paths>
<basedir>/usr/local/share/icecast</basedir>
<logdir>/log</logdir>
<webroot>/web</webroot>
<adminroot>/admin</adminroot>
</paths>
<security>
<chroot>1</chroot>
<changeowner>
<user>icecast</user>
<group>staff</group>
</changeowner>
</security>
|
Next, you'll have to create a new user from the command-line, create your workspaces,
|
% sudo mkdir -p /usr/local/share/icecast/{.,log,web,admin}
% sudo chown icecast /usr/local/share/icecast/{.,log,web,admin}
% sudo chgrp staff /usr/local/share/icecast/{.,log,web,admin}
|
and finally start icecast
|
% sudo icecast -c /usr/local/etc/icecast.xml
|
How to have icecast start up automatically will be tackled at a later time.
Be mindful of the permissions of the files you're trying to share.
Adding the Metastream front-end
Metastream provided for us. Public URL to be added someday.
% sudo mkdir -p ${CATALINA_HOME}/metastream/
% sudo cp -r WebRoot/* ${CATALINA_HOME}/metastream/
|
Edit ${CATALINA_HOME}/metastream/WEB-INF/web.xml
<param-name>mp3Host</param-name>
<param-value>http://rosenkrantz.geektimes.com:8000</param-value>
<param-name>mp4Host</param-name>
<param-value>rtsp://rosenkrantz.geektimes.com:554</param-value>
|
Clean up after yourself
When all done we may remove the install directory.
% cd ~
% rm -rf ~/install
|
You might want to - okay, you really ought to - jump up one level, to see how this fits into the big picture of developing and deploying web-based applications (and to see what other tools I've installed to work with this).