Quickly install Java, Ant, Ivy and Red5 Flash server in Linux

by jagbir on February 8, 2011

Although the Red5 installation guide is there and simple but they only explained how to install it in Ubuntu. I am documenting here the steps I took to install it in CentOS 5.4 server and worked like charm. It should be more or less similar in any Redhat based distro.

Step 1. Install openjdk through yum:

$ yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel

Step 2. Download the binary version of ant. I got it from here:

$ cd /usr/src 
$ wget  http://apache.opensourceresources.org//ant/binaries/apache-ant-1.8.2-bin.tar.gz
$ tar xzf apache-ant-1.8.2-bin.tar.gz
$ cd apache-ant-1.8.2

Step 3. After inflating the compressed file, you will get all binary contents of ant. You can now copy/move bin and lib directories to any location to access ant. I’m creating a directory here and copying these directories there.

$ mkdir /usr/local/bin/ant
$ cp -ar bin lib /usr/local/bin/ant/

Step 4. You need to set some environment variables for ant and Java. You can include these variables in your user/system .bashrc or .bash_profile so that they will get set after Server reboot

$ export ANT_HOME=/usr/local/ant
$ export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-
$ export PATH=${PATH}:${ANT_HOME}/bin

Step 5. To verify whether Java and Ant get installed fine, just run the command:

$ ant
Buildfile: build.xml does not exist!
Build failed

The output is ok and it indicates that Java and Ant are installed successfully.

Step 6. Time to download and install Apache Ivy

$ cd /usr/src
$ wget http://www.gossipcheck.com/mirrors/apache//ant/ivy/2.2.0/apache-ivy-2.2.0-src.tar.gz
$ tar xzf apache-ivy-2.2.0-src.tar.gz
$ cd apache-ivy-2.2.0
$ ant jar

Step 7. After installation of Java, Ant and Ivy, let’s focus on Red5 but note that we need to checkout its source using svn (subversion tool) so you must have subversion installed in your server, in case its not there, just install by using following command:

$ yum install subversion

Step 8. Checkout the code now and build Red5

$ cd /usr/src
$ svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1 red5-0.9.1.svn
$ cd red5-0.9.1.svn/
$ ant clean dist

Step 9. Good going, let’s start the Red5 server now:

$ /usr/src/red5-0.9.1.svn/dist/red5.sh
Running on  Linux
Starting Red5
Red5 root: /usr/src/red5-0.9.1.svn
Configuation root: /usr/src/red5-0.9.1.svn/conf
Root: /usr/src/red5-0.9.1.svn
Deploy type: bootstrap
Logback selector: org.red5.logging.LoggingContextSelector
Setting default logging context: default
10:00:11.577 [main] INFO  org.red5.server.Launcher - Red5 Server 0.9.1 $Rev: 4059 $ (http://code.google.com/p/red5/)
Red5 Server 0.9.1 $Rev: 4059 $ (http://code.google.com/p/red5/)
10:00:11.640 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@8bdcd2: startup date [Thu Feb 03 10:00:11 MST 2011]; root of context hierarchy
Bootstrap complete

This show that Red5 server has been installed fine and started. If you need further info for installation, check here and for configuring Red5 as per your requirement, check here.

Related articles:
* Top 5 most useful tools for Linux Admin
* Setup multiple MySQL servers in single host
* Recover or reset MySQL/PostgreSQL root password
* Quickly install and configure Munin for server monitoring
* Download, install and configure ViewVC for Subversion

  • Pingback: Tweets that mention Quickly install Java, Ant, Ivy and Red5 Flash server in Linux | Linux Admin Zone -- Topsy.com

  • http://www.successfulrecovery.com Todd

    I am trying to get red5 running on a red hat/AWS server.

    I followed the installation instructions here exactly (they are better than Red5′s), but when I run the ANT command (Step 5) I get an error saying the command is unrecognized.

    Any suggestions?

  • http://about.me/andrei.ion Andrei

    @Todd ( yes, I saw 8 months ago :D )

    it’s actually
    export ANT_HOME=/usr/local/bin/ant

  • http://about.me/andrei.ion Andrei

    Thank you! you really did make the installation easy for me!

  • Naresh

    I am getting error when try to run the server:

    Exception in thread “main” java.lang.NumberFormatException: For input string: “147j”

    Can you please suggest something? It does run okay with version 1.0 but that does not record video more than half a second. I loved v0.9.1 always, but yack! it does not work :(

Previous post:

Next post: