Downloading the Icecast Source

Download all needed source code to a working directory for compilation. The order and methodology here is the same as suggested when downloading files from off the Subversion repository, i.e. download the libshout source first, then ices, and finally icecast. If you prefer stable releases for your production servers and do not like being on the cutting edge, download the most recent stable code. It is always best to go through the icecast home page to ensure pristine copies of the code.

Here are links to the most recent icecast source files. These are the most minimal files required to set up streaming:

icecast2

http://downloads.xiph.org/releases/icecast/icecast-2.2.0.tar.gz

icecast2 release candidates

Tarball: http://downloads.xiph.org/releases/icecast/icecast-2.3.0.rc3.tar.gz

SRPM: http://downloads.xiph.org/releases/icecast/icecast-2.3.0.rc3-0.src.rpm

Windows Binary: http://downloads.xiph.org/releases/icecast/icecast2_win32_v2.3.0_rc3_setup.exe

ices2

http://downloads.xiph.org/releases/ices/ices-2.0.1.tar.gz

libshout2

http://downloads.xiph.org/releases/libshout/libshout-2.1.tar.gz

I suggest a command such as wget for quickly downloading the compressed source. Here is an example download:

# wget http://downloads.xiph.org/releases/libshout/libshout-2.1.tar.gz
--10:59:14-- http://downloads.xiph.org/releases/libshout/libshout-2.1.tar.gz
=> `libshout-2.1.tar.gz'
Connecting to 10.52.95.23:80... connected.
Proxy request sent, awaiting response... 200 OK
Length: 326,556 [application/x-gzip]
100%[====================================>] 326,556 172.23K/s
10:59:16 (171.82 KB/s) - `libshout-2.1.tar.gz' saved [326556/326556]

Notice how wget used my proxy connection to download the file. The same may not apply to your setup, but be aware that the correct parameters must be set for wget to work. Under Linux it is a simple matter to export proxy settings to most command line applications. Use the following commands to set up the export variables:

export http_proxy="http://10.52.95.23:80"
export ftp_proxy="http://10.52.95.23:80"

Note

These can just as easily be placed in any run command files such as /etc/rc.d/rc.local for Red Hat or /etc/rc.d/boot.local for SUSE. Fedora Core, RHEL AS4, SUSE Professional and SUSE Enterprise Linux Servers all have GUI utilities for managing proxy settings as well. Check the GUI configuration settings for adjusting configuring your server to accommodate your proxy requirements.

Other applications are available in the same directory mentioned here. Consult the icecast page for further information regarding these or if you are unsure what they might do. However, these programs are the most stable and are the only ones required for initially configuring the icecast server. The streamer programs are covered in the next chapter.

Compiling from Source

Begin by first compiling the source for libshout. These steps are fairly standard for compiling the other two packages as well. Follow each step within its respective directory. Begin with libshout and then compile ices2 and finally the icecast2 source.

$ cd libshout-2.1/
$ ./configure
$ make
# make install
# cd ../

Run the configure command with any other needed parameters. After compiling and installing libshout make certain the path /usr/local/lib is included in your /etc/ld.so.conf file, then run the ldconfig command as root.

Note

Some distributions, such as SUSE Linux, already include this directory by default in the /etc/ld.so.conf file. Others do not. Verify that your distribution includes this line before continuing.

Compile and install the source code for the remaining two programs, ices and icecast. Here are some example install routines:

$ cd ices-2.0.x/
$ ./configure
$ make
# make install
# cd ../

If at some later time you decide to install ices0, the MP3 streaming utility, rather than using ices2, which is intended primarily for streaming Ogg Vorbis files, you may want to rename or symbolically link the ices binary in /usr/local/bin to ices2. This way you do not overwrite the ices2 binary with the ices0 compilation.

Do the same compilation process with the icecast program and install from source:

$ cd icecast-2.3.x/
$ ./configure
$ make
# make install
# cd ../

This order does not need to be followed implicitly. icecast can be installed before the other two programs. Just be aware that libshout must be installed before ices.

Be sure that the packages curl and curl-devel are also installed prior to configuring icecast2 from source. Download and install curl from source if RPM or binaries are not available for your current distribution. curl appears to be a major sticking point for many novice icecast users.

Creating Directories

The next step in setting up icecast and related applications it to create a directory in which to store the icecast2 configuration and log files. The latest release of icecast-2.3.x creates an icecast/ directory in /usr/local/share. This is where icecast places its configuration or XSL and HTML files. Consider this the root directory for icecast management.

The same applies for ices source code; it, too, uses the /usr/local/share directory for its root files. The icecast and ices binaries are placed in the /usr/local/bin directory. The libshout libraries are found in /usr/local/lib.

Some administrators, however, prefer creating their own custom directory in which to store all configuration, log, admin, and web files. This is entirely optional. This simply demonstrates another method of accomplishing the same as provided by default.

You can just as easily store configuration files in the /etc directory. If you do use your own custom directories, specify the respective location in the appropriate icecast.xml and ices.xml files.

When customizing the icecast and ices directories, first create a user with the proper rights to run the icecast program. Some use an "icecast" user for icecast version 1.3.x. For icecast2 perhaps create an "iceuser" with ownership over the respective directories.

Along the same lines as icecast1, create a /usr/local/icecast2 directory if so desired. In addition, make a ~/icecast2/conf/, a ~/icecast2/logs/, a ~/icecast2/web/, and a ~/icecast2/admin/ directory.

# mkdir -p /usr/local/icecast2/{conf logs web admin}

Otherwise use the existing directories created by the install in /usr/local/share/icecast.

Create the new user and define its default location; that of the new icecast2/ directory.

# useradd -d /usr/local/icecast2 iceuser
# chown -R iceuser.iceuser /usr/local/icecast2/

After editing or touching any files or making any other changes as the root user, change ownerships of all files in the ~/icecast2 directory back to the user, iceuser.

Note

Certain Linux distribution may require different syntax or tools for setting up new users. The supplied guidelines are suggestions only. Consult your distribution for additional information.

By way of suggestion, you may want to configure the password settings for this new user to /bin/false to prevent any unauthorized use or access to the icecast files. This can either be done from within the /etc/passwd file, using a GUI configuration tool, such as YaST, or from the command line.

Default Icecast2 Directories

The latest version of icecast and ices store their directories in a new default location. Consult the directories and respective file found in /usr/local/share/icecast and /usr/local/share/ices for additional information about the latest icecast and ices. These directories also include sample configuration files. Customize these files to the specifications of your system.

If following the recommendations from the previous section and creating custom directories copy all files from the default icecast and ices directories and place them in the /usr/local/icecast2 directory. Copy all the files from /usr/local/share/icecast/admin and place them in /usr/local/icecast2/admin. Likewise, the icecast.xml.dist file in /usr/local/share/icecast/doc goes to /usr/local/icecast2/conf and can be renamed to icecast.xml. Some admins prefer using an unique name that identifies that particular icecast server or its function. In most cases icecast.xml works well for editing purposes. Consider copying the *.xsl files from the /usr/local/share/icecast/web directory to the /usr/local/icecast2/web directory. The files contained here are used to display the stream status and number as well as listeners connected.

Here is an automated method for copying over all necessary file from the command line:

# cp /usr/local/share/icecast/doc/icecast.xml.dist \
/usr/local/icecast2/conf/icecast.xml
# cp /usr/local/share/icecast/web/* /usr/local/icecast2/web/
# cp /usr/local/share/icecast/admin/*.xsl /usr/local/icecast2/admin/
# cd /usr/local/icecast2/logs
# touch access.log error.log

The same applies to the files in /usr/local/share/ices. In this case there are only two files you might need; ices-live.xml and ices-playlist.xml. The former is for streaming live audio as it is inputted to the local audio card, while the latter is for streaming a static collection of audio files:

# cp /usr/local/share/ices/ices-* /usr/local/icecast2/conf/
# cd /usr/local/icecast2/conf/
# ls
icecast.xml ices-live.xml ices-playlist.xml

Touch the log file required for tracking ices data:

# cd /usr/local/icecast2/logs
# touch ices.log

Once these files are copied into the new /usr/local/icecast2/conf directory, edit them to suit your system setup and its purpose. If you modify them beyond repair, copy the distribution or sample files back in their place. When attempting to customize the audio stream or when testing icecast controls it frequently happens that changes are made to the point where you are not certain if it was your changes or the configuration file itself that broke the program. It is always good to keep a backup of pristine configuration files.

If you are confident your configuration file(s) are correct and will do exactly what you want them to do, go ahead and jump over the next few chapters and proceed directly to Chapter 10, "Running Icecast in an Production Environment." If the XML files require customization or if you wish to use an alternative streaming application, consult the next two chapters for further details.