<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - Install SHOUTcast</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>Install SHOUTcast</h1>
</div>
<div id="content">



<div class="wikitext"><h2>SHOUTcast on SME Server HOWTO</h2>
<p class="tightenable">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.</p>
<h3>FILES NEEDED:</h3>
<p class="tightenable top"><b>SHOUTcast server</b> – obtained from <a href="http://www.shoutcast.com" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://www.shoutcast.com</span></a><br />
<b>shoutcast.sh</b> – SHOUTcast control script.  Obtained from <a href="http://www.ninetails.net/smefiles/shoutcast.sh" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />here</span></a>.<br />
<b>45AllowShoutcast</b> – Custom template fragment.  Obtained from <a href="http://www.ninetails.net/smefiles/45AllowShoutcast" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />here</span></a>.<br /></p>
<hr />
<h3>For SME in Server/Gateway Mode</h3>
<ol><li class="tightenable">Setup an ibay called 'shoutcast' on the server.  This will make downloading and configuration a little easier.</li>
<li class="tightenable"><p class="tightenable top bottom">Download the files from the list above.</p>
<ul><li class="tightenable top bottom">You’ll want the “SHOUTcast Linux server (glibc) v1.9.5”, or the latest version using your browser of choice.</li>
<li class="tightenable top bottom">Once downloaded, unzip it into the shoutcast ibay.</li>
<li class="tightenable top bottom">Download the 45AllowShoutcast custom template fragment, and copy it into the shoutcast ibay.</li>
<li class="tightenable top bottom">Download the shoutcast.sh control script, and copy it into the shoutcast ibay.</li>
</ul>
</li>
<li class="tightenable"><p class="tightenable top">Log into the console as root and change directories to the shoutcast ibay.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# cd /home/e-smith/files/ibays/shoutcast/files</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Copy or move the file “sc_serv” to the /usr/sbin directory, and change it's permissions to make it executable.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# mv sc_serv /usr/sbin<br />
[yourserver]# chmod 755 /usr/sbin/sc_serv</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Create the directory /etc/shoutcast</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# mkdir /etc/shoutcast</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">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.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# mv sc_serv.conf /etc/shoutcast</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Copy or move the shoutcast.sh file into the /etc/rc.d/init.d directory, and chmod it for execution.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# mv shoutcast.sh /etc/rc.d/init.d/shoutcast<br />
[yourserver]# chmod 755 /etc/rc.d/init.d/shoutcast</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Change to the /etc/rc.d/init.d directory, and add shoutcast to the service list.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# cd /etc/rc.d/init.d<br />
[yourserver]# chkconfig --add shoutcast</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Now start the shoutcast service, and the server is listening for a source stream for the internal network.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# service shoutcast start</tt></p>
</blockquote>
</li>
<li class="tightenable">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 <a href="InstallSHOUTcast.html#SME6x" class="named-wiki" title="">#SME6x</a> or <a href="InstallSHOUTcast.html#SME7" class="named-wiki" title="">#SME7</a>.</li>
</ol>
<h4>To allow external access on <a name="SME6x" id="SME6x">SME6x</a>, you need to open up the firewall.</h4>
<ol><li class="tightenable top"><p class="tightenable top">Create the /etc/e-smith/templates-custom/etc/rc.d/init.d/masq directory.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# mkdir /etc/e-smith/templates-custom/etc/rc.d/init.d/masq</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">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.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# cd /etc/e-smith/templates-custom/etc/rc.d/init.d/masq<br />
[yourserver]# mv /home/e-smith/files/ibays/shoutcast/files/45AllowShoutcast ./</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Now you need to make a setting in the SME configuration database to make this fragment work.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# sbin/e-smith/config set shoutcast service status enabled access public</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">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).</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# /sbin/e-smith/expand-template /etc/rc.d/init.d/masq<br />
[yourserver]# /sbin/e-smith/signal-event reboot</tt></p>
</blockquote>
</li>
<li class="tightenable">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.</li>
</ol>
<h4>To open the firewall on <a name="SME7" id="SME7">SME7</a> is even easier.</h4>
<ol><li class="tightenable top"><p class="tightenable top">Open up the two ports you will need by entering these two lines into the command prompt. <b>WARNING: Watch the capitalization on these commands!</b></p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# config set shoutcast1 service access public status enabled TCPPort 8000<br />
[yourserver]# config set shoutcast2 service access public status enabled TCPPort 8001</tt></p>
</blockquote>
</li>
<li class="tightenable">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.</li>
<li class="tightenable"><p class="tightenable top">Next, run update the remote access templates by applying this command.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# signal-event remoteaccess-update</tt></p>
</blockquote>
</li>
<li class="tightenable">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.</li>
</ol>
<hr />
<h3>For SME in Server Only Mode</h3>
<ol><li class="tightenable">Perform steps 1 through 9 in the Server/Gateway instructions above.</li>
<li class="tightenable">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.</li>
</ol>
<hr />
<h3>To make SHOUTcast start up automatically when SME reboots</h3>
<ol><li class="tightenable"><p class="tightenable top">Login to the console as root, and change to the /etc/rc.d/rc7.d directory</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# cd /etc/rc.d/rc7.d</tt></p>
</blockquote>
</li>
<li class="tightenable"><p class="tightenable top">Now add a symbolic link to the shoutcast service.</p>
<blockquote class="tightenable bottom"><p class="tightenable top bottom"><tt>[yourserver]# ln -s /etc/rc.d/init.d/shoutcast S92shoutcast</tt></p>
</blockquote>
</li>
<li class="tightenable">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!</li>
</ol>
<hr />
<h3>NOTES</h3>
<ul><li class="tightenable bottom">The reason I created an ibay is so that the content and logs directories could be created there, and SHOUTcast logs and contents could be checked and updated easily.  It's not necessary, just convenient.  If you don't want to use it afterwards, by all means delete the ibay.<br /></li>
<li class="tightenable top">If you get an error such as &quot;bad interpreter, no such file or directory&quot; when you try to run the shoutcast startup script (shoutcast.sh), it might mean that you've attempted to edit the file using a windows editor.  Try opening the file with pico, then writing it back out without any changes.  That will usually fix the problem.</li>
</ul>
<hr />
<h3>Acknowledgements and Contributors</h3>
<h4>Thanks to Enki for the shoutcast service script.</h4>
<h4>And special thanks to Charlie Brady for helping me with the custom template problem!</h4>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;gelcube&quot;  Last edited on August 1, 2006  4:02 pm by &quot;gelcube&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
