This tutorial will assist you to install SHOUTcast Distributed Network Audio Server (DNAS 2.0) in CentOS 7 VPS. Once SHOUTcast is installed in server, you can use media players like Winamp or Mixxx to connect to a streaming server and broadcast audio playlists to the Internet. This tutorial can be applied to other Linux distributions such as RHEL, Fedora, Ubuntu, Debian, Linux Mint with appropriate changes in commands according to Linux distribution you choose.
- First, we will create local user in VPS to run DNAS server since it is not recommended to run DNAS server from root account due to security reasons. Login to your VPS through SSH and create new user with your desired name. We have created username radio-user to install the server. Once you create this user, logout from root user and login with newly created user. Execute the following commands for the same.
$ su – $ adduser radio-user $ passwd radio-user $ exit $ su – radio-user $ pwd
- At radio-user account, create two directories of your desired name. We have created two directories namely, radioserver (Installation) and SHOUTcast (Download). Once these directories are created switch to SHOUTcast (Download) directory. To perform these operations, execute following commands.
$ mkdir SHOUTcast $ mkdir radioserver $ cd SHOUTcast
- Download the latest version of SHOUTcast server archive according to your OS architecture from official Nullsot Download page. To download archive files, we will use wget utility. Following are the exact commands you will have to fire.
— To Download SHOUTcast server archive For 32-bit OS— $ wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_09_09_2014.tar.gz —To Download SHOUTcast server archive For 64-bit OS— $ wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_x64_09_09_2014.tar.gz
- Once download of SHOUTcast server archive completes, extract the downloaded zip file (sc_serv2_linux_architecture_date.tar.gz) archive and list all its files. Locate sc_serv executable binary file and copy it to the installation directory(radioserver), then switch to the radioserver directory. Following are the commands to perform these actions.
$ tar xfz sc_serv2_linux_x64_09_09_2014.tar.gz $ ls $ cp sc_serv ../radioserver/ $ cd ../radioserver/ $ ls
- Now, at server installation path (radioserver), create two directories named control and logs. Here are the commands.
$ mkdir control $ mkdir logs $ ls
Now, we will create configuration file for SHOUTcast server to run and operate it. Create a new file named sc_serv.conf and edit it with the text editor of your choice. Add following statements to this file (sample configuration file). There are some important settings you should change here such as password statements.
- adminpassword – admin password to perform remote administration via the web interface.
- streampassword_1 – password required by remote media player to connect and stream media content to server.
$ nano sc_serv.conf ……..OR $ vi sc_serv.conf —Add following statements to sc_serv.conf file (This is sample configuration file)— adminpassword=remote-admin-password password=remote-media-player-password requirestreamconfigs=1 streamadminpassword_1=password2 streamid_1=1 streampassword_1=password3 streampath_1=http://radio-server.lan:8000 logfile=logs/sc_serv.log w3clog=logs/sc_w3c.log banfile=control/sc_serv.ban ripfile=control/sc_serv.rip
- As an alternative, you can also configure the server through web interface by creating configuration file. Just go to SHOUTcast directory and run builder.sh or setup.sh scripts. This will let you configure the server through your web browser at URL ….http://your-IP-address:8000 OR http://your-IP-address:8000. As such created configuration file should be copied to the installation directory (radioserver).
- In order to start the server execute sc_serv file from radioserver directory. We want to execute this in background so we will use & bash operator as shown below. Now SHOUTcast server is up and running.
- Once SHOUTcast server is started, you can access its web interface in browser. Type your server IP Address on port 8000 and SHOUTcast server web interface should appear as shown below with no live streams available.
- To run the SHOUTcast server as a daemon use daemon command as follows.
$ ./sc_serv ## It will start the server in foreground. Hit Ctrl + c to stop. $ ./sc_serv daemon ## It will start server as a daemon. $ ps aux | grep sc_serv ## It will get server PID. $ killall sc_serv ## It will stop server daemon.
- To start or stop SHOUTcast radio server with simplified commmands, we need to create executable script (namely radio) through root user at /usr/local/bin/ as shown below. Once this file is created, we will make it executable.
—Login as root and create file executable script radio— $ su – # nano /usr/local/bin/radio —Add following code to radio file and save it— #!/bin/bash case $1 in start) cd /home/radio/server/ ./sc_serv & ;; stop) killall sc_serv ;; start_daemon) cd /home/radio/server/ ./sc_serv daemon ;; *) echo “Usage radio start|stop” ;; esac —Make the file executable and exit from the root account— $ chmod +x /usr/local/bin/radio $ exit
- Now, you can use following commands to SHOUTcast manage the server.
$ radio start_daemon ## It will start SHOUTcast server as a daemon. $ radio start ## It will start SHOUTcast server in foreground. $ radio stop ## It will stop SHOUTcast server.
- Your SHOUTcast server is ready to receive sound or playlists through remote media players and broadcast received audio content over the Internet. You can use remote media players like Winamp for Windows and Mixxx for Linux OS.
Source: V. CHUKWUKA