Getting RED 5 up and running on Ubuntu 9.04

23 Jul
2009

As part of my Rails Rumble team prep, I wanted to document the quickest way to get a Red5 Flash media server up and running on a virtual private server. The Rails Rumble project will actually be using a Linode cloud server, but since I already have a Slicehost account, I did this experimentation on Slicehost.

  1. First fire up a new server on Slicehost (even though it’s not LTS, we’ll use Ubuntu 9.04). 
    After the server is provisioned, ssh in as root.  For simplicity, I’ve done this entire
    exercise as root.  Obviously on a production server, you’ll want to create the necessary
    non-root account.

  2. Next let’s get our server up to date and necessary repos added. 
    If you are already root, you won’t need the ’sudo’:

        sudo nano /etc/apt/sources.list

  3. Add this line to the end of your ’sources.list’ file:

        deb http://za.archive.ubuntu.com/ubuntu/ jaunty multiverse

  4. Now run this series of commands from the shell. This will bring Ubuntu
    up to date with the latest patches, etc. Also it will install some useful
    shell tools like locate to help you quickly find files on the filesystem.

        apt-get update
        apt-get upgrade
        apt-get install locate
        updatedb &
        apt-get install htop wget screen telnet subversion


  5. Now install the necessary Java packages and the Ant build tool:

        apt-get install java-package
        apt-get install sun-java6-jdk
        apt-get install sun-java6-jre
        apt-get install ant


  6. After you have run through the install steps, you can test the success of the
    install by checking where java was installed and which version is recognized:

        root@red5Test:/etc/apt# which java
        /usr/bin/java

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


  7. You can do this as a non-root account, but I built Red5 with Ant from the root account.
    After the build completes, copy the build output into /usr/share.

        cd ~
        mkdir temp
        cd temp
        svn co http://red5.googlecode.com/svn/java/server/trunk red5

        export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.13/
        export ANT_HOME=/usr/share/ant/

        cd red5
        /usr/share/ant/bin/ant

        mkdir /usr/share/red5
        cp -R ./dist/* /usr/share/red5/

        cd /usr/share/red5
        chmod 755 red5.sh


  8. Now we can check if Red5 can be brought to life:

        /usr/share/red5/red5.sh &


    We can check with netstat that Red5 is running on the default port of 5080:

        root@red5Test:/usr/share/red5# netstat -ant
        Active Internet connections (servers and established)
        Proto Recv-Q Send-Q Local Address  Foreign Address  State
        ...
        tcp6       0      0 :::5080        :::*             LISTEN
        ...



    And to confirm, connect to port 5080 via telnet:

        root@red5Test:/usr/share/red5# telnet localhost 5080
        Trying 127.0.0.1...
        Connected to localhost.
        Escape character is '^]'.


  9. Go ahead and cancel out of telnet. Confirm that the Red5 start page is accessible via a browser by navigating to:

    http://[yourdomain]:5080/

    You should see this Red5 page:

    red 5 start page

  10. At this point, you can watch the really nice YouTube video that the Red5 team has put together which is embedded on this Red5 start page. It will guide you thru the process of installing a couple of demo applications and then testing them… Remember when you are testing the demo apps to change the ip address of the server you are connecting to. If you are using a remote server, it won’t be ‘localhost’ but the ip address of the remote machine.

12 Responses to Getting RED 5 up and running on Ubuntu 9.04

Avatar

Chris Lee

July 29th, 2009 at 5:30 pm

Awesome walk through, works perfectly!

Avatar

Chris Lee

July 31st, 2009 at 2:43 pm

Just a note that I also had to do this after my red5 installation mysteriously died and wouldn’t start up again:

export RED5_HOME=/usr/share/red5/

Avatar

How to get Red5 running on Ubuntu 9.04 | Csatpk! CS & IT Solutions

August 17th, 2009 at 1:48 pm

[...] source here [...]

Avatar

Mark

September 7th, 2009 at 4:37 pm

Thanks for the great how to. It is the best I have seen. Chris Lee is correct is his post here. My red5 install would nnot start after a restart.

Now if soomneone would publish a “how to live stream”

Red5 is horribly undocumented.

Avatar

Mark

September 7th, 2009 at 5:20 pm

Anyone know why I see

[INFO] [NioProcessor-1] org.red5.server.net.rtmp.RTMPHandler – Scope oflaDemo not found on 67.19.107.126
[WARN] [Red5_Scheduler_Worker-5] org.red5.server.net.rtmp.RTMPConnection – Closing RTMPMinaConnection from 189.182.27.62 : 3239 to 67.19.107.126 (in: 3266 out 3215 ), with id 6997525 due to long handshake

after this install?

Also, why must I enter
export RED5_HOME=/usr/share/red5/
at the terminal every time before starting the server?

should the oflaDemo install a folder in webappps?

I have been all over the net and find no answers.

Thanks

Avatar

Mark

September 7th, 2009 at 5:21 pm

I forgot that in my last post that is attempting to connect with FME 2.5

Avatar

How To articles on setting up Red5 « Dominick Accattato, CTO Infrared5

January 14th, 2010 at 10:50 am

Avatar

stuart

January 19th, 2010 at 9:31 am

I can´t read grey lettering on a grey background in the name and email boxes of this form! Wierd. However, a great walkthrough that worked for me. One problem I had was my Ubuntu 9.04 to 9.10 upgrade had left java dependencies in a bit of a mess and I had to clear and reinstall. Also, the compile failed unless I was SU (´could not create directory´). About to do a restart and will see if it survives.

Avatar

sghael

January 19th, 2010 at 11:46 pm

thanks for pointing out the styling issue on comment forms… fixed now. Did the Red5 process survive a restart?

Avatar

Red5 Flash Streaming Server installieren » Server » Debian Root

February 5th, 2010 at 1:37 pm

[...] Installationsanleitung auf Ubuntu #2 [...]

Avatar

u4david

February 5th, 2010 at 11:05 pm

It was pleasant experience even with the mix tape (http://spectrumzero.com/dj_trainwreck/djtrainwreck_story.html) playing in back ground.

This is the type of know how what makes my linux world rock.

Thank you.
Ps:
do not forget to open up ports:
http://www.dervishmoose.com/post.cfm/list-of-red-5-server-port-openings-for-firewall
Default ports:
1935,8088,5080,1936
RTMP: 1935
RTMPT: 8088
HTTP servlet engine port: 5080
Debug proxy port: 1936

Avatar

u4david

February 7th, 2010 at 2:21 pm

to fix this error after reboot of the system when restarting the red5:

Exception in thread “main” java.lang.NoClassDefFoundError: org/red5/
server/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
332)
Could not find the main class: org.red5.server.Bootstrap. Program will
exit.

To fix this go to red5.Download your versions ZIP red5 and replace your boot.jar with the one in the zipped verzion.
No need to make it executable just upload it overwrite the original with the one from the zipped folder.

Wonder what is up with that anyway (backup the original file just in case)

Comment Form

top