<?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>Sohail Riaz, Linux and Open Source Blog &#187; RED5</title>
	<atom:link href="http://www.sohailriaz.com/tag/red5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sohailriaz.com</link>
	<description>Sohail Riaz, Linux and Open Source Blog</description>
	<lastBuildDate>Sat, 17 Jul 2010 07:38:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Install RED5 Server on Centos 5.3</title>
		<link>http://www.sohailriaz.com/how-to-install-red5-server-on-centos-53/</link>
		<comments>http://www.sohailriaz.com/how-to-install-red5-server-on-centos-53/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 20:23:09 +0000</pubDate>
		<dc:creator>Sohail Riaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RED5]]></category>

		<guid isPermaLink="false">http://www.sohailriaz.com/?p=180</guid>
		<description><![CDATA[<a href="http://www.sohailriaz.com/how-to-install-red5-server-on-centos-53/"><img src="http://www.sohailriaz.com/wp-content/uploads/2009/08/red5_1-150x150.jpg" title="" alt="" /></a>
In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 &#8211; 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing [...]]]></description>
			<content:encoded><![CDATA[<p>In this how to i will describe how to install RED5 server on Centos 5.3. This how to can be used to install RED5 server on Centos 4 and Fedora 8 &#8211; 11 as well. RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc.<span id="more-180"></span></p>
<h3>1) Download and Install Java</h3>
<p>RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.</p>
<blockquote><p>yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel</p></blockquote>
<h3>2) Download and Install Ant (Apache Project)</h3>
<p>Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.</p>
<blockquote><p>cd /usr/src<br />
wget http://mirrors.kahuki.com/apache/ant/binaries/apache-ant-1.8.0-bin.tar.bz2<br />
tar jxvf apache-ant-1.8.0-bin.tar.bz2<br />
mv apache-ant-1.8.0 /usr/local/ant</p></blockquote>
<h3>3) Export Variables for Ant and Java</h3>
<blockquote><p>export ANT_HOME=/usr/local/ant<br />
export JAVA_HOME=/usr/lib/jvm/java<br />
export PATH=$PATH:/usr/local/ant/bin<br />
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip</p></blockquote>
<p>Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.</p>
<blockquote><p>echo &#8216;export ANT_HOME=/usr/local/ant&#8217; &gt;&gt; /etc/bashrc<br />
echo &#8216;export JAVA_HOME=/usr/lib/jvm/java&#8217; &gt;&gt; /etc/bashrc<br />
echo &#8216;export PATH=$PATH:/usr/local/ant/bin&#8217; &gt;&gt; /etc/bashrc<br />
echo &#8216;export CLASSPATH=.:$JAVA_HOME/lib/classes.zip&#8217; &gt;&gt; /etc/bashrc</p></blockquote>
<h3>4) Download and Install RED5 Server</h3>
<p>Here the latest version available for RED5 is 0.7 on site but download from google code using svn as the tarball of 0.7 on site is missing some of the files.</p>
<blockquote><p>cd /usr/src<br />
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5<br />
mv red5 /usr/local/<br />
cd /usr/local/red5<br />
ant prepare<br />
ant dist</p></blockquote>
<p>you will see a ton of lines, but you should get at last</p>
<p><strong>BUILD SUCCESSFUL</strong></p>
<p>that&#8217;s mean its install and now copy the conf directory from dist/ and test the red5 installation.</p>
<blockquote><p>cp -r dist/conf .<br />
./red5.sh</p></blockquote>
<p>If it shows Installer service created in the last then everything is fine here, press ctrl+c and move to next step to create init script.</p>
<h3>5) Init Script</h3>
<p>Now we will create init script for red5 to start, stop and restart easily.</p>
<blockquote><p>vi /etc/init.d/red5</p></blockquote>
<p>download <a href="http://www.sohailriaz.com/downloads/red5.txt" target="_blank">http://www.sohailriaz.com/downloads/red5.txt</a> and copy / paste code in it. The init script code also be viewed below.</p>
<blockquote><p>#!/bin/sh<br />
# For RedHat and cousins:<br />
# chkconfig: 2345 85 85<br />
# description: Red5 flash streaming server<br />
# processname: red5</p>
<p>PROG=red5<br />
RED5_HOME=/usr/local/red5<br />
DAEMON=$RED5_HOME/$PROG.sh<br />
PIDFILE=/var/run/$PROG.pid</p>
<p># Source function library<br />
. /etc/rc.d/init.d/functions</p>
<p>[ -r /etc/sysconfig/red5 ] &amp;&amp; . /etc/sysconfig/red5</p>
<p>RETVAL=0</p>
<p>case &#8220;$1&#8243; in<br />
start)<br />
echo -n $&#8221;Starting $PROG: &#8221;<br />
cd $RED5_HOME<br />
$DAEMON &gt;/dev/null 2&gt;/dev/null &amp;<br />
RETVAL=$?<br />
if [ $RETVAL -eq 0 ]; then<br />
echo $! &gt; $PIDFILE<br />
touch /var/lock/subsys/$PROG</p>
<p>fi<br />
[ $RETVAL -eq 0 ] &amp;&amp; success $&#8221;$PROG startup&#8221; || failure $&#8221;$PROG startup&#8221;<br />
echo<br />
;;<br />
stop)<br />
echo -n $&#8221;Shutting down $PROG: &#8221;<br />
killproc -p $PIDFILE<br />
RETVAL=$?<br />
echo<br />
[ $RETVAL -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/$PROG<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
status)<br />
status $PROG -p $PIDFILE<br />
RETVAL=$?<br />
;;<br />
*)<br />
echo $&#8221;Usage: $0 {start|stop|restart|status}&#8221;<br />
RETVAL=1<br />
esac</p>
<p>exit $RETVAL</p></blockquote>
<p>Now start the service</p>
<blockquote><p>/etc/init.d/red5 start</p></blockquote>
<p>check status</p>
<blockquote><p>/etc/init.d/red5 status<br />
red5 (pid  XXXXX) is running&#8230;</p></blockquote>
<p>again you can do stop, restart.</p>
<h3>6) Test</h3>
<p>Now test the RED5 installation by opening following URL in browser</p>
<p>http://yourip:5080/</p>
<p>you will see red5 page like this</p>
<p style="text-align: center;"><img class="size-full wp-image-185 aligncenter" title="red5_11" src="http://www.sohailriaz.com/wp-content/uploads/2009/08/red5_11.jpeg" alt="red5_11" width="450" height="269" /></p>
<p>and demos can be find here.</p>
<p>http://yourip:5080/demos/</p>
<p style="text-align: center;"><img class="size-full wp-image-191 aligncenter" title="red5_21" src="http://www.sohailriaz.com/wp-content/uploads/2009/08/red5_21.jpeg" alt="red5_21" width="400" height="239" /></p>
<p>You can use simple port tester tool that determines which ports the Flash Player is able to connect through to the Red5 server. Put your server address or IP in HOST when using port tester. You should get SUCCESS on RTMP or port 1935. If not please check your firewall.</p>
<p>http://yourip:5080/demos/port_tester.html</p>
<p style="text-align: center;"><img class="size-full wp-image-192 aligncenter" title="red5_3" src="http://www.sohailriaz.com/wp-content/uploads/2009/08/red5_3.jpeg" alt="red5_3" width="400" height="239" /></p>
<h3>7) ISSUE</h3>
<p>When you run ./red5.sh, it will show you <strong>Installer service created</strong>. Thats mean everything runs fine and red5 server is up. But if you went to port_tester.swf using demos above or your application shows connections FAILS, this is an issue of RTMPT and RTMPTS. You can see it by running</p>
<blockquote><p>/usr/local/red5/red5.sh</p>
<p>output trancated</p>
<p>[INFO] [main] org.red5.server.tomcat.TomcatLoader &#8211; RTMPT server bean was not found<br />
[INFO] [main] org.red5.server.tomcat.TomcatLoader &#8211; RTMPS server bean was not found</p>
<p>output truncated</p></blockquote>
<p>If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in<strong>/usr/local/red5/conf/red5-core.xml</strong></p>
<blockquote><p>vi /usr/local/red5/conf/red5-core.xml</p></blockquote>
<p>Search for a lines</p>
<blockquote><p>&lt;!&#8211; RTMPT &#8211;&gt;<br />
&lt;!&#8211;<br />
&lt;bean id=&#8221;rtmpt.server&#8221; class=&#8221;org.red5.server.net.rtmpt.TomcatRTMPTLoader&#8221; init-method=&#8221;init&#8221; lazy-init=&#8221;true&#8221;&gt;</p></blockquote>
<p>Remove the &lt;!&#8211; from start of &lt;bean and &#8211;&gt; from end of &lt;/bean&gt;</p>
<p>Same goes for RTMPS</p>
<blockquote><p>&lt;!&#8211; RTMPS &#8211;&gt;<br />
&lt;!&#8211;<br />
&lt;bean id=&#8221;rtmps.server&#8221; class=&#8221;org.red5.server.net.rtmps.TomcatRTMPSLoader&#8221; init-method=&#8221;init&#8221; lazy-init=&#8221;true&#8221;&gt;</p></blockquote>
<p>Remove the &lt;!&#8211; from start of &lt;bean and &#8211;&gt; from end of &lt;/bean&gt;</p>
<p>Restart the red5 services and connection fails problem will be fixed.</p>
<p>If you any question please use comments.</p>
<img src="http://www.sohailriaz.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=180&amp;ts=1283814962" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.sohailriaz.com/how-to-install-red5-server-on-centos-53/feed/</wfw:commentRss>
		<slash:comments>258</slash:comments>
		</item>
	</channel>
</rss>
