RED5 is open source flash server written in java supports streaming audio/video, recording client streams, shared objects, live stream publishing etc. In this short steps you can install red5 server on your virtual server or dedicated.
This is post is being modified on 27th August 2013, the installation is for the Red5 version 0.8. as no one will use the 0.9…
Download and Install Java
RED5 server depends on Java, so lets install it first using yum:
# yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
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. This step may cause problems because they all always updating the apache ant and changing the name of it, so sometimes the binary is called apache-ant-1.8.0RC1-bin.tar.gz sometimes apache-ant-1.8.0-bin.tar.gz so you will have to get the correct link, go to http://opensource.become.com/apache/ant/binaries/ (link not working) and find what they have, get the one which ends on tar.gz, should be about 9-10 mega file, so edit the link down to the correct one;
# cd /usr/src
# wget http://mirrors.isu.net.sa/pub/apache//ant/binaries/apache-ant-1.9.2-bin.tar.gz (working link today 8/27/2013)
# tar zxvf apache-ant-1.9.2-bin.tar.gz
# mv apache-ant-1.9.2/ /usr/local/ant
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
Download and Install RED5 Server
Now we come to the main part, which one you want? 0.8, 0.9, 0.7?? (using the 0.8 version)
you can find the various versions available at:
if for example you want version 0.8, then the command would be:
# cd /usr/local
# mkdir red5
# cd /usr/local/red5
# wget http://red5.org/downloads/red5/0_8/red5-0.8.0.tar.gz
# tar -zxvf red5-0.8.0.tar.gz
# sh red5.sh &
wait 2 minutes before you close the cmd window, then use:
# CTRL + A + D
if you just close the cmd window the red5 will stop, you must log off using the CTRL + A + D
When Red5 is running you should be able to access http://your-server-domain-or-ip:5080/ .
If it works first thing go to http://your-server:5080/installer/and install admin. Then to http://your-server:5080/admin/register.html and register an username and password. Then you can check application statistics anytime from http://your-server:5080/admin/ with server ip and the registered username, password.
RED 5 RESTART
You need to restart every time you add or update files in the /usr/local/red5/webapps folder where all applications should be installed.
Real Time Messaging Protocol (RTMP) is a protocol for streaming audio, video and data over the Internet, between a Flash player and a server. A special software is required to run on server side for accepting and serving the rtmp connections from flash clients. We provide managed RTMP hosting based on RED5.
Red5 is shared on our shared hosting plans that means although you can use red5 to stream your videos you will not have access to the red5 folder. Most scripts based on red5 need to upload a folder inside red5/webapps.
This folder is important because it will be on the RTMP path, ex.
Contact us so we can upload your folder to red5/webapps and then give you the rtmp path.
While restarting the red5 service on the server, If you get following error
root@server [~]# cd /usr/local/red5
root@server [/usr/local/red5]#sh red5.sh &
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Then the best solution is to increase the RAM available to the red5. Locate red5.sh, it is on the red5 folder and replace this line:
export JAVA_OPTS="$LOGGING_OPTS $SECURITY_OPTS $JAVA_OPTS"
export JAVA_OPTS="-Xms512m -Xmx1024m $LOGGING_OPTS $SECURITY_OPTS $JAVA_OPTS"
And restart red5.sh
On our server s at Hosting Marketers, and Red5 Server
we actually give more RAM to red5:
Xms1024m and Xmx2048m
This really depends on the kind of machine you have and the RAM available.
Red 5 is a pretty amazing server software written in java. The Red 5 development team has put in tons of effort to make it a open source alternative to Adobe FMS ? Flash Media Server.
Red 5 is a perfectly suitable technology for ?Video On Demand? applications, streaming, publishing, mealtime collaboration, multi player gaming and more….
Red 5 is on all shared hosting plans of Hosting Marketers. By default the red5 server comes with some sample applications pre installed into it, like oflaDemo, fitcDemo, SoSample etc.
When installing and using red5 you have to keep in mind some configurations and security concerns. Red 5 was created to emulate the RTMP Protocol (real time messaging).
Even today where many don’t know the capabilities of Red5 or are scared of the complications offered by java coding, i must tell you… once you get to use it you will love it :).
There are many applications to be made with RTMP and many possibilities to be discussed. Here we will discuss a simple application that can stream from custom directory. This application will be server side and will help you set up your own basic application which does not require you to use the global oflaDemo.
Hosting Marketers offer you Red5 Hosting facility on their servers, which is needless to say … amazing.
You can host you own youtube or clipshare clones at a very nominal cost. However to avoid any problems, as you will be sharing resources on a shared server, it’s always better to create your own application, that accepts incoming outgoing requests.
This tutorial does not give you the scope to create the application from scratch, rather configure it to use a custom path on the server to stream from / record to . You can then safely use your own account path to handle streams. By default oflaDemo uses streams directory on the server to play/record streams.
Though this tutorial gives you a course on setting up the same, many have difficulties getting it done.
So here is the practical way of doing it.
I assume you already have basic Application class ready, which makes your application valid. We will simply use a custom filename generator to change the stream paths.