Showing posts with label Installing Red5 on Ubuntu 9.04 32 bit. Show all posts
Showing posts with label Installing Red5 on Ubuntu 9.04 32 bit. Show all posts

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
1)ant
2)svn
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
/etc/apt/sources.list
and enable or add following lines if you do not have already note the partner word at the end

deb http://archive.canonical.com/ubuntu jaunty partner
deb-src http://archive.canonical.com/ubuntu 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)
http://zebardast.ir/en/installing-sun-jdk-5-on-ubuntu-9-10-and-10-04/
http://www.linuxquestions.org/questions/linux-software-2/java1-5-installation-error-ubuntu-10-04-server-edition-uname-2-6-32-23-server-817569/

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 jdk.sh

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 http://ant.apache.org/bindownload.cgi 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
/usr/lib/
(although not necessary)
so you should have some thing like

/usr/lib/apache-ant-1.8.1

Step 5) go back to /etc/profile.d and create
/etc/profile.d/ant.sh 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
echo $JAVA_HOME
you should get
/usr/lib/jvm/java-6-sun
and

root@tapas-laptop:/etc/apt# echo $ANT_HOME
/usr/lib/apache-ant-1.8.1

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
http://ubuntuforums.org/showthread.php?t=1543461
http://ubuntuforums.org/showthread.php?t=1543461


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
/usr/lib/jvm/java-6-sun/bin/java


root@tapas-laptop:/etc/apt# which ant
/usr/lib/apache-ant-1.8.1/bin/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

http://ubuntuforums.org/showthread.php?t=1543461

or if you get an error like

ant

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

check this thread
http://ubuntuforums.org/showthread.php?t=1543461

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 http://code.google.com/p/red5/
http://code.google.com/p/red5/source/checkout
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 http://red5.googlecode.com/svn/java/server/trunk/ 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 http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only
from your home directory i.e.
/home/user
then you will see
/home/user/red5-read-only

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
ant

please note if you get an error like this

Buildfile: /opt/red5/build.xml
BUILD FAILED
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
http://old.nabble.com/Red5-Linux-installation-problem-td17522740.html
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 red5.sh
on command prompt ./red5.sh 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
http://www.sherin.co.in/red5-flash-media-server-development-how-to-install-and-configure/
I will post it and give a link to my blog also.
Just want your confusion to be less :)