<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Johan Känngård &#187; Shoutcast</title>
	<atom:link href="http://johankanngard.net/tag/shoutcast/feed/" rel="self" type="application/rss+xml" />
	<link>http://johankanngard.net</link>
	<description>Useful tips for developers</description>
	<lastBuildDate>Fri, 06 Aug 2010 13:49:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HOWTO Restart shoutcast if inbound stream is lost</title>
		<link>http://johankanngard.net/2008/10/21/howto-restart-shoutcast-if-inbound-stream-is-lost/</link>
		<comments>http://johankanngard.net/2008/10/21/howto-restart-shoutcast-if-inbound-stream-is-lost/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 14:31:58 +0000</pubDate>
		<dc:creator>Johan Känngård</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Shoutcast]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://johankanngard.net/?p=325</guid>
		<description><![CDATA[This is a simple way to get Shoutcast restarted (tested in Ubuntu 8.04) if the inbound stream is lost. You need Lynx installed for this to work, there might be better ways of achieving the same result though. To install Lynx: $ sudo apt-get install lynx Put in file shoutcast_supervisor.sh in /usr/bin: #!/bin/bash ONLINE=$(lynx -dump [...]]]></description>
			<content:encoded><![CDATA[<p>
This is a simple way to get Shoutcast restarted (tested in Ubuntu 8.04) if the inbound stream is lost. You need Lynx installed for this to work, there might be better ways of achieving the same result though. To install Lynx:
</p>
<p><code><br />
$ sudo apt-get install lynx<br />
</code><br />
Put in file shoutcast_supervisor.sh in /usr/bin:<br />
<code><br />
#!/bin/bash<br />
ONLINE=$(lynx -dump localhost:8000 | grep "Stream is up" | wc -l)<br />
if [ "$ONLINE" -eq "0" ]<br />
then<br />
    logger -i Inbound connection not found. Restarting Shoutcast.<br />
    /etc/init.d/shoutcast restart<br />
fi<br />
</code><br />
Change ownership, group and execution:<br />
<code><br />
$ sudo chown root /usr/bin/shoutcast_supervisor.sh<br />
$ sudo chgrp root /usr/bin/shoutcast_supervisor.sh<br />
$ sudo chmod +x /usr/bin/shoutcast_supervisor.sh<br />
</code><br />
Add the script to cron.d your preferred way, I do it in /etc/cron.d in a file name shoutcast_supervisor:<br />
<code><br />
0 * * * * root /usr/bin/shoutcast_supervisor.sh<br />
15 * * * * root /usr/bin/shoutcast_supervisor.sh<br />
30 * * * * root /usr/bin/shoutcast_supervisor.sh<br />
45 * * * * root /usr/bin/shoutcast_supervisor.sh<br />
</code><br />
Restart cron:<br />
<code><br />
$ sudo /etc/init.d/cron restart<br />
</code><br />
&#8230;and the script is run every 15 minutes and will restart the Shoutcast daemon if the inbound connection was lost. Change the interval if you need to check more often. Sometimes this solves connection problems. Check the syslog for any message that the daemon was restarted, like:<br />
<code><br />
$ tail /var/log/syslog<br />
</code><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://johankanngard.net/2008/10/21/howto-restart-shoutcast-if-inbound-stream-is-lost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Install Shoutcast 1.9.8 on Ubuntu 8.0.4</title>
		<link>http://johankanngard.net/2008/07/22/howto-install-shoutcast-on-ubuntu-804/</link>
		<comments>http://johankanngard.net/2008/07/22/howto-install-shoutcast-on-ubuntu-804/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 13:31:21 +0000</pubDate>
		<dc:creator>Johan Känngård</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Shoutcast]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Winamp]]></category>

		<guid isPermaLink="false">http://johankanngard.net/?p=218</guid>
		<description><![CDATA[If you want to stream your own radio station, Shoutcast is an easy solution. This little HOWTO focus only on the server part, and not on the actual audio/feeding client part. I recommend reading ShoutCast Streaming for beginners and Streaming radio with ShoutCast and WinAmp to get the hang of the audio part. Install Download [...]]]></description>
			<content:encoded><![CDATA[<p>
If you want to stream your own radio station, <a href="http://www.shoutcast.com">Shoutcast</a> is an easy solution. This little HOWTO focus only on the server part, and not on the actual audio/feeding client part. I recommend reading <a href="http://www.drs2006.com/manuals/faq/serverfaq2.html">ShoutCast Streaming for beginners</a> and <a href="http://www.andymoore.info/streaming-radio-with-shoutcast-and-winamp/">Streaming radio with ShoutCast and WinAmp</a> to get the hang of the audio part.
</p>
<h2>Install</h2>
<p>Download the tarball from <a href="http://www.shoutcast.com/download/serve.phtml">shoutcast.com</a>.</p>
<p><code><br />
$ tar -xvf sc_serv_1.9.8_Linux.tar.gz<br />
$ sudo cp sc_serv_1.9.8_Linux/sc_serv /usr/sbin<br />
$ sudo mkdir /etc/shoutcast<br />
$ sudo cp sc_serv.conf /etc/shoutcast<br />
</code></p>
<h2>Automatic start</h2>
<p>This will make shoutcast start when the server starts. Download the <a href="http://johankanngard.net/wp-content/uploads/2008/07/shoutcast">initscript</a> (which I have modified to work in Ubuntu 8.04, source script <a href="http://enki.cthuugle.com/archives/000015.php">here</a>).</p>
<p><code><br />
$ sudo cp shoutcast /etc/init.d/shoutcast<br />
$ sudo update-rc.d /etc/init.d/shoutcast defaults<br />
</code></p>
<h2>Check settings</h2>
<p>
The default sc_serv.conf says logging should go to the current directory. I changed the lines:<br />
<code><br />
LogFile=sc_serv.log<br />
...<br />
W3CLog=sc_w3c.log<br />
</code><br />
into:<br />
<code><br />
LogFile=/var/log/sc_serv.log<br />
...<br />
W3CLog=/var/log/sc_w3c.log<br />
</code><br />
Also, make sure you set a password on the line saying:<br />
<code><br />
Password=changeme<br />
</code>
</p>
<h2>Firewall</h2>
<p>
If you have a locally installed firewall, you have to open up two ports. First the port mentioned in sc_serv.conf on the line saying:<br />
<code><br />
PortBase=8000<br />
</code><br />
The second is the PortBase + 1, i.e. in the default example above it is 8001. The 8001 port is used to receive data from Winamp or other audio streaming feeder and the 8000 port is used to send streaming audio to listening clients. Make sure both ports are open for TCP and UDP. And don&#8217;t forget any hardware firewalls, they have to be opened too.
</p>
<h2>Restart</h2>
<p>
Restart the server or do:<br />
<code><br />
$ sudo /etc/init.d/shoutcast start<br />
</code><br />
and try opening localhost:8000 in your browser and you should see the (in-)famous Shoutcast page.</p>
]]></content:encoded>
			<wfw:commentRss>http://johankanngard.net/2008/07/22/howto-install-shoutcast-on-ubuntu-804/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
