Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
how to install red5 on centos based server

How to install red5 on CentOS based server
#1
In this how to i will describe how to install RED5 server on Centos 5.7. This how to can be used to install RED5 server on Centos 4 and Fedora 8 - 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.

1) Download and Install Java


RED5 server depends on Java. CentOS 5.7 comes with OpenJDK 1.6 and install it using yum.

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

2) Download and Install Ant (Apache Project)

Ant will need to compile RED5 server code. Ant comes in binary form, so just download and install it in /usr/local directory.
Code:
cd /usr/src
    wget http://apache.mirrors.pair.com/ant/binaries/apache-ant-1.8.2-bin.tar.gz
tar jxvf apache-ant-1.8.2-bin.tar.bz2
mv apache-ant-1.8.2 /usr/local/ant

3) Export Variables for Ant and Java

Code:
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

Also export these variables in /etc/bashrc to become available for every user login or for any terminal opens.

Code:
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

INSTALL SVN

Code:
yum install perl-URI

yum install subversion

PHP Code:
root@server [/usr/local/src]# yum install subversion
Loaded pluginsfastestmirror
Loading mirror speeds from cached hostfile
 
baseftp.nluug.nl
 
extrasftp.nluug.nl
 
updatesftp.nluug.nl
Excluding Packages in 
global exclude list
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
--> Processing Dependencyneon >= 0.25.5-6.el5 for packagesubversion
--> Processing Dependencylibneon.so.25 for packagesubversion
--> Processing Dependencylibapr-1.so.0 for packagesubversion
--> Processing Dependencylibaprutil-1.so.0 for packagesubversion
---> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
--> Processing Dependencylibaprutil-1.so.0()(64bit) for packagesubversion
--> Processing Dependencylibapr-1.so.0()(64bit) for packagesubversion
--> Running transaction check
---> Package apr.i386 0:1.2.7-11.el5_5.3 set to be updated
---> Package apr.x86_64 0:1.2.7-11.el5_5.3 set to be updated
---> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated
--> Processing Dependencylibpq.so.4 for packageapr-util
---> Package apr-util.x86_64 0:1.2.7-11.el5_5.2 set to be updated
--> Processing Dependencylibpq.so.4()(64bit) for packageapr-util
---> Package neon.i386 0:0.25.5-10.el5_4.1 set to be updated
---> Package neon.x86_64 0:0.25.5-10.el5_4.1 set to be updated
---> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
---> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
--> Running transaction check
---> Package postgresql-libs.i386 0:8.1.23-1.el5_6.1 set to be updated
---> Package postgresql-libs.x86_64 0:8.1.23-1.el5_6.1 set to be updated
---> Package subversion.i386 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
---> Package subversion.x86_64 0:1.6.11-7.el5_6.3 set to be updated
--> Processing Dependencyperl(URI) >= 1.17 for packagesubversion
--> Finished Dependency Resolution
subversion
-1.6.11-7.el5_6.3.x86_64 from updates has depsolving problems
  
--> Missing Dependencyperl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.x86_64 (updates)
subversion-1.6.11-7.el5_6.3.i386 from updates has depsolving problems
  
--> Missing Dependencyperl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.i386 (updates)
ErrorMissing Dependencyperl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.i386 (updates)
ErrorMissing Dependencyperl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.3.x86_64 (updates)
 
You could try using --skip-broken to work around the problem
 You could 
try runningpackage-cleanup --problems
                        package
-cleanup --dupes
                        rpm 
-Va --nofiles --nodigest
The program package
-cleanup is found in the yum-utils package 

then you could temporarily remove perl from the /etc/yum.conf exclude line, install subversion, then add perl back to the /etc/yum.conf exclude line after you've gotten subversion installed.


4) Download and Install RED5 Server

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.
Code:
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

BUILD SUCCESSFUL

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

Code:
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) Init Script

Now we will create init script for red5 to start, stop and restart easily.

Code:
nano /etc/init.d/red5

Copy and paste the following code

PHP Code:
#!/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

    
[ -/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 -/var/lock/subsys/$PROG
    
;;
    
restart)
    $
0 stop
    
$0 start
    
;;
    
status)
    
status $PROG -p $PIDFILE
    RETVAL
=$?
    ;;
    *)
    echo 
$”Usage: ${start|stop|restart|status}
    RETVAL
=1
    esac

    
exit $RETVAL 

Now start the service

Code:
/etc/init.d/red5 start

check status

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

again you can do stop, restart.

6) Test and Open Port on Firewall

Open red5 port on iptables firewall by running

Code:
iptables -A OUTPUT -m state --state NEW -p tcp --dport 5080 -j ACCEPT
iptables -A INPUT -m state --state NEW -p tcp --dport 5080 -j ACCEPT

Now test the RED5 installation by opening following URL in browser

Code:
http://yourip:5080/

you will see red5 page like this

[Image: red5_11.jpeg]

and demos can be find here.

Code:
http://yourip:5080/demos/

[Image: red5_21.jpeg]

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.

Code:
http://yourip:5080/demos/port_tester.html

[Image: red5_3.jpeg]

Common problem
if you face

Code:
HTTP Status 404 - /admin/register.html

type Status report

message /admin/register.html

description The requested resource (/admin/register.html) is not available.

Apache Tomcat/6.0.26

if you faced this types of problem then follow this steps
Get the plugins:
Code:
cd /root/tmp
mkdir /usr/local/red5/plugins
wget http://red5.googlecode.com/files/AdminPlugin-1.0.zip
unzip -d /usr/local/red5/plugins AdminPlugin-1.0.zip

Get the Red5 admin register page:
Code:
mkdir /usr/local/red5/webapps/admin
wget http://red5.googlecode.com/files/admin.jsp
mv admin.jsp /usr/local/red5/webapps/admin

then again restart Red5 (/etc/init.d/red5 restart)/(service red5 restart)

Reference:

How to install red5 on CentOS with cPanel

Regards



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)