SHOUTcast on SME Server HOWTO

Tested on SME Server 6.0.1-01, 6.5RC1, and 7.0 Final. May work on other versions. If this could be verified, it would be appreciated.

FILES NEEDED:

SHOUTcast server – obtained from http://www.shoutcast.com
shoutcast.sh – SHOUTcast control script. Obtained from here.
45AllowShoutcast – Custom template fragment. Obtained from here.


For SME in Server/Gateway Mode

  1. Setup an ibay called 'shoutcast' on the server. This will make downloading and configuration a little easier.
  2. Download the files from the list above.

    • You’ll want the “SHOUTcast Linux server (glibc) v1.9.5”, or the latest version using your browser of choice.
    • Once downloaded, unzip it into the shoutcast ibay.
    • Download the 45AllowShoutcast custom template fragment, and copy it into the shoutcast ibay.
    • Download the shoutcast.sh control script, and copy it into the shoutcast ibay.
  3. Log into the console as root and change directories to the shoutcast ibay.

    [yourserver]# cd /home/e-smith/files/ibays/shoutcast/files

  4. Copy or move the file “sc_serv” to the /usr/sbin directory, and change it's permissions to make it executable.

    [yourserver]# mv sc_serv /usr/sbin
    [yourserver]# chmod 755 /usr/sbin/sc_serv

  5. Create the directory /etc/shoutcast

    [yourserver]# mkdir /etc/shoutcast

  6. Copy or move the sc_serv.conf file to the /etc/shoutcast directory. To run multiple streams on the server, simply make additional copies of the .conf file in the /etc/shoutcast directory. Be sure to edit the .conf files to change the listening/broadcasting ports with pico or vi.

    [yourserver]# mv sc_serv.conf /etc/shoutcast

  7. Copy or move the shoutcast.sh file into the /etc/rc.d/init.d directory, and chmod it for execution.

    [yourserver]# mv shoutcast.sh /etc/rc.d/init.d/shoutcast
    [yourserver]# chmod 755 /etc/rc.d/init.d/shoutcast

  8. Change to the /etc/rc.d/init.d directory, and add shoutcast to the service list.

    [yourserver]# cd /etc/rc.d/init.d
    [yourserver]# chkconfig --add shoutcast

  9. Now start the shoutcast service, and the server is listening for a source stream for the internal network.

    [yourserver]# service shoutcast start

  10. Nothing else will need to be done if you want the SHOUTcast server for clients on your local network. Stop here. If you want external (Internet access), continue to the next step for #SME6x or #SME7.

To allow external access on SME6x, you need to open up the firewall.

  1. Create the /etc/e-smith/templates-custom/etc/rc.d/init.d/masq directory.

    [yourserver]# mkdir /etc/e-smith/templates-custom/etc/rc.d/init.d/masq

  2. Go into the init.d directory, and copy or move the 45AllowShoutcast file there. This file will open up ports 8000 and 8001 (the default SHOUTcast ports) on the external interface. If you are using non-standard ports, or want additional ports open, you will need to edit this file appropriately using pico or vi.

    [yourserver]# cd /etc/e-smith/templates-custom/etc/rc.d/init.d/masq
    [yourserver]# mv /home/e-smith/files/ibays/shoutcast/files/45AllowShoutcast ./

  3. Now you need to make a setting in the SME configuration database to make this fragment work.

    [yourserver]# sbin/e-smith/config set shoutcast service status enabled access public

  4. Next expand the template and reboot. Note: The reboot isn't totally necessary, but I'm not exactly sure which service to restart, so...(shrug).

    [yourserver]# /sbin/e-smith/expand-template /etc/rc.d/init.d/masq
    [yourserver]# /sbin/e-smith/signal-event reboot

  5. Your SHOUTcast server is now operational. When you login to the console and start the service, it will now be available to anyone internally or externally.

To open the firewall on SME7 is even easier.

  1. Open up the two ports you will need by entering these two lines into the command prompt. WARNING: Watch the capitalization on these commands!

    [yourserver]# config set shoutcast1 service access public status enabled TCPPort 8000
    [yourserver]# config set shoutcast2 service access public status enabled TCPPort 8001

  2. To add additional ports for additional servers, simply continue on with shoutcast3, shoutcast4, etc. If anyone knows a better way to do this, either let me know, or edit the page accordingly.
  3. Next, run update the remote access templates by applying this command.

    [yourserver]# signal-event remoteaccess-update

  4. The Shoutcast server should now be operational on your SME7 server. When you login to the console and start the service, it will now be available to anyone internally or externally.

For SME in Server Only Mode

  1. Perform steps 1 through 9 in the Server/Gateway instructions above.
  2. Now you must configure your internet firewall or router to forward ports 8000 and 8001 (or whatever ports you set in sc_serv.conf) to your SME server. If you don't know how to forward ports on your internet firewall or router, read your firewall or router manufacturer's instructions. This has been tested using a SME 6.5 setup through an IPCop firewall, and seems to work great.

To make SHOUTcast start up automatically when SME reboots

  1. Login to the console as root, and change to the /etc/rc.d/rc7.d directory

    [yourserver]# cd /etc/rc.d/rc7.d

  2. Now add a symbolic link to the shoutcast service.

    [yourserver]# ln -s /etc/rc.d/init.d/shoutcast S92shoutcast

  3. This will put SHOUTcast in runlevel 7 (the boot sequence). Be very careful here. Delete a link, and your server won't boot properly! Congratulations! You're done!

NOTES


Acknowledgements and Contributors

Thanks to Enki for the shoutcast service script.

And special thanks to Charlie Brady for helping me with the custom template problem!