Icecast.conf

From HSS
Revision as of 06:09, 2 September 2025 by C0 (talk | contribs) (config icecast)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Configuration file (icecast.conf)

This section describes the configuration parameters inside icecast main configuration file, icecast.conf

More information about the parameters can be found inside the icecast.conf file itself.

Comments lines start with a '#' sign as the first character in the line, the rest of the line is ignored.

Configuration parameters are specified as 'parametername parameter', where parametername is a string without spaces and parameter is the rest of the line.

Never enclose the parameter in double quotes (""). Most of these parameters can be changed using the set command on the admin console.

  • encoder_password This is the password by which the server accepts encoders, metadata connections and pushing relays. You cannot connect to the server as an admin with this password.
  • admin_password The password needed for admins to be accepted to the admin console. Access to the WWW admin interface does not use this password, see the section about the WWW interface below.
  • oper_password This is the password an admin must specify to get access to the restricted server operator commands.
  • touch_freq This setting regulates how often the directory servers get 'touched' by the icecast server. The default setting of 5 minutes is a good value.
  • max_clients The maximum number of simultaneous clients connected to the server.
  • max_sources Max. number of simultaneous sources connected to the server.
  • max_admins Max. number of simultaneous connected admins. WWW admins are not affected since they are not interactively logged on.
  • logfile This file, icecast.log in /usr/local/icecast/log by default, is the icecast server's main logfile. Everything goes in here, so it might grow quite big. Also, when you restart the server, it will not truncate this file. So it might be a good idea to empty the file before each run of icecast. If it grows way to big, and you want to truncate it yourself, without restarting icecast, then you have to send icecast the SIGHUP signal so that it reopens the logfile. This means you can use common logrotating programs.
  • hostname You are probably better of leaving this setting alone. If NOT set, this will make icecast listen on all available interfaces (i.e all IPs), but if you set it to a hostname or IP adress, then icecast will only listen on that IP adress. This is nice for people with 2 ips who want to run one icecast server on each. If you specify an invalid IP, then nothing will work.
  • server_name This is perhaps the most important setting in icecast.conf. It's the name of the server. It SHOULD be set to an ip, or preferably a hostname that points to your ip. If not, then lots and lots of stuff will not work and it might even break your server. For instance, my ip is 130.236.235.105, which is d105.ryd.student.liu.se, so I set the server_name to d105.ryd.student.liu.se. See also the force_servername setting. When using aliases and in some cases multiple mountpoints, client have to request streams from this servername, otherwize they will not get the correct stream. For those of you familiar with virtual hosts in webservers, this is something similar :)
  • console_mode This sets how the icecast server is started, and what the tty you started icecast in will be used for. 0 means use it as a admin console (you can send commands to the icecast server) with logfile info. 1 is the same as 0 but without logfile info. 2 means just use it as a logfile window. 3 means put the icecast server in the background, as a daemon process. All console modes are not available on all platforms.
  • client_timeout This setting regulates how long (in seconds) to keep clients connected to the server after their source has disconnected. Or, in other words, how long to wait for a source to come back to its old listeners.
  • stats_log The icecast server dumps statistics to a file on a regular basis. See the section about statistics below. This sets what file is used for statistics.
  • statshtml_log This works just like stats_log, but the statistics are html-formatted, using the statistics.html template.
  • stats_time This setting, in seconds, sets how often the statistics files get updated.
  • max_clients_per_source The maximum number of simultaneous clients connected to the same stream on the server. Setting this to a value larger than max_clients does not make any sense.
  • reverse_lookups When this is set to 1, icecast will try to reverse all ips to hostnames. This might take some time and consume some extra cpu, but it will make logfiles and all other output look much nicer. Setting this to 0 will turn the reverse lookups off.
  • location This should be set to the geographic location of the icecast server. It's just for show, and doesn't really matter. But it's still a nice way for listeners to know where in the world the server is located. No syntactic controls apply, but if you want to follow the standard, use 'STATE, COUNTRY', or 'CITY, COUNTRY'.
  • rp_email This should be set to the email adress of the admin running the server.
  • transparent_proxy This should be set to 0 unless you really really know what you are doing. Setting it to 1 will make the icecast server act as a proxy. See the section about proxies below.
  • acl_policy This regulates whether connections are allowed or denied if no acl rule exists that affects them. See the section about Access Control below. Setting it to 0 will deny all these connections, and 1 will allow them.
  • throttle Specified in Megabytes per second. How much bandwidth the server is allowed to use up before client and source access is denied. Use this with caution since the internal bandwidth measurement is not an exact science.
  • kick_relays When a remote source is mounted into the icecast server on a remote alias request, it will only keep the source connected while there is still someone listening. When all listeners has disconnected, it will keep the source for kick_relays seconds, and then kick it out. This saves a lot of bandwidth.
  • kick_clients This regulates what happens to the clients when the client_timeout has expired. It only has an effect if client_timeout is more than 0. If you set kick_clients to 1, then they will get kicked off the server, but if you set it to 0, they will be moved to another stream, if there is one.
  • status_time This setting regulates how often status information is printed on the admin console.
  • staticdir If you don't want to go through the hassle of setting up a http server as a means of putting your mp3 files up for public download, then there is limited support for this in icecast. See the section about Static files below. This sets what directory on disk will be the root for http://your.server.com:port/file/
  • logfiledebuglevel This setting regulates what level of debugging output is written to the logfile. A higher value means more debugging output. 0 means no debugging output, 1 and 2 is pretty ok, 3 and 4 will spam it will shitload of stuff :). 6 is the current maximum.
  • consoledebuglevel This is the same as logfiledebuglevel, but regulates the output on the icecast console
  • server_url This should be set to a URL describing this icecast server.
  • use_meta_data This will enable title streaming the way shoutcast does it. This is old, stupid and will probably mess up your stream. Turn this off unless you really want it.
  • streamurl If the sources don't set a url for the stream, then this variable is the default url for titlestreaming.
  • streamurllock If you don't want the sources to be able to change the url of their streams, set this to 1.
  • streamtitletemplate This is a template for the stream title that is sent to the clients who support it, and to the directory servers. One occurence of "%s" will be replaced with the filename of the current song.
  • nametemplate This is a template for the name of each stream, as presented to the directory servers and clients. One occurence of "%s" will be replaced with the actual name of the stream.
  • desctemplate desctemplate is a template for the description string for each stream. One occurence of "%s" will be replaced with the actual description of the stream.
  • accessfile This file logs all the client connections to the server and should be parsable with any common logfile parser. It uses the same format as apache and other webservers.
  • usagefile This file is periodically updated with server usage information.
  • default_source_options This string is the default options for the 'sources' command.
  • mount_fallback Normally users who request a stream that is not found, they will get the default stream instead. When this is set to 0 they will get a HTTP 404 Stream Not Found instead.
  • force_servername The directory server will use the originating ip of the icecast server unless this is set to 1. If set to 1, this will make the directory server use the server_name variable instead. This is useful for people behind transparent proxies.
  • logdir This is the directory wherein logfiles are kept.
  • templatedir This is the directory where icecast looks for templates for the WWW admin and generation of stats.html.
  • resolv_type This variable regulates what kind of resolving functions icecast uses. Setting it to 1 means it will use linux reentrant interface (gethostbyname_r()), 2 means solaris reentrant interface, and 3 is the standard nonreentrant interface.
  • http_admin This setting regulates whether to allow access to the WWW interface at all. 1 means yes, 0 means no.
  • relay_reconnect_max This variable regulates how many times icecast will try to reconnect a relay. -1 means infinite times.
  • relay_reconnect_time This regulates how many seconds to wait between relay reconnect tries.
  • sleep_ratio This is a float variable that regulates how long a source thread in the server sleep between reading from the encoder. Setting it to a very low value will make the system use a little more cpu, and it might behave a little flaky with few listeners. Setting it to a very high value will probably make the audio very choppy. I.e few listeners, use a larger value, and with lots of listeners, use a smaller value. Anything larger than 1.0 and smaller than 0.0 is just pointless. Also, a fast cpu will be able to use a higher value than a slow cpu.
  • directory The syntax is 'directory directory.host.domain:port/path/to/icedir/program', or 'directory directory.host.domain:port', or 'directory directory.host.domain'. If not specified, the default port is 80, and the default icedir program is '/cgi-bin/xaudiocast-touch' Please note that this is the syntax for xaudiocast directory server. Some old directory servers use the old icy headers. If you want that, use the icydir command.
  • icydir This adds a icy directory server (such as yp.shoutcast.com). The syntax is simply 'icydir directory.host.domain'.
  • port This is the port the icecast server uses for all connections. Admins, clients, and sources, they all connect to this port. The old behavior, having the clients on 8000 and the encoder on 8001, is too ugly and creates some problems with firewalls and so. The new behavior might confuse streamers such as winamp. WinAMP is stupid enough to connect to the specified port + 1. So if you set the port (in WinAMP) to 8000, it will connect to 8001. Setting it to 7999 will work though. You can now use multiple ports, just add another port line. port 8000 port 8001 The above will make icecast listen on 8000 and 8001.
  • alias Aliases can be used for 2 things. One is for a very flexible and powerful way of relaying streams on other icecast or shoutcast servers. See the section about Relaying below. The other is for having 2 mountpoints on the server refer to the same source. 'alias /cool /funkyassdancemusic' would add an alias named /cool which refers to the /funkyassdancemusic stream. It doesn't matter if no stream is actually mounted there now.
  • allow This adds a hostmask for a specific type connection, which will be allowed access. Syntax is 'allow [type] [hostmask]'. See the section below on Access Control.
  • deny This adds a hostmask for a specifi type connection, which will be refused access. Syntax is 'deny [type] [hostmask]'.
  • relay This works just like the relay pull command. Icecast will connect this relay at boot time, and reconnect it if it disconnects.
  • include This will parse another configfile. Ex: include /etc/defaulticecast.conf