How to Install A SHOUTcast DNAS Server on Linux

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

SHOUTcast is software designed for streaming media over the internet. The SHOUTcast system uses a classic client-server configuration. You can install SHOUTcast on your server and use it to broadcast a stream of music to clients connected to the server. A Shoutcast media server could benefit from large amounts of disk space, so consider using our Block Storage service with this setup.

Note
Be sure to check the broadcast tools download page for the newest version of SHOUTcast.

SHOUTcast DNAS Software

The SHOUTcast DNAS (Distributed Network Audio Server) software is the server version of the software that allows you to broadcast to listeners. To use SHOUTcast, you’ll need to download and install SHOUTcast DNAS on your Linode.

Download and Install SHOUTcast

There are several versions of this software, so make sure you are downloading the correct one. The Linux version is offered in both 32-bit and 64-bit versions. You’ll need to download whichever version corresponds to the operating system you have installed on your Linode.

  1. Create a user for running SHOUTcast, so you are not running it as root. Enter the following command:

    adduser shoutcast
    
  2. Change to the new user’s home directory by entering the following command:

    cd /home/shoutcast
    
  3. Create a directory for SHOUTcast:

    mkdir sc
    
  4. Now we can download the DNAS package. In this example, we will download the 32-bit version:

    wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_x64-latest.tar.gz
    
  5. Extract the SHOUTcast files to the new directory by entering the following command:

    tar -xzf sc_serv2_linux_x64-latest.tar.gz -C sc
    
  6. Change the ownership from root to the SHOUTcast user:

    chown -R shoutcast.shoutcast /home/shoutcast/sc
    

The SHOUTcast DNAS software is now installed on your Linode.

Configure SHOUTcast

Now, you’ll want to modify the configuration. This is necessary to specify passwords and set the SHOUTcast port. Here’s how to configure SHOUTcast:

  1. Open the SHOUTcast configuration file:

    nano sc/sc_serv_basic.conf
    
  2. This will bring up the configuration file for editing, as shown below.

    File: /home/shoutcast/sc/sc_serv_basic.conf
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    
    ; NOTE: for any relative paths specified are relative to
    ; sc_serv and not to where the conf file is being stored
    
    ; here we will setup where the log and other related files
    ; will be stored. make sure that these folders exist else
    ; sc_serv will throw an error and will close itself down.
    ; we will make the logs save to the sc_serv2 directory
    logfile=logs/sc_serv.log
    w3clog=logs/sc_w3c.log
    banfile=control/sc_serv.ban
    ripfile=control/sc_serv.rip
    
    
    ; for testing we will make the server only work locally
    ; (i.e. localhost / 127.0.0.1) though if this is left out
    ; or set to publicserver=always then we attempt to make a
    ; connection to the YP for listing - do not forget to add
    ; in a 'streamauthhash' value for any public streams made
    ;publicserver=never
    
    
    ; if you're wanting to use a different port to use for any
    ; connections then you can use this option e.g. to use 80
    ; otherwise port 8000 is used as the default to listen on.
    ;portbase=80
    
    
    ; password used by sc_trans or the Winamp dsp plug-in
    ; NOTE: remember to change this to something else
    password=testing
    
    
    ; password used for accessing the administration pages
    ; NOTE: remember to change this to something else
    adminpassword=changeme
    
    
    ; now we will specify the details of the stream we're going
    ; to serve which can be done as follows
    streamid=1
    streampath=/test.aac
    
    ; or
    
    ; it can be done like this which is how it needs to be done
    ; if you are going to provide multiple streams from sc_serv
    ;streamid_1=1
    ;streampath_1=/test.aac
    ;streamid_2=2
    ;streampath_2=/test2.aac
  3. Set the password and adminpassword variables to whatever you want them to be.

  4. The portbase variable should be set to use a port you are not using for anything else. The default port for SHOUTcast is 8000.

    Note
    If you set the portbase variable to anything besides 8000, be sure to uncomment it by deleting the semicolon in front of the variable.
  5. Save the changes to the SHOUTcast configuration file by pressing Control-X, and then Y.

Now that the configuration is set and saved, we can start the server.

Start SHOUTcast

Now, you can start the SHOUTcast server. Here’s how:

  1. You’ll want to run your shoutcast in a screen session. Let’s jump into a screen session by entering the following command:

    screen
    
  2. Start the SHOUTcast server by entering the following command:

    ./sc_serv sc_serv_simple.conf
    
  3. After you issue the start command, you should see the startup output ending with:

    2011-11-02 14:50:03     I       msg:[MICROSERVER] Listening for connection on port 8000
    2011-11-02 14:50:03     I       msg:[MICROSERVER] Listening for connection on port 8001
    
  4. You can detach from your screen session at this point. To do so, hold down the Control key and press A, let go, and then press D.

  5. You should be back at the command prompt outside of your screen session. If you need to reattach later on, simply type:

    screen -raAd
    

Your SHOUTcast server is now running! You can now connect to it and begin your broadcast.

SHOUTcast Transcoder

The SHOUTcast Transcoder allows you to schedule DJ play times, broadcast an automatic playlist in a specific time slot, schedule time slots for relayed broadcasts, etc.

Note
To encode your streams in MP3 format, you must purchase a license key from WinAmp, which costs $5 USD.

Download and Install SHOUTcast Transcoder

We’ll use the same shoutcast user to set up the Transcoder software. Here’s how to download and install the transcoder:

  1. Change directories by entering the following command:

    cd /home/shoutcast
    
  2. Create a new directory for the transcoder by entering the following command:

    mkdir sct
    
  3. Download the SHOUTcast transcoder archive by entering the following command:

    wget http://download.nullsoft.com/shoutcast/tools/sc_trans_linux_10_07_2011.tar.gz
    
  4. Extract the SHOUTcast transcoder files by entering the following command:

    tar -xzf sc_trans_linux_10_07_2011.tar.gz -C sct
    
  5. Change ownership from root to the SHOUTcast user:

    chown -R shoutcast.shoutcast /home/shoutcast/sct
    
  6. Change directories by entering the following command:

    cd sct
    
  7. Change permissions by entering the following command:

    chmod a+x sc_trans
    

The SHOUTcast transcoder is now installed on your Linode.

Configure the SHOUTcast Transcoder

This example will walk you through a basic configuration.

  1. Open the configuration file by entering the following command:

    nano /home/shoutcast/sct/sc_trans_basic.conf
    
  2. You can modify the bitrate to change the sound quality of the music and limit the amount of bandwidth consumed. If you purchase MP3 licensing, you can modify the encoder section to add the MP3 encoding and your unlock data:

    File: /home/shoutcast/sct/sc_trans_basic.conf
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    
    ; for testing we will only setup a single encoder though it
    ; is easy to add in additional encoder configurations and
    ; we are using an aac plus encoder as the default due to
    ; the licensing requirements for mp3 encoding as detailed
    ; in sc_trans.txt - section 2.5).
    encoder_1=aacp
    encoder_2=mp3
    bitrate_1=56000
    bitrate_2=56000
    
    unlockkeyname=YourUnlockName
    unlockkeycode=YourUnlockCode
  3. Next, modify the sc_trans to sc_serv connection details:

    File: /home/shoutcast/sct/sc_trans_basic.conf
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    
    ; this is where we define the details required for sc_trans
    ; to connect to the sc_serv instance being used where the
    ; details must match those specified in sc_serv_basic.conf
    outprotocol_1=3
    serverip_1=127.0.0.1
    ; default is 8000, if not change to sc_serv's 'portbase'
    serverport_1=8000
    ; this is the same as 'password' in sc_serv_basic.conf
    password_1=testing
    ; this is the same as 'streamid' in sc_serv_basic.conf for
    ; the stream we are acting as the source for
    streamid_1=1
    ; this is a name for the source we're creating and is used
    ; with the AJAX control api or can be left blank to get a
    ; generic name created in the form of 'endpointX' where 'X'
    ; is the index of the created source from sc_trans lists.
    endpointname_1=/Bob
  4. This step is optional, but you can also update your stream information:

    File: /home/shoutcast/sct/sc_trans_basic.conf
    1
    2
    3
    4
    5
    6
    
    ; here you would provide any information to fill in details
    ; provided to clients about the stream. it us up to you what
    ; is entered though do not do anything which will annoy, etc
    streamtitle=My Test Server
    streamurl=http://www.shoutcast.com
    genre=Misc
  5. Set your playlist file for an automated stream:

    File: /home/shoutcast/sct/sc_trans_basic.conf
    1
    2
    3
    
    ; here we specify a playlist to use as the master list from
    ; which to play files from.
    playlistfile=playlists/main.lst
  6. Now set the port, username, and password for the transcoder admin panel access:

    File: /home/shoutcast/sct/sc_trans_basic.conf
    1
    2
    3
    4
    5
    6
    
    ; these options will allow you access the admin interfaces
    ; of sc_trans though also allows the 'testui' example to be
    ; accessed. remember to change the password, etc as needed
    adminport=7999
    adminuser=admin
    adminpassword=goaway
  7. Save the changes to the SHOUTcast configuration file by pressing Control-X, and then Y.

  8. If you are using an automated playlist, upload your music files to the /home/shoutcast/sct/music directory.

  9. If you are using an automated playlist, you’ll also need to create a playlist file. Here is an example:

    File: /home/shoutcast/sct/playlists/playlist.lst
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    
    # This example playlist is used as the main playlist sc_trans will use to pick
    # out the files it will use to create its output for the source we generate.
    #
    # Also remember to use the correct path format for the OS you are using and to
    # ensure that the files you want to play are present in the location you choose
    # e.g.
    ../music/shoutcast.mp3
    #
    # In this example we will just assume that all of the files associated to the
    # playlist are in one folder and all have an mp3 extension though there is no
    # reason why you cannot explicitly specify files to use or to reference a tool.
    # See sc_trans.txt - section 7.1 for more information on how playlists work.
    
    # Remember to change this to reference the files you want to use when trying
    # the sc_trans_playlist.conf example which is best tried with full length files

Start SHOUTcast Transcoder

Once you have the transcoder configured and ready to go, you need to start it. To run the transcoder as a daemon, simply run this command, substituting sc_trans_basic.conf for whatever configuration file you are using:

./sc_trans daemon ./sc_trans_basic.conf

If no errors appear, you should see output similar to the line below, where XXXX is the PID:

sc_trans going daemon with PID [XXXX]

To shut down the transcoder, you’ll just need to issue a kill command:

kill -15 PID

SHOUTcast Source DSP

SHOUTcast’s Source DSP plugin was developed for use with WinAmp version 5.5 and newer. This plugin gives you the ability to use WinAmp as a source for your sc_serv (DNAS) or sc_trans (Transcoder). It will also allow you to capture an audio input from your sound card and its line-in or microphone inputs. You will need a working installation of either the DNAS by itself, or the Transcoder feeding into a DNAS installation, before you can use the DSP WinAmp plugin. The download for the DSP plugin is near the bottom of the broadcast tools page.

Instructions for installation and configuration are located in the WinAmp wiki.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.