[*]Streaming Video (FLV, F4V, MP4, 3GP)
[*]Streaming Audio (MP3, F4A, M4A, AAC)
[*]Recording Client Streams (FLV and AVC+AAC in FLV container)
[*]Shared Objects
[*]Live Stream Publishing
[*]Remoting
[*]Protocols: RTMP, RTMPT, RTMPS, and RTMPE
As Red5 is written in Java, let`s install it on the server:
- Code: Select all
yum install java-1.6.0-openjdk.x86_64 java-1.6.0-openjdk-devel.x86_64
Ant is needed to compile RED5 code. Ant comes in binary form, so we`ll just download and unpack it to /usr/local directory:
- Code: Select all
cd /usr/src/
wget http://www.apache.org/dist/ant/binaries/apache-ant-1.8.3-bin.tar.gz
tar zxvf apache-ant-1.8.3-bin.tar.gz
mv apache-ant-1.8.3 /usr/local/ant
To checkout Red5 sources from GoogleCode we will require svn client, which depends on perl-URI package. On cPanel server, for example, all perl* packages are excluded via yum.conf exclude section, thereofre we will download it and install as RPM package:
- Code: Select all
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm
rpm -ivh perl-URI-1.35-3.noarch.rpm
Or we can disable parse of yum excludes:
- Code: Select all
yum --disableexcludes=main install perl-URI
- Code: Select all
yum install subversion.x86_64
Next step is to export path variables for Ant and Java:
- Code: Select all
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
And add them to global bashrc to make them available for every user login or for any terminal opens:
- Code: Select all
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
At this stage Ant should already work, one can check it with:
- Code: Select all
/usr/local/ant/bin/ant -version
Get latest Red5 sources from GoogleCode svn repositiry:
- Code: Select all
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv red5 /usr/local/
cd /usr/local/red5
Compile red5:
- Code: Select all
ant prepare
ant dist
Check build output and correct errors (if any). Having done this copy default configuration files and perform test-run to ensure that Red5 is installed and start without errors:
- Code: Select all
cp -r dist/conf .
./red5.sh > start.log &
Check access to Red5 web interface:
- Code: Select all
http://serveripaddress:5080/
Create init script /etc/init.d/red5:
- Code: Select all
#!/bin/bash
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5
PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
case "$1" in
start)
echo -n $"Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
;;
stop)
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
Make it executable:
- Code: Select all
chmod a+x /etc/init.d/red5
Now you can regiter Red5 as service and enable autostart:
- Code: Select all
chkconfig --add red5
chkconfig red5 on
Red5 uses the following default ports:
Default ports: 1935,8088,5080,1936
RTMP: 1935
RTMPT: 8088
HTTP servlet engine port: 5080
Debug proxy port: 1936