How To Install RED5 Server on Centos 5.4

  • How To Install RED5 Server on Centos 5.4

In this how to i will describe how to install RED5 server on Centos 5.4.x 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.4 comes with OpenJDK 1.6 and install it using yum.

yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel java-1.6.0-openjdk-javadoc java-1.6.0-openjdk-src

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.

cd /usr/src
wget http://apache.sunsite.ualberta.ca/ant/binaries/apache-ant-1.8.0-bin.tar.bz2
tar jxvf apache-ant-1.8.0-bin.tar.bz2
mv apache-ant-1.8.0 /usr/local/ant

3) Export Variables for Ant and Java

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.

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) Download and Install RED5 Server

Here the latest version available for RED5 is 0.9 on site but download from google code using svn as the tarball of 0.9 on site is missing some of the files.

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.

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.

vi /etc/init.d/red5

The init script code below:

#!/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

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

Now start the service

/etc/init.d/red5 start

check status

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

again you can do stop, restart.

6) Test

Now test the RED5 installation by opening following URL in browser

http://yourip:5080/

you will see red5 page like this

red5_11

and demos can be find here.

http://yourip:5080/demos/

red5_21

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.

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

red5_3

7) ISSUE

When you run ./red5.sh, it will show you Installer service created. 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

/usr/local/red5/red5.sh

output trancated

[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPT server bean was not found
[INFO] [main] org.red5.server.tomcat.TomcatLoader – RTMPS server bean was not found

output truncated

If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in/usr/local/red5/conf/red5-core.xml

vi /usr/local/red5/conf/red5-core.xml

Search for a lines

<!– RTMPT –>
<!–
<bean id=”rtmpt.server” class=”org.red5.server.net.rtmpt.TomcatRTMPTLoader” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Same goes for RTMPS

<!– RTMPS –>
<!–
<bean id=”rtmps.server” class=”org.red5.server.net.rtmps.TomcatRTMPSLoader” init-method=”init” lazy-init=”true”>

Remove the <!– from start of <bean and –> from end of </bean>

Restart the red5 services and connection fails problem will be fixed.

If you any question please use comments.

Linden labs overloading our sims!

well after alot of research i first noticed this when i entered back into secondlife after not being in secondlife now for about an year.

i use to have constant access to data to the grid within secondlife whats being changed , updates and general overview of traffic + sales

first i noticed the huge drops in sales from last year and after further reaearch with both linden labs employees and its residents it seems that there is more land space now available, you ever wondered why we never see abonded land on the map anymore  reason being you would see alot of land just being returned to lindens or its estate owners, even estate owners are returning there land back to linden labs and are either leaving seacondlife or going back to renting as its costing them more then its residents are making in secondlife due to the masive drops in residents + sales

well being an scripter & c++hacker  in secondlife i noticed the huge amount of memory being used on its servers, packets are being lost, and secondlife viewer at times even struggles to keep an active connection.

how often you you see been disconected from secondlife this seems to be an big packet issues with the server code not sending out the data due its high volume on the server.

we all remember the days when secondlife ran on 1 sim per machine and maybe quad core cpu had 2 sims

well last year linden labs was running upto 4 machines per server well even things got an bit worse for its performance linden labs made up the differce by improving the server code not by giving us an updated havok but also giving us mono in our scripts means we can have less running scripts and more memory.

well now it seems linden labs are using 8 sims per an machine, yet the server code still contains many bugs and many performance issues are so bad that we struggle with the basic tasks.

even the most recent changes linden labs firing there employees

seems path finder linden is no longer working for linden labs as well as other linden lab employees

does second life have an future ? or is second life having an long painful death

~Revolution Perenti~

Revolution Perenti & Skidz Partz – Primitizer

Hello Everyone for the longest time that our Primitizer version 5 was delayed for almost an year.

for an while we been unable to support our current work in secondlife and most of our vendors was removed due to im was not able to be inworld as much as hoped.

for about month now i been rewriting the Primitizer version 5 adding all the features that i was working on before the project had an slight break.

first off we have removed all lsl related hacks as we now have more memory means we can also have less bytes in the scripts themselves.

our particle system is reintroduced but highly improved over version 2 of the Primitizer as the particles are used for effects but also used in combination with our weather system to generate weather like environment inside your Primitizer

we do plan to release the new version 5 in over the next week first of too everyone in the group then we will officially launch version 5.

also we have been working on another secrect project which i will like to release as soon as we are happy with our scripts, which is xstreet like clone

as we have built an cms which is based on phpnuke as is modded for the use of secondlife, for both magicbox, atm code, and withdraw box which is used in world by the site owners so you be able to create your own xstreet like site.

the scripts themselfs with skidz partz as for the cms this will be downloaded from google code

for any feedback or suggestions please contact Revolution Perenti in secondlife or dazzlecms@hotmail.com

Dazzle CMS Registry System Completed

Hello everyone,

Dazzle cms team here and thought i post some updates as were near the completion of our framework stage, alot of major changes are in progress mostly everything we are creating right now is seperate from dazzle cms

but we manage to come up with an registry system not only that php files, json, xml, ini even serialize functions has built in plugin baseed framework

atm we currently working on extending the framework with an ftp based framework, files and folders, chmod, chown using ftp, sftp or ssh2

so what does this all mean, you can store all settings in files, not only keeps less stored in the database but also makes everything perform faster and php will be able to handle more instances per database connection.

from using this framework from editing config files, to json encoding , xml, ini or even re-encode serialization strings. as soon as all our test cases are complete and functions on this next class  we begin implementing this into our Registry system and we will begin the first change over in the cms

try keep an eye on this blog as we update this regularly

Dazzle CMS Updates

As we are near to the completion of our latest change over well lets first explain whats changed some of you may know this and others may not know this that recently we started implementing an file system so what does this mean to you

that means your arrays that you load settings from your json encoded strings, your ini, xml and even php classes can be read in our filesystem

we have completed the filesystem and we are just testing everything is working as we all know things may of worked when we started this framework but could stop working so we are puttign together some test cases but these are not just there for us to be able to test all the features without the cms

but also show you in simple terms how to use our framework when you start developing modules.

we did release 2 betas last year and i was unhappy with some of the system core for many reasons i did have alot of hardcoded functions until i had x feature i was looking for now i have some of the basic features working my main goal is to get everything that really should be in classes as i really dont like cloning the same function over and over or the system looking like phpnuke in its code so we are going to start code cleanup this will not be an long process at all as we will be building about 5 new frameworks over the next 2 weeks which we hope to be completed and we can ship public betas as i will feel after i changed this that nothing big or major going to change in the files or the database.

as this has been an long process to where i have everything now once the new framework is ready our job will be to rewrite all of the admin modules as alot of these were just backported from phpnuke as the system was inspired by phpnuke, i wanted to keep that feel about the system from an admin point of view so each of these modules will be rewritten complely using out classes for example , using our template engine, any design will go though our template engine, to there will be complete control of every aspect of the system.

even we don’t officially have any modules with the cms as soon as we have our few basic modules news, forums, downloads these were developed in the early beta but no longer work with our current beta so we will have to rewrite alot of these to make them work again and we need to implement some of our web2 features from ajax powered forms .

our goal is to have an cms that’s easy to use , thats built apon php5 easy to anyone to create modules and add new features with very little coding

we even do have plans for an module thats creates features for you with no coding just using our form classes position the forms, textareas we do plan to have the cms released and in the final versions by this summer and plan to enter the cms for google summer of code for 2010

we keep you updated on our progress so you can see whats going on at the dazzle cms development keep an eye on our blog as we will try update this more regularly