Installing RED5 server in CentOS 5.x

1) Install java

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

2) Install ant (apache project)

cd /usr/src
wget http://opensource.become.com/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
tar zxvf apache-ant-1.7.1-bin.tar.gz
mv apache-ant-1.7.1/ /usr/local/ant

3) Export veriables for Java and ant

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

By running commands

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

4) Install RED5 server

cd /usr/src
svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
mv red5 /usr/local/
cd /usr/local/red5
ant prepare
ant dist

you will see a ton of lines, but you should get at last

<strong>BUILD SUCCESSFUL</strong>

that’s mean its install and now copy the conf directory from dist/ and test the red5 installation.

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

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.

5) Install init script

vi /etc/init.d/red5

Copy paste following code in it

//

//

#!/bin/sh
# 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
 
<em>case “$1″ in
start)
echo -n $”Starting $PROG: ”
$DAEMON &gt;/dev/null 2&gt;/dev/null;
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! &gt; $PIDFILE
touch /var/lock/subsys/$PROG
 

fi
[ $RETVAL -eq 0 ] &amp;&amp; success $”$PROG startup” || failure $”$PROG startup”
echo
;;
stop)
echo -n $”Shutting down $PROG: ”
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] &amp;&amp; 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

6) Now start service

 # /etc/init.d/red5 start
//

 

//

Check status

/etc/init.d/red5 status
red5 (pid  XXXXX) is running…

7) Test

Now test the RED5 installation by opening following URL in browser

http://yourip:5080/

 

Explore posts in the same categories: centos, install

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s


%d blogger menyukai ini: