Install Red5 1.0 on CentOS Latest


Hits: 27877  

1. Install Java

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

2. Install Ant

# cd /usr/local/src
# wget http://red5.svnlabs.com/apache-ant-1.8.2-bin.tar.gz
# tar zxvf apache-ant-1.8.2-bin.tar.gz
# mv apache-ant-1.8.2 /usr/local/ant

3. Export path for Ant and Java

Make sure you have right paths (java, ant etc.) on your server, I have used 32-bits CentOS server … home path might be different on 64-bits or other server 😉

# 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 add these lines in /etc/bashrc at last to available every-time logged in to SSH

4. Install SVN

# yum install subversion

5. Install RED5 Server

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

6. Copy Red5 files

# cp -r dist/conf /usr/local/red5

7. Test Run

# sh red5.sh

ctrl + z

You need to allow port 5080 and 1935 to your server firewall.

# iptables -A INPUT -p tcp -m tcp –dport 5080 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp –dport 1935 -j ACCEPT

Red5 Server Status

# netstat -anp | grep 5080
# ps aux | grep red5

http://yourserver.com:5080/

If you have CentOS 64-bits server and you are getting error like

– Buildfile: build.xml does not exist!
– BUILD FAILED
– Cannot allocate memory

You might need to checkout modified files
# cd /usr/local/src
# svn co http://red5.googlecode.com/svn/java/server/tags/1_0/ red5

Build Failed (Life saver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Cannot run program “chmod”: java.io.IOException: error=12, Cannot allocate memory

# export _JAVA_OPTIONS=’-Xms32m -Xmx56m -Xss128k -XX:PermSize=32m -XX:MaxPermSize=64m’
# export ANT_OPTS=’-Xms32m -Xmx56m -Xss128k -XX:PermSize=32m -XX:MaxPermSize=64m’

Try solution here… http://code.google.com/p/red5/issues/detail?id=337

How to install Red5 Demos?

# cd /usr/local/red5/webapps/root
# svn checkout http://red5.googlecode.com/svn/java/server/tags/0_9_1/webapps/root/demos/

Then go to http://yourserver.com:5080/demos/

Please check all comments below for more help 😉

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch