Configuring Icecast

Icecast2 can be configured by editing the config file with a text editor. This document follows a certain syntax which is known as xml hence the Icecast2 configuration file should be named 'icecast.xml'. If you have a file called 'icecast.xml.dist' then this is the example configuration file that is installed with Icecast2. Rename the 'icecast.xml.dist' file to just 'icecast.xml'. Configuration File Format xml is a format that uses tags similar to HTML. The important thing to know is that each 'open tag' must have a 'close tag' otherwise the file will not be accepted by the server. A tag is something that is contained within an open and closed angle bracket like so:

This example is called an 'open' tag, and each of these must have a corresponding closed tag. Closed tags start with a open angle bracket followed by a forward slash, like so:
Hence a tag like '' is the opening tag for the document, and the document is closed at the bottom of the file with ''. Values can also be contained within tag pairs. these values are the crucial parts of the configuration file that you will change to customise the configuration of Icecast2 to your needs. To change values of the configuration file change the text within the xml tags. For example, if you need to change the source-password, you will change the entry from this:
To something like this:


Comments are frequently used in the configuration file. Comments are simply remarks put in the file by the Icecast2 programmers to assist you in understanding the different sections of the configuration file. Each comment starts with ''. This is the same syntax that HTML uses for comments. HTML Comments get ignored by the browser (they have no effect on the layout of a web-page), and consequently comments in this configuration file get ignored by the Icecast2 server. The below is an example of a comment you will find in the configuration file:

 <!-- Uncomment this if you want directory listings -->    

Changing the Config File

When you first start using Icecast2 there are just a few items within the configuration file that you need to worry about. 



        <!-- Sources log in with username 'source' -->
        <!-- Relays log in username 'relay' -->


        <!-- Admin logs in with the username given below -->

The fields above control the login processes made my any type of software attempting to make a connection to the Icecast server. The exception is that media players (like Winamp / XMMS etc) do not need to have a login, they just connect without any necessary authentication. You only (for now) need to be concerned with the source-password section of this file. source-password is the password that encoders must use to make a connection to the Icecast server. In order to send a stream the encoder must first identify itself to the Icecast server by sending the correct password. If the password is correct then the server will accept the connection and you can start streaming. If the password is incorrect, or if there isn't a password sent by the encoder, then the Icecast2 server will not accept the connection and hence you will not be able to stream. There is only one password for encoding software, so if there are, for example, 10 people sending separate streams to the server then each must use the same password which is listed here. The default source-password for all Icecast2 servers is "hackme" so its a good idea to change this to something else as a lot of people know this default.

Hostname and Port

You don't need to know what a hostname and port are for now, you just have to know what these fields should be set as.

        <!-- <bind-address></bind-address> -->

Every Linux machine has what is known as a hostname. To find out what this is simply type hostname into the terminal and enter the result into the field in this section. For example if I type hostname in the terminal and I get the result "" then my hostname field in this section would look like this:
The default port for Icecast2 is "8000", just leave it as it is for now. Note: you will need to remember these two values (hostname and port) as they need to be put into the corresponding fields of your encoder.