Sunday, August 1, 2010

Installing Red5 on Ubuntu 9.04 32 bit

Installing Red5 on Ubuntu 9.04

Assuming you do not know what ant,svn,Red5 are and you have just installed Ubuntu 9.04 on your desktop.

Now you are wondering where in the world you should be doing all these things.
If you are trying this blog and some thing does not works for you drop me a mail so that I can understand what you missed and try to help you.

Before we begin
If you are a complete newcomer then read

you need to know what is
3) how to set class paths in Linux

Let us begin with creating an environment to be able to install Red5.
Red5 is based on Java.
So you need to have Java installed in your computer.
If you do not have

then Start here otherwise you can jump to Step 14

Install JAVA for Red5

Step1) Check
and enable or add following lines if you do not have already note the partner word at the end

deb jaunty partner
deb-src jaunty partner

Step2) Do an apt-get update
and type
apt-get install sun-jdk6-java

it should work
if you have any problems
I will strongly recommend to check following links (I faced problems which got solution on these links)

Please do not install jre for Red5 as Red5 needs jdk and not jre as you will read below in this post.

Step 3) Now go to /etc/profile.d/ and create a file named

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$JAVA_HOME/bin:$PATH

Install ant

I will strongly recommend to install latest ant binary from apache website do not use old versions I had some errrors which actually were resolved when I used the latest ones
Step 4) Download the latest binary for your Linux
if by the time of reading this blog it is one year or more and you by chance have come across and the above link does not works do Google apache ant binary download
I will suggest Google ant apache download and use the latest version because in my case I got this problem from some blog old links were not working

It is a good practise to install these type of packages in
(although not necessary)
so you should have some thing like


Step 5) go back to /etc/profile.d and create
/etc/profile.d/ and its content will be

export ANT_HOME=/usr/lib/apache-ant-1.8.1
export PATH=$ANT_HOME/bin:$PATH

Step6) I installed in /usr/lib both Jdk and Ant so my JAVA_HOME and ANT_HOME are like that.

upto this step do a check
you should get

root@tapas-laptop:/etc/apt# echo $ANT_HOME

Step 7) If you do not get upto the above mentioned steps 6 then do not proceed further first resolve the above issues.
Here are a few links which I feel will be useful to you since I had problems from Step1 to Step6 which got resolved
following links you can read

Step 8) Assuming that if you type which java and which ant on command prompt you are getting following output
root@tapas-laptop:/etc/apt# which java

root@tapas-laptop:/etc/apt# which ant

Step 9) Check ant -version

you should get an output like this

root@tapas-laptop:/etc/apt# ant -version
Apache Ant version 1.8.1 compiled on April 30 2010

Step 10) check java -version

root@tapas-laptop:/etc/apt# java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)

Step 11) If upto above you have got exactly what mentioned only then proceed further.
Otherwise resolve the above errors first.

If you get an error like
Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-6-sun/bin/bin/java

check this thread

or if you get an error like


Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-sun-
Buildfile: build.xml does not exist!
Build failed

check this thread

Step 12) Install subversion
apt-get install subversion

you do not need to know what subversion is to be able to use it although it will help if you know it
When I used I did not knew what it is.

Step13) Now go to
since they can move the repositories if you hit this blog at a later date and then do Google svn red5 trunk

Step 14)
Go to /opt (not necessary to be in opt but I prefer)
type following command
svn checkout red5-read-only

after some minutes depending upon your internet connection you will see a directory named

red5-read-only in /opt or where ever you executed this command say for example you executed
svn checkout red5-read-only
from your home directory i.e.
then you will see

Rename red5-read-only to red5
If you do not know how to rename do following from your
directory where you executed svn command

mv red5-read-only red5

Step 15) now go to /opt/red5 and type
cd /opt/red5
and type

please note if you get an error like this

Buildfile: /opt/red5/build.xml
Target "build" does not exist in the project "Red5".

then you do not need to type ant build for building any thing
just type ant from /opt/red5 and the above error should go I got this information here
if this does not solves your problem you should Google the error message

Step 16) Thats it.

Now go to /opt/red5/dist and you should see
on command prompt ./ should give you some output do not close the terminal and check in
browser http://localhost:5080/

I have not explained how to create a startup script for this but if you want to read check the following blog
I will post it and give a link to my blog also.
Just want your confusion to be less :)


satya said...

Everything ran fine except the last step
(although I had to setup proxy(authentication) for svn and I had to download all the dependency files manually as my proxy did not allowed to download files by the ivy resolver)

I have checked all the places where you have put checkpoints.

But when I run ./, I can't see any process running with port 5080, as u can see the output of netstat below.

satya@satya-bbb:~$ netstat -ntlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0* LISTEN -
tcp6 0 0 :::45482 :::* LISTEN 6127/java
tcp6 0 0 :::1935 :::* LISTEN 6127/java
tcp6 0 0 :::9999 :::* LISTEN 6127/java
tcp6 0 0 ::1:631 :::* LISTEN -

I am fade off with proxy now, still I don't have any other way around.

Can you please point out where I am going wrong.


Anonymous said...


I face the same issue that Satya has.
I am using Ubuntu 10.04 on Amazon EC2.

I have only this ports listening 9999 and 56240. That too on IPV6/TCP6.

Same time everything is working fine with the binary download.

Please support.

satya said...

hi anoopL, plz refer the following link to know what is the exact problem and how to solve that

Aaron Winborn said...

I'm stuck attempting to install jdk. I've ensured that /etc/apt/sources.list has the two archive db urls uncommented, but am getting the following. Any ideas?

$ sudo apt-get install sun-jdk6-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package sun-jdk6-java

Aaron Winborn said...

or rather deb:

deb jaunty partner
deb-src jaunty partner

Aaron Winborn said...

in fact,

shows no results. is that the correct package?


Aaron Winborn said...

maybe it's supposed to be sun-java6-jdk. i get the following (which is closer, but still no dice):

$ sudo apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

Aaron Winborn said...

solved that part:

deb hardy multiverse
deb-src hardy multiverse

then because of a conflict:

sudo apt-get remove sun-java6-bin

and finally:

sudo apt-get install sun-java6-jdk

Tapas said...

You will get java packages from Ubuntu partner repositories i.e.

your /etc/apt/sources.lst should have following

deb jaunty partner
deb-src jaunty partner

replace jaunty by what ever your distribution code name is