Googolflex!!
  • Home
  • About
  • Contracting

Recent Posts

  • Sprint’s new “Simply ‘Almost’ Everything®” Plans
  • CSS Changes in Flex 4
  • Dotted Underline LinkButton (Flex)

About The Author : jwd

This is John Dusbabek's tech blog. John is a software engineer and Flex developer in Provo, UT, where he lives with his lovely wife and four sons.

Recent Comments

  • Nikos on Flex: Binding to an Interface
  • Iain Hosking on Apache mod_proxy_balancer: No Protocol handler was valid
May
21

Installing Red5 Media Server on CentOS 5.5 / Fedora

By jwd

This post details the steps I took to install Red5 from source on a CentOS 5.5 base server.


1. Install Java using yum. (The -y flag provides a ‘yes’ answer to all prompts.)

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel


2. Install the Apache ant binary. I downloaded the most recent release one directly from Apache’s archives. The version installed using yum (and default repositories) will not compile Red5.

cd /usr/src
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.1-bin.tar.bz2
tar jxvf apache-ant-1.8.1-bin.tar.bz2
mv apache-ant-1.8.1 /usr/local/ant


3. Set important Java environment variables.

export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip


4. You should also add them to bashrc so they’re available the next time you log in.

echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc


5. Install subversion with yum. If you did a base install of CentOS, subversion will not be preinstalled.

yum -y install subversion


6. Check out the Red5 source.

cd /usr/src
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5


7. Build Red5 with ant.

mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist


8. Start Red5.

cp -r dist/conf .
./red5.sh


9. Create a startup script (optional):

vi /etc/init.d/red5

Then enter this text into the file.

#!/bin/bash
# chkconfig: 2345 80 80
# description: Red5 streaming server
# processname: red5

. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case "$1" in
	start)
	echo -n "Starting red5: "
	cd /usr/local/red5
	/usr/local/red5/red5.sh >/dev/null 2>/dev/null &&
	RETVAL=$?
	if [ $RETVAL -eq 0 ]; then
		echo $! > /var/run/red5.pid
		touch /var/lock/subsys/red5
	fi
	[ $RETVAL -eq 0 ] && success $"red5 startup" || failure $"red5 startup"
	echo
	;;
	stop)
	echo -n $"Stopping down red5: "
	killproc -p /var/run/red5.pid
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/red5
	;;
	restart)
	$0 stop
	$0 start
	;;
	status)
	status red5 -p /var/run/red5.pid
	RETVAL=$?
	;;
	*)
	echo $"Usage: $0 {start|stop|restart|status}"
	RETVAL=1
esac

exit $RETVAL


10. Set permissions on the script.

chmod a+x /etc/init.d/red5
chkconfig red5 on


11. Add necessary ports to the iptables file.

vi /etc/sysconfig/iptables

Then add the following lines:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5080 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT

You may also want to add exceptions for 8443, 8088, 9035, 1936, and 9999 if necessary for your application,

service iptables restart

You may want to restart the server, and the Red5 test page can be accessed at http://localhost(or servername):5080/

Categories : Flex 3, Red5

1 Comments

1
Jeremy
August 4th, 2010 at 4:02 pm

Thank you for the tutorial!

Leave a Comment

CAPTCHA Image Audio Version
Reload Image

Search

Feedburner

Subscribe to

Get the latest updates delivered via email

Calendar

September 2010
M T W T F S S
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930  

Archives

  • July 2010 (1)
  • June 2010 (2)
  • May 2010 (1)
  • February 2010 (11)
  • January 2010 (3)
  • December 2009 (5)
  • November 2009 (1)
  • August 2009 (8)
  • July 2009 (8)
  • May 2009 (4)
  • April 2009 (1)
  • March 2009 (6)
  • January 2009 (1)
  • November 2008 (4)
  • October 2008 (5)
  • September 2008 (1)
  • August 2008 (5)
  • July 2008 (1)
  • June 2008 (2)
  • May 2008 (8)
  • April 2008 (5)
  • March 2008 (2)
  • February 2008 (3)
  • January 2008 (1)
  • December 2007 (6)
  • November 2007 (9)
  • October 2007 (1)
  • September 2007 (2)

Categories

Tag Cloud

adobe apache Architecture book review C++ centos client server architecture Custom Components database Design error message fedora flash catalyst flex Flex 3 Flex 4 fms iis 6 Interaction Design load balancing master-master master-slave mod_proxy_balancer Monkey Patching MySQL no protocol p2p peer to peer Perl PHP Red5 regex replication self registration selinux Shell Scripting shortcut manager skins socket policy file sockets states stored procedures stratus tools workflow

Coworkers

  • Casey Jackman
  • Sean Murphy

Family

  • Emily & CJ
  • Family Blog
  • Gary Dusbabek

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS FlexExamples

  • Setting a bitmap image fill on a Spark FormHeading control in Flex Hero
  • Setting the background alpha on a Spark FormHeading control in Flex Hero
  • Styling the error indicator on a Spark FomItem container in Flex Hero
  • Displaying the error indicator on a Spark FormItem container in Flex Hero
  • Styling the required indicator on a Spark FomItem container in Flex Hero

Spam Blocked

847 spam comments
blocked by
Akismet

Sponsored Links

JUICE Chat

BYU Adobe Users Group


Copyright © 2010 All Rights Reserved
Flexx Theme by iThemes
Powered by WordPress