Installing the Server

From smultron.org

Jump to: navigation, search

There are several open source and proprietary streaming servers, but we chose to use Icecast from Xiph.org. When I got involved with Radio1:1, we knew we would have to write our own software to realize the concept, and Xiph.org offers a framework for broadcasting, which includes codecs, software and file formats, all open source. We chose the proprietary mp3 format on the client side (mp3 is copyright by the Frauenhofer Institute), but our systems is based on Xiph.org streaming technology, except for darkice, the live encoder.

Contents

Compiling dependencies

Check that libxml and libxml2 are installed. Chances are they already are, since they are a standard part of the Gnome desktop.

> ls /usr/lib | grep xml

should give you something like:

libxml2.so.x

and

> ls /usr/lib | grep xslt

something like:

libxslt.so.1

If they are not installed, check for packages for your distribution. Using Ubuntu, you will have to install libxml2dev and libxslt1dev packages as well.

Download libogg and libvorbis from xiph.org.

> tar -xf libogg1.x.x.tar.gz
> cd libogg1.x.x
> ./configure
> make
> sudo make install

Repeat the above for libvorbis.

Alternatively, you can install the liboggdev and libvorbisdev packages, but this can cause dependency problems, since the development packages are not necessarily uptodate.

Install the python packages for your distribution. Installing on Ubuntu, you will also need the python2.xdev package.

Compiling Icecast

Download the icecast2 source archive from xiph.org and decompress it. Alternatively, you can install an rpm or Ubuntu package.

> tar xf icecast2.x.x.tar.gz
> cd icecast2.x.x
> ./configure withpython withlame

if the configure script complains about missing dependencies, do

> ./configure help

and try tweeking the options.

> make

(make will probably print a lot of warnings, ignore them)

> sudo make install

Finally, you will have to create the log directory.

> sudo mkdir /usr/local/var
> sudo mkdir /usr/local/var/log
> sudo mkdir /usr/local/var/log/icecast

Now, change the group ownership to group radio, and give writting permissions to it.

> sudo chown root:radio /usr/local/var/log/icecast
> sudo chmod 775 /usr/local/var/log/icecast

Try it out

Start the server As normal user (icecast will not let you run the server as root):

> icecast -c /usr/local/etc/icecast.xml &

'&' means the server will be started in the background. If everything worked well, you now have a streaming server. To check it, open a browser and go to http://localhost:8000/admin/stats Login with username: 'admin' and passsword: 'hackme'

Later, we will change the password and other settings. You should now see an XML file with some statistics. To stop the server, just kill it. Do

> ps C

icecast (or icecast2 on some systems) this will give you the process Id ### of the server.

> kill ###

Before you can start to hear something, you will need to install some a streaming source, which is what we will do next.

Troubleshooting

If you are having trouble compiling on Ubuntu or another packagebased distribution, check that the dev packages for the libraries are installed. For example the dev package corresponding to libxml2 is libxml2dev etc. You will need at least libxml2dev, libxsltdev and python2.xdev.

If the server is not responding, check if the loopback interface is up:

> sudo ifconfig

Should contain an entry reading something like:

lo protocol: internal loopback
inet Adress: 127.0.0.1 mask: 255.0.0.0
...

If it doesn't, do

> sudo ifconfig lo up

Where lo stands for loopback If the server is giving you:

FATAL: could not start logging

check that you are in the radio group,

> groups

and that the directory /usr/local/var/log/icecast exists and has the right ownership and permission, as shown under 2.1 above.

> stat /usr/local/var/log/icecast

Should show:

Access: (755/drwxrwxrx)
Uid: (0/root) Gid: (###/radio)
Personal tools