icecast2_config_file.html 35.4 KB
Newer Older
j's avatar
j committed
1 2 3 4
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
5
<title>Icecast v2.x Documentation</title>
j's avatar
j committed
6 7 8 9
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="boxtest">
10
<h1>Icecast 2 Config File</h1>
j's avatar
j committed
11
<hr id='titlebar' />
12 13
<h3>Overview</h3>
<p>
vanguardist's avatar
vanguardist committed
14
This section will describe each section of the config file and is grouped into the following sections:
15
</p>
j's avatar
j committed
16
<ul>
17 18
<li><a href="#limits">Limits</a></li>
<li><a href="#authentication">Authentication</a></li>
19
<li><a href="#yp">Stream Directory Settings</a></li>
20 21 22 23 24 25
<li><a href="#misc">Misc Server settings</a></li>
<li><a href="#relay">Relay settings</a></li>
<li><a href="#mount">Mount Specific settings</a></li>
<li><a href="#path">File path settings</a></li>
<li><a href="#log">Logging</a></li>
<li><a href="#security">Security</a></li>
j's avatar
j committed
26 27
</ul>
<p>
j's avatar
j committed
28 29 30
<br />
<br />
<br />
j's avatar
j committed
31
</p>
32 33 34 35
<a name="limits"></a>
<h2>Limits</h2>
<pre>
    &lt;limits&gt;
36 37 38 39 40 41 42 43 44
        &lt;clients&gt;100&lt;/clients&gt;
        &lt;sources&gt;2&lt;/sources&gt;
        &lt;queue-size&gt;102400&lt;/queue-size&gt;
        &lt;client-timeout&gt;30&lt;/client-timeout&gt;
        &lt;header-timeout&gt;15&lt;/header-timeout&gt;
        &lt;source-timeout&gt;10&lt;/source-timeout&gt;
        &lt;burst-on-connect&gt;1&lt;/burst-on-connect&gt;
        &lt;burst-size&gt;65536&lt;/burst-size&gt;
    &lt;/limits&gt;
45
</pre>
vanguardist's avatar
vanguardist committed
46
<p>This section contains server level settings that, in general, do not need to be changed.  Only modify this section if you are know what you are doing.
47 48
</p>
<h4>clients</h4>
j's avatar
j committed
49
<div class="indentedbox">
50
Total number of concurrent clients supported by the server.  Listeners are considered clients, but so are accesses to any static content (i.e. fileserved content) and also any requests to gather stats.  These are max *concurrent* connections for the entire server (not per mountpoint).
51 52
</div>
<h4>sources</h4>
j's avatar
j committed
53
<div class="indentedbox">
54
Maximum number of connected sources supported by the server. This includes active relays and source clients
55 56
</div>
<h4>queue-size</h4>
j's avatar
j committed
57
<div class="indentedbox">
58 59 60 61 62 63 64
    This is the maximum size (in bytes) of the stream queue.  A listener may temporarily lag behind
    due to network congestion and in this case an internal queue is maintained for the listeners. 
    If the queue grows larger than this config value, then it is truncated and any listeners found
    will be removed from the stream.<br />
    This will be the default setting for the streams which is 512k unless overridden here. You can
    override this in the individual mount settings which can be useful if you have a mixture of high
    bandwidth video and low bitrate audio streams.
65 66
</div>
<h4>client-timeout</h4>
j's avatar
j committed
67
<div class="indentedbox">
68 69 70
This does not seem to be used.
</div>
<h4>header-timeout</h4>
j's avatar
j committed
71
<div class="indentedbox">
vanguardist's avatar
vanguardist committed
72
The maximum time (in seconds) to wait for a request to come in once the client has made a connection to the server.  In general this value should not need to be tweaked.
73 74
</div>
<h4>source-timeout</h4>
j's avatar
j committed
75
<div class="indentedbox">
76 77
If a connected source does not send any data within this timeout period (in seconds), then the source connection will be removed from the server.
</div>
78
<h4>burst-on-connect</h4>
j's avatar
j committed
79
<div class="indentedbox">
80 81
    This setting is really just an alias for burst-size. When enabled the burst-size is 64 kbytes
    and disabled the burst-size is 0 kbytes. This option is deprecated, use burst-size instead.
82
</div>
83
<h4>burst-size</h4>
j's avatar
j committed
84
<div class="indentedbox">
85 86
The burst size is the amount of data (in bytes) to burst to a client at connection time. Like
burst-on-connect, this is to quickly fill the pre-buffer used by media players. The default
87 88
is 64 kbytes which is a typical size used by most clients so changing it is not usually required.
This setting applies to all mountpoints unless overridden in the mount settings.
89
</div>
j's avatar
j committed
90
<p>
j's avatar
j committed
91 92 93
<br />
<br />
<br />
j's avatar
j committed
94
</p>
95 96 97 98
<a name="authentication"></a>
<h2>Authentication</h2>
<pre>
    &lt;authentication&gt;
99
        &lt;source-password&gt;hackme&lt;/source-password&gt;
100
        &lt;relay-user&gt;relay&lt;/relay-user&gt;
101 102 103 104
        &lt;relay-password&gt;hackme&lt;/relay-password&gt;
        &lt;admin-user&gt;admin&lt;/admin-user&gt;
        &lt;admin-password&gt;hackme&lt;/admin-password&gt;
    &lt;/authentication&gt;
105
</pre>
106
<p>This section contains all the usernames and passwords used for administration purposes or to connect sources and relays.
107 108
</p>
<h4>source-password</h4>
j's avatar
j committed
109
<div class="indentedbox">
110 111 112
    The unencrypted password used by sources to connect to icecast2.  The default username
    for all source connections is 'source' but this option allows to specify a default
    password.  This and the username can be changed in the individual mount sections.
113
</div>
114 115 116 117 118
<h4>relay-user</h4>
<div class="indentedbox">
Used in the master server as part of the authentication when a slave requests
the list of streams to relay.  The default username is 'relay'
</div>
119
<h4>relay-password</h4>
j's avatar
j committed
120
<div class="indentedbox">
121 122
Used in the master server as part of the authentication when a slave requests
the list of streams to relay.
123 124 125
</div>
<h4>admin-user</h4>
<h4>admin-password</h4>
j's avatar
j committed
126
<div class="indentedbox">
127 128
The username/password used for all administration functions.  This includes retrieving statistics, accessing the web-based administration screens, etc.  A list of these functions can be found in the "Administration" section of the manual.
</div>
j's avatar
j committed
129
<p>
j's avatar
j committed
130 131 132
<br />
<br />
<br />
j's avatar
j committed
133
</p>
134
<a name="yp"></a>
135
<h2>Stream Directory Settings</h2>
136 137
<pre>
    &lt;directory&gt;
138 139 140
        &lt;yp-url-timeout&gt;15&lt;/yp-url-timeout&gt;
        &lt;yp-url&gt;http://dir.xiph.org/cgi-bin/yp-cgi&lt;/yp-url&gt;
    &lt;/directory&gt;
141 142 143 144
</pre>
<p>This section contains all the settings for listing a stream on any of the Icecast2 YP Directory servers.  Multiple occurances of this section can be specified in order to be listed on multiple directory servers.
</p>
<h4>yp-url-timeout</h4>
j's avatar
j committed
145
<div class="indentedbox">
146 147 148
This value is the maximum time icecast2 will wait for a response from a particular directory server.  The recommended value should be sufficient for most directory servers.
</div>
<h4>yp-url</h4>
j's avatar
j committed
149
<div class="indentedbox">
150 151
The URL which icecast2 uses to communicate with the Directory server.  The value for this setting is provided by the owner of the Directory server.
</div>
j's avatar
j committed
152
<p>
j's avatar
j committed
153 154 155
<br />
<br />
<br />
j's avatar
j committed
156
</p>
157 158
<a name="misc"></a>
<h2>Misc Server Settings</h2>
159
<p>Server wide settings.</p>
160 161
<pre>
    &lt;hostname&gt;localhost&lt;hostname&gt;
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
    &lt;fileserve&gt;1&lt;/fileserve&gt;
    &lt;server-id&gt;icecast 2.3&lt;/server-id&gt;
</pre>

<h4>hostname</h4>
<div class="indentedbox">
    This is the DNS name or IP address that will be used for the stream directory lookups or
    possibily the playlist generation if a Host header is not provided. While localhost is shown
    as an example, in fact you will want something that your listeners can use.
</div>
<h4>fileserve</h4>
<div class="indentedbox">
    This flag turns on the icecast2 fileserver from which static files can be served.  All files
    are served relative to the path specified in the &lt;paths&gt;&lt;webroot&gt; configuration
    setting. By default the setting is enabled so that requests for the images on the status
    page are retrievable.
</div>
<h4>server-id</h4>
<div class="indentedbox">
    This optional setting allows for the administrator of the server to override the default
    server identification. The default is icecast followed by a version number and most will
    not care to change it however this setting will change that.
</div>
185

186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
<p>The following shows how you can specify the listening settings for the server.</p><p>The
first shows an example of a common and simple way to define a listening socket
<pre>
    &lt;listen-socket&gt;
        &lt;port&gt;8000&lt;/port&gt;
    &lt;/listen-socket&gt;
</pre>
<p>Using this as a basis we can extend this with an &lt;bind-address&gt; setting to limit which
address icecast will listen on. Most will not need to use bind-address and often get confused
by using it when there is no need. Another possibility is to use an &lt;ssl&gt; boolean setting
which informs icecast that a secured connection is to be used. A common use for using a secure
connection would be for admin page access.</p>
<p>The following shows how we can extend a single listen-socket to work with shoutcast style
source clients. There are two issues shoutcast source clients have over icecast source clients,
one is the lack of mountpoint and the second is the requirement of two ports. Both of these
issues are handled by a simple addition in the listen-socket.</p>
<pre>
    &lt;listen-socket&gt;
        &lt;port&gt;8000&lt;/port&gt;
        &lt;shoutcast-mount&gt;/live.mp3&lt;/shoutcast-mount&gt;
    &lt;/listen-socket&gt;
</pre>
<p>As before the port specified is allocated but this time the shoutcast-mount implicity defines
a second listening socket whose port number is always one higher than the port defined, this also
informs icecast of which mountpoint the shoutcast source client on this socket will be using.
Using this approach you can allow multiple shoutcast source clients to connect at the same time.
<p>The following is just to show the longer approach to defining shoutcast compatability.</p>
<pre>
    &lt;shoutcast-mount&gt;/live.nsv&lt;/shoutcast-mount&gt;
215

216
    &lt;-- You may have multiple &lt;listen-socket&gt; elements --&gt;
217
    &lt;listen-socket&gt;
218 219
        &lt;port&gt;8000&lt;/port&gt;
    &lt;/listen-socket&gt;
220

221 222 223 224
    &lt;listen-socket&gt;
        &lt;port&gt;8001&lt;/port&gt;
        &lt;shoutcast-compat&gt;1&lt;/shoutcast-compat&gt;
    &lt;/listen-socket&gt;
225
</pre>
226 227 228

<p>Note that multiple listen-socket sections may be configured in order to have icecast2 listen
on multiple network interfaces or multiple ports.
229
If a bind-address is not specified for a particular listen-socket, then the socket will be
230 231
bound to all interfaces (including IPv6 if available). For most people, the bind-address option
will not be required and often confuses people.
232 233
</p>
<h4>port</h4>
j's avatar
j committed
234
<div class="indentedbox">
235 236 237
The TCP port that will be used to accept client connections.
</div>
<h4>bind-address</h4>
j's avatar
j committed
238
<div class="indentedbox">
239
An optional IP address that can be used to bind to a specific network card.  If not supplied, then it will bind to all interfaces.
240
</div>
241
<h4>shoutcast-mount</h4>
j's avatar
j committed
242
<div class="indentedbox">
243 244 245 246 247 248 249 250 251
    An optional mountpoint setting to be used when shoutcast DSP compatible clients connect. The
    default global setting is /stream but can be overridden here to use an alternative name which
    may include an extension that some clients require for certain formats.<br /><br />
    Defining this within a listen-socket group tells icecast that this port and the subsequent
    port are to be used for shoutcast compatible source clients. This is an alternative to the
    shoutcast-compat approach as this implicitly defines the second listening socket and allows
    for specifying multiple sockets using different mountpoints for shoutcast source
    clients. The shoutcast-mount outside of a listen-socket group is the global setting of the
    mountpoint to use.
252
</div>
253
<h4>shoutcast-compat</h4>
254
<div class="indentedbox">
255
This optional flag will indicate that this port will operate in 'shoutcast-compatibility' mode.  Due to major differences in the source client connection protocol, if you wish to use any of the shoutcast DJ tools, you will need to configure at least one socket as shoutcast-compatible.  Note that when in this mode, only source clients (and specifically shoutcast source clients) will be able to attach to this port.  All listeners may connect to any of the ports defined without this flag.  Also, for proper Shoutcast DSP compatibility, you must define a listen socket with a port one less than the one defined as 'shoutcast-compat'.  This means if you define 8001 as shoutcast-compat, then you will need to define a listen port of 8000 and it must not also be defined as shoutcast-compat.  See the example config file in the distribution for more info.
256
</div>
j's avatar
j committed
257
<p>
j's avatar
j committed
258 259 260
<br />
<br />
<br />
j's avatar
j committed
261
</p>
262
<a name="relay"></a>
263 264 265 266 267 268 269 270 271 272
<h2>Relaying Streams</h2>

<p>This section contains the servers relay settings. The relays are implemented using a pull system where
the receiving server connects as if its a listener to the sending server.  There are two types of relay
setups: a "Master server relay" or a "Specific Mountpoint relay." 
</p>
<h3>Master Relay</h3>
<p>
A Master server relay is only supported between icecast2 servers and is used to relay a number of
mountpoints from a remote icecast2 server.
273
<pre>
274 275 276
    &lt;master-server&gt;127.0.0.1&lt;/master-server&gt;
    &lt;master-server-port&gt;8001&lt;/master-server-port&gt;
    &lt;master-update-interval&gt;120&lt;/master-update-interval&gt;
277
    &lt;master-username&gt;relay&lt;/master-username&gt;
278
    &lt;master-password&gt;hackme&lt;/master-password&gt;
279
    &lt;relays-on-demand&gt;0&lt;/relays-on-demand&gt;
280
</pre>
281 282 283 284 285 286 287
<br />
<p>The following diagram shows the basics of using a Master relay.  Please note that the slave is
configured with the &lt;master-server&gt;, &lt;master-server-port&gt;, etc settings and the
master is the icecast server from which the slave will pull mountpoints and relay them.   Using a
Master server relay, all non-hidden mountpoints on the master can be relayed using this mechanism. </p>
<br />
<img src="masterslave.png">
288
<p>
289 290
A server is configured as a Master Server relay by specifying the &lt;master-server&gt;, &lt;master-server-port&gt;,&lt;master-update-interval&gt;,&lt;master-password&gt; values in the config file.  The server that is being relayed does not need any special configuration.
</p>
291

292
<h4>master-server</h4>
j's avatar
j committed
293
<div class="indentedbox">
294
This is the IP for the server which contains the mountpoints to be relayed (Master Server).
295 296
</div>
<h4>master-server-port</h4>
j's avatar
j committed
297
<div class="indentedbox">
298 299 300
This is the TCP Port for the server which contains the mountpoints to be relayed (Master Server).
</div>
<h4>master-update-interval</h4>
j's avatar
j committed
301
<div class="indentedbox">
vanguardist's avatar
vanguardist committed
302
The interval (in seconds) that the Relay Server will poll the Master Server for any new mountpoints to relay.
303
</div>
304 305 306 307 308 309
<h4>master-username</h4>
<div class="indentedbox">
This is the relay username on the master server.  It is used to query the
server for a list of mountpoints to relay. If not specified then 'relay' is
used
</div>
310
<h4>master-password</h4>
j's avatar
j committed
311
<div class="indentedbox">
312 313
This is the relay password on the Master server.  It is used to query the
server for a list of mountpoints to relay.
314
</div>
315 316
<h4>relays-on-demand</h4>
<div class="indentedbox">
317 318 319 320
Global on-demand setting for relays. Because you do not have individual relay options when using a
master server relay, you still may want those relays to only pull the stream when there is at least
one listener on the slave. The typical case here is to avoid surplus bandwidth costs when no one is
listening.
321 322
</div>

j's avatar
j committed
323
<br />
324
<h3>Specific Mountpoint Relay</h3>
325 326 327 328 329 330 331 332
<p>
If only specific mountpoints need to be relayed, then you can configure Icecast with a "Specific
Mountpoint Relay". 
</p>
The following diagram shows the basics of using a Specific Mountpoint relay.  Note that the relaying
Icecast is configured with the &lt;relay&gt; settings and will pull the specified mountpoint(s) and
relay them to the listeners.  Using a Specific Mountpoint Relay, only those mountpoints specified
will be relayed.
333

334 335 336
<br /><br />
<img src="relay.png">
<p>
337 338
Specific Mountpoint Relays can be configured to relay from an Icecast 2 server, as well as Icecast 1.x and Shoutcast.
A server is configured as a Specific Mountpoint Server relay by specifying a &lt;relay&gt; XML chunk in the config file for each mountpoint to be relayed.  The server that is being relayed does not need any special configuration.
339
</p>
340 341 342 343
<pre>
    &lt;relay&gt;
        &lt;server&gt;127.0.0.1&lt;/server&gt;
        &lt;port&gt;8001&lt;/port&gt;
344
        &lt;mount&gt;/example.ogg&lt;/mount&gt;
345
        &lt;local-mount&gt;/different.ogg&lt;/local-mount&gt;
346 347
        &lt;username&gt;joe&lt;/username&gt;
        &lt;password&gt;soap&lt;/password&gt;
348
        &lt;relay-shoutcast-metadata&gt;0&lt;/relay-shoutcast-metadata&gt;
349
        &lt;on-demand&gt;1&lt;/on-demand&gt;
350 351
    &lt;/relay&gt;
</pre>
352

353

354
<h4>server</h4>
j's avatar
j committed
355
<div class="indentedbox">
356 357 358
This is the IP for the server which contains the mountpoint to be relayed.
</div>
<h4>port</h4>
j's avatar
j committed
359
<div class="indentedbox">
360 361 362
This is the TCP Port for the server which contains the mountpoint to be relayed.
</div>
<h4>mount</h4>
j's avatar
j committed
363
<div class="indentedbox">
364 365
    The mountpoint located on the remote server.  If you are relaying a shoutcast stream, this
    should be a '/' or '/;name'. 
366 367
</div>
<h4>local-mount</h4>
j's avatar
j committed
368
<div class="indentedbox">
369 370
    The name to use for the local mountpoint.  This is what the mount will be named on the relaying
    server. By default the remote mountpoint name is used.
371
</div>
372 373 374 375 376 377 378 379
<h4>username</h4>
<div class="indentedbox">
The source of the relay may require authentication itself, if so state the username here.
</div>
<h4>password</h4>
<div class="indentedbox">
The source of the relay may require authentication itself, if so state the password here.
</div>
380
<h4>relay-shoutcast-metadata</h4>
j's avatar
j committed
381
<div class="indentedbox">
382 383 384
    If you are relaying a Shoutcast stream, you may want to specify this indicator to also relay
    the metadata (song titles) that are part of the Shoutcast data stream (1=enabled, 0=disabled).
    By default this is enabled but it is up to the remote server on whether it sends any.
385
</div>
386 387
<h4>on-demand</h4>
<div class="indentedbox">
388 389 390
    <p>An on-demand relay will only retrieve the stream if there are listeners requesting the
    stream.  1=enabled, 0=disabled (default is &lt;relays-on-demand&gt;). This is useful in cases
    where you want to limit bandwidth costs when no one is listening. </p>
391 392
</div>

j's avatar
j committed
393
<p>
j's avatar
j committed
394 395 396
<br />
<br />
<br />
j's avatar
j committed
397
</p>
398 399 400 401
<a name="mount"></a>
<h2>Mount Specific Settings</h2>
<pre>
    &lt;mount&gt;
402 403 404 405
        &lt;mount-name&gt;/example-complex.ogg&lt;/mount-name&gt;
        &lt;username&gt;othersource&lt;/username&gt;
        &lt;password&gt;hackmemore&lt;/password&gt;
        &lt;max-listeners&gt;1&lt;/max-listeners&gt;
406
        &lt;max-listener-duration&gt;3600&lt;/max-listener-duration&gt;
407
        &lt;dump-file&gt;/tmp/dump-example1.ogg&lt;/dump-file&gt;
Karl Heyes's avatar
Karl Heyes committed
408
        &lt;intro&gt;/intro.ogg&lt;/intro&gt;
409
        &lt;fallback-mount&gt;/example2.ogg&lt;/fallback-mount&gt;
410
        &lt;fallback-override&gt;1&lt;/fallback-override&gt;
411
        &lt;fallback-when-full&gt;1&lt;/fallback-when-full&gt;
412
        &lt;charset&gt;ISO8859-1&lt;/charset&gt;
413 414 415 416 417 418 419 420
        &lt;public&gt;1&lt;/public&gt;
        &lt;stream-name&gt;My audio stream&lt;/stream-name&gt;
        &lt;stream-description&gt;My audio description&lt;/stream-description&gt;
        &lt;stream-url&gt;http://some.place.com&lt;/stream-url&gt;
        &lt;genre&gt;classical&lt;/genre&gt;
        &lt;bitrate&gt;64&lt;/bitrate&gt;
        &lt;type&gt;application/ogg&lt;/type&gt;
        &lt;subtype&gt;vorbis&lt;/subtype&gt;
421
        &lt;hidden&gt;1&lt;/hidden&gt;
422
        &lt;burst-size&gt;65536&lt;/burst-size&gt;
423
        &lt;mp3-metadata-interval&gt;4096&lt;/mp3-metadata-interval&gt;
424 425
        &lt;authentication type="htpasswd"&gt;
                &lt;option name="filename" value="myauth"/&gt;
426
                &lt;option name="allow_duplicate_users" value="0"/&gt;
427
        &lt;/authentication&gt;
428 429
        &lt;on-connect&gt;/home/icecast/bin/source-start&lt;/on-connect&gt;
        &lt;on-disconnect&gt;/home/icecast/bin/source-end&lt;/on-disconnect&gt;
430
    &lt;/mount&gt;
431
</pre>
432 433 434 435 436 437 438 439 440 441
<p>This section contains the settings which apply only to a specific mountpoint and applies to
an incoming stream whether it is a relay or a source client. The purpose of the mount definition
is to state certain information that can override either global/default settings or settings
provided from the incoming stream.
</p>
<p>A mount does not need to be stated for each incoming source although you may want to
specific certain settings like the maximum number of listeners or a mountpoint specific
username/password.  As a general rule, only define what you need to but each mount definition
needs at least the mount-name.  Changes to most of these will apply across a configuration file
re-read even on active streams, however some only apply when the stream starts or ends.
442 443
</p>
<h4>mount-name</h4>
j's avatar
j committed
444
<div class="indentedbox">
445 446 447
The name of the mount point for which these settings apply.
</div>
<h4>username</h4>
j's avatar
j committed
448
<div class="indentedbox">
449 450 451
An optional value which will set the username that a source must use to connect using this mountpoint.
</div>
<h4>password</h4>
j's avatar
j committed
452
<div class="indentedbox">
453 454 455
An optional value which will set the password that a source must use to connect using this mountpoint.
</div>
<h4>max-listeners</h4>
j's avatar
j committed
456
<div class="indentedbox">
457 458
An optional value which will set the maximum number of listeners that can be attached to this mountpoint.
</div>
459 460 461 462 463
<h4>max-listener-duration</h4>
<div class="indentedbox">
    An optional value which will set the length of time a listener will stay connected to the
    stream. An auth component may override this.
</div>
464
<h4>dump-file</h4>
j's avatar
j committed
465
<div class="indentedbox">
466 467
An optional value which will set the filename which will be a dump of the stream coming through on this mountpoint.
</div>
Karl Heyes's avatar
Karl Heyes committed
468 469 470 471 472 473 474 475
<h4>intro</h4>
<div class="indentedbox">
    <p>An optional value which will specify the file those contents will be sent to new listeners
    when they connect but before the normal stream is sent. Make sure the format of the file
    specified matches the streaming format.  The specified file is appended to webroot before
    being opened.
    </p>
</div>
476
<h4>fallback-mount</h4>
j's avatar
j committed
477
<div class="indentedbox">
Karl Heyes's avatar
Karl Heyes committed
478 479 480
This optional value specifies a mountpoint that clients are automatically moved to if the source
shuts down or is not streaming at the time a listener connects.  Only one can be listed in each
mount and should refer to another mountpoint on the same server that is streaming in the same
481
streaming format.<br>
Karl Heyes's avatar
Karl Heyes committed
482 483 484 485
If clients cannot fallback to another mountpoint, due to a missing fallback-mount or it states a
mountpoint that is just not available, then those clients will be disconnected.
If clients are falling back to a mountpoint and the fallback-mount is not actively streaming
but defines a fallback-mount itself then those clients may be moved there instead.
486
This multi-level fallback allows clients to cascade several mountpoints.
487 488 489 490 491 492 493 494 495 496 497
    <p>A fallback mount can also state a file that is located in webroot.  This is useful for
    playing a pre-recorded file in the case of a stream going down. It will repeat until either
    the listener disconnects or a stream comes back available and takes the listeners back.
    As per usual, the file format should match the stream format, failing to do so may cause
    problems with playback.
    </p>
    <p>Note that the fallback file is not timed so be careful if you intend to relay this.
    They are fine on slave streams but don't use them on master streams, if you do then the
    relay will consume stream data at a faster rate and the listeners on the relay would
    eventually get kicked off.
    </p>
498
</div>
499
<h4>fallback-override</h4>
j's avatar
j committed
500
<div class="indentedbox">
501 502 503
When enabled, this allows a connecting source client or relay on this mountpoint to move
listening clients back from the fallback mount.
</div>
504 505 506 507 508 509
<h4>fallback-when-full</h4>
<div class="indentedbox">
    <p>When set to 1, this will cause new listeners, when the max listener count for the
    mountpoint has been reached, to move to the fallback mount if there is one specified.
    </p>
</div>
510 511 512 513 514 515 516
<h4>no-yp (deprecated)</h4>
<div class="indentedbox">
    <p>Setting this option prevents this mountpoint from advertising on YP.  The default is 0
    so YP advertising can occur however you may want to prevent it here if you intend listeners
    to connect to a local relay instead. Deprecated option, replaced by &lt;public&gt;
    </p>
</div>
517 518 519 520 521 522 523 524 525 526 527 528 529
<h4>charset</h4>
<div class="indentedbox">
    <p>For non-Ogg streams like MP3, the metadata that is inserted into the stream often has no
    defined character set. We have traditionally assumed UTF8 as it allows for multiple language
    sets on the web pages and stream directory, however many source clients for MP3 type streams
    have assumed Latin1 (ISO 8859-1) or leave it to whatever character set is in use on the
    source client system.</p>
    <p>This character mismatch has been known to cause a problem as the stats engine and stream
    directory servers want UTF8 so now we assume Latin1 for non-Ogg streams (to handle the common
    case) but you can specify an alternative character set with this option.
    <p>The source clients can also specify a charset= parameter to the metadata update URL if
    they so wish.</p>
</div>
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
<h4>public</h4>
<div class="indentedbox">
    <p>The default setting for this is -1 indicating that it is up to the source client or
    relay to determine if this mountpoint should advertise. A setting of 0 will prevent any
    advertising and a setting of 1 will force it to advertise. If you do force advertising
    you may need to set other settings listed below as the YP server can refuse to advertise
    if there is not enough information provided.
    </p>
</div>
<h4>stream-name</h4>
<div class="indentedbox">
    <p>Setting this will add the specified name to the stats (and therefore YP) for this
    mountpoint even if the source client/relay provide one.
    </p>
</div>
<h4>stream-description</h4>
<div class="indentedbox">
    <p>Setting this will add the specified description to the stats (and therefore YP) for
    this mountpoint even if the source client/relay provide one.
    </p>
</div>
<h4>stream-url</h4>
<div class="indentedbox">
    <p>Setting this will add the specified URL to the stats (and therefore YP) for this
554
    mountpoint even if the source client/relay provide one.  The URL is generally for
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
    directing people to a website.
    </p>
</div>
<h4>genre</h4>
<div class="indentedbox">
    <p>Setting this will add the specified genre to the stats (and therefore YP) for this
    mountpoint even if the source client/relay provide one. This can be anything be using
    certain key words can help searches in the YP directories.
    </p>
</div>
<h4>bitrate</h4>
<div class="indentedbox">
    <p>Setting this will add the specified bitrate to the stats (and therefore YP) for this
    mountpoint even if the source client/relay provide one.  This is stated in kbps.
    </p>
</div>
<h4>type</h4>
<div class="indentedbox">
    <p>Setting this will add the specified mime type to the stats (and therefore YP) for
    this mountpoint even if the source client/relay provide one.  It is very unlikely that
    this will be needed.
    </p>
</div>
<h4>subtype</h4>
Karl Heyes's avatar
Karl Heyes committed
579
<div class="indentedbox">
580 581 582 583
    <p>Setting this will add the specified subtype to the stats (and therefore YP) for
    this mountpoint. The subtype is really to help the YP server to identify the components
    of the type. An example setting is vorbis/theora do indicate the codecs in an Ogg stream
    </p>
Karl Heyes's avatar
Karl Heyes committed
584
</div>
585
<h4>burst-size</h4>
j's avatar
j committed
586
<div class="indentedbox">
587 588 589
This optional setting allows for providing a burst size which overrides the default burst size
as defined in limits.  The value is in bytes.
</div>
590 591
<h4>mp3-metadata-interval</h4>
<div class="indentedbox">
592 593 594 595 596
    <p>This optional setting specifies what interval, in bytes, there is between metadata
    updates within shoutcast compatible streams. This only applies to new listeners connecting
    on this mountpoint, not existing listeners falling back to this mountpoint.  The default
    is either the hardcoded server default or the value passed from a relay.
    </p>
597
</div>
598 599 600 601 602 603
<h4>hidden</h4>
<div class="indentedbox">
Enable this to prevent this mount from being shown on the xsl pages.  This is mainly
for cases where a local relay is configured and you do not want the source of the local
relay to be shown
</div>
604
<h4>authentication</h4>
j's avatar
j committed
605
<div class="indentedbox">
606
This specifies that the named mount point will require listener authentication.  Currently, we only support a file-based authentication scheme (type=htpasswd).  Users and encrypted password are placed in this file (separated by a :) and all requests for this mountpoint will require that a user and password be supplied for authentication purposes.  These values are passed in via normal HTTP Basic Authentication means (i.e. http://user:password@stream:port/mountpoint.ogg).  Users and Passwords are maintained via the web admin interface.  A mountpoint configured with an authenticator will display a red key next to the mount point name on the admin screens.  You can read more about listener authentication <a href="icecast2_listenerauth.html">here</a>.
607
</div>
608 609 610 611 612 613 614 615 616 617 618 619 620 621
<h4>on-connect</h4>
<div class="indentedbox">
    <p>State a program that is run when the source is started. It is passed a parameter which
    is the name of the mountpoint that is starting. The processing of the stream does not wait
    for the script to end. This option is not available on win32
    </p>
</div>
<h4>on-disconnect</h4>
<div class="indentedbox">
    <p>State a program that is run when the source ends. It is passed a parameter which is the
    name of the mountpoint that has ended. The processing of the stream does not wait for the
    script to end. This option is not available on win32
    </p>
</div>
j's avatar
j committed
622
<p>
j's avatar
j committed
623 624 625
<br />
<br />
<br />
j's avatar
j committed
626
</p>
627 628 629 630
<a name="path"></a>
<h2>Path Settings</h2>
<pre>
    &lt;paths&gt;
631 632 633 634 635
        &lt;basedir&gt;./&lt;/basedir&gt;
        &lt;logdir&gt;./logs&lt;/logdir&gt;
        &lt;pidfile&gt;./icecast.pid&lt;/pidfile&gt;
        &lt;webroot&gt;./web&lt;/webroot&gt;
        &lt;adminroot&gt;./admin&lt;/adminroot&gt;
636 637
        &lt;allow-ip&gt;/path/to/ip_allowlist&lt;/allow-ip&gt;
        &lt;deny-ip&gt;/path_to_ip_denylist&lt;/deny-ip&gt;
638
        &lt;alias source="/foo" dest="/bar"/&gt;
639
    &lt;/paths&gt;
640
</pre>
641
<p>This section contains paths which are used for various things within icecast.  All paths (other than any aliases) should not end in a '/'.
642 643
</p>
<h4>basedir</h4>
j's avatar
j committed
644
<div class="indentedbox">
645 646 647
This path is used in conjunction with the chroot settings, and specified the base directory that is chrooted to when the server is started.  This feature is not supported on win32.
</div>
<h4>logdir</h4>
j's avatar
j committed
648
<div class="indentedbox">
649
This path specifies the base directory used for logging. Both the error.log and access.log will be created relative to this directory.
650
</div>
651
<h4>pidfile</h4>
j's avatar
j committed
652
<div class="indentedbox">
653 654
This pathname specifies the file to write at startup and to remove at normal shutdown. The file contains the process id of the icecast process. This could be read and used for sending signals icecast.
</div>
655
<h4>webroot</h4>
j's avatar
j committed
656
<div class="indentedbox">
657 658 659
This path specifies the base directory used for all static file requests.  This directory can contain all standard file types (including mp3s and ogg vorbis files).  For example, if webroot is set to /var/share/icecast2, and a request for http://server:port/mp3/stuff.mp3 comes in, then the file /var/share/icecast2/mp3/stuff.mp3 will be served.
</div>
<h4>adminroot</h4>
j's avatar
j committed
660
<div class="indentedbox">
661 662
This path specifies the base directory used for all admin requests.  More specifically, this is used to hold the XSLT scripts used for the web-based admin interface.  The admin directory contained within the icecast distribution contains these files.
</div>
663 664 665 666 667 668 669 670 671 672 673 674
<h4>allow-ip</h4>
<div class="indentedbox">
    If specified, this specifies the location of a file that contains a list of IP addresses that
    will be allowed to connect to icecast. This could be useful in cases where a master only
    feeds known slaves. The format of the file is simple, one IP per line.
</div>
<h4>deny-ip</h4>
<div class="indentedbox">
    If specified, this specifies the location of a file that contains a list of IP addressess that
    will be dropped immediately. This is mainly for problem clients when you have no access to any
    firewall configuration. The format of the file is simple, one IP per line.
</div>
675
<h4>alias source="/foo" dest="/bar"</h4>
j's avatar
j committed
676
<div class="indentedbox">
677 678
Aliases are used to provide a way to create multiple mountpoints that refer to the same mountpoint.
</div>
j's avatar
j committed
679
<p>
j's avatar
j committed
680 681 682
<br />
<br />
<br />
j's avatar
j committed
683
</p>
684 685 686 687 688 689
<a name="log"></a>
<h2>Logging Settings</h2>
<pre>
    &lt;logging&gt;
        &lt;accesslog&gt;access.log&lt;/accesslog&gt;
        &lt;errorlog&gt;error.log&lt;/errorlog&gt;
690
        &lt;playlistlog&gt;playlist.log&lt;/playlistlog&gt;
691 692 693 694 695 696
      	&lt;loglevel&gt;4&lt;/loglevel&gt; &lt;-- 4 Debug, 3 Info, 2 Warn, 1 Error --&gt;
    &lt;/logging&gt;
</pre>
<p>This section contains information relating to logging within icecast.  There are two logfiles currently generated by icecast, an error.log (where all log messages are placed) and an access.log (where all stream/admin/http requests are logged).
</p>
<p>Note that on non-win32 platforms, a HUP signal can be sent to icecast in which the log files are re-opened for appending giving the ability move/remove the log files.
697
</p>
698
<h4>accesslog</h4>
j's avatar
j committed
699
<div class="indentedbox">
700 701 702
Into this file, all requests made to the icecast2 will be logged.  This file is relative to the path specified by the &lt;logdir&gt; config value.
</div>
<h4>errorlog</h4>
j's avatar
j committed
703
<div class="indentedbox">
704 705
All icecast generated log messages will be written to this file.  If the loglevel is set too high (Debug for instance) then this file can grow fairly large over time.  Currently, there is no log-rotation implemented.
</div>
706 707 708 709
<h4>playlistlog</h4>
<div class="indentedbox">
Into this file, a log of all metadata for each mountpoint will be written.  The format of the logfile will most likely change over time as we narrow in on a standard format for this.  Currently, the file is pipe delimited.  This option is optional and can be removed entirely from the config file.
</div>
710 711 712 713 714 715 716 717 718 719 720 721
<h4>logsize</h4>
<div class="indentedbox">
This value specifies (in Kbytes) the maxmimum size of any of the log files.  When the logfile grows beyond this value,
icecast will either rename it to logfile.old, or add a timestamp to the archived file (if logarchive is enabled).
</div>
<h4>logarchive</h4>
<div class="indentedbox">
If this value is set, then icecast will append a timestamp to the end of the logfile name when logsize has been reached.
If disabled, then the default behavior is to rename the logfile to logfile.old (overwriting any previously saved
logfiles).  We disable this by default to prevent the filling up of filesystems for people who don't care (or know) that 
their logs are growing.
</div>
722
<h4>loglevel</h4>
j's avatar
j committed
723 724
<div class="indentedbox">
Indicates what messages are logged by icecast.  Log messages are categorized into one of 4 types, Debug, Info, Warn, and Error.<br /><br />The following mapping can be used to set the appropraite value :
j's avatar
j committed
725
<ul>
726 727 728 729
<li>loglevel = 4 - Debug, Info, Warn, Error messages are printed</li>
<li>loglevel = 3 - Info, Warn, Error messages are printed</li>
<li>loglevel = 2 - Warn, Error messages are printed</li>
<li>loglevel = 1 - Error messages only are printed</li>
j's avatar
j committed
730
</ul>
731
</div>
j's avatar
j committed
732
<br />
733 734 735 736 737 738 739 740 741 742 743 744 745 746
<a name="security"></a>
<h2>Security Settings</h2>
<pre>
    &lt;security&gt;
        &lt;chroot&gt;0&lt;/chroot&gt;
        &lt;changeowner&gt;
            &lt;user&gt;nobody&lt;/user&gt;
            &lt;group&gt;nogroup&lt;/group&gt;
	&lt;/changeowner&gt;
    &lt;/security&gt;
</pre>
<p>This section contains configuration settings that can be used to secure the icecast server by performing a chroot to a secured location.  This is currently not supported on win32.
</p>
<h4>chroot</h4>
j's avatar
j committed
747
<div class="indentedbox">
748 749 750
An indicator which specifies whether a chroot() will be done when the server is started.  The chrooted path is specified by the &lt;basedir&gt; configuration value.
</div>
<h4>changeowner</h4>
j's avatar
j committed
751
<div class="indentedbox">
752 753 754 755 756
This section indicates the user and group that will own the icecast process when it is started.  These need to be valid users on the system.
</div>
</div>
</body>
</html>