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’:



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



  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.



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



  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:



  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.



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




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




    And to confirm, connect to port 5080 via telnet:



  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.

28 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)

Avatar

horse

March 9th, 2010 at 1:01 pm

It Works!!!!!

——————————————————————
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.13/
——————————————————————
i have export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15/
——————————————————————

Avatar

Redsky

April 5th, 2010 at 6:02 pm

I still have problem with running it. I am using Ubuntu Server 9.10 32-bit. When I run it with: /usr/share/red5/red5.sh
It gives me the error “u4david” posted about:

redsky@abserver:~$ /usr/share/red5/red5.sh
Running on Linux
Starting Red5
Exception in thread “main” java.lang.NoClassDefFoundError: org/red5/sertrap
Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320
Could not find the main class: org.red5.server.Bootstrap. Program will exit.

I followed tutorial on this site, then tried to replace my boot.jar with boot.jar from newest release from: http://code.google.com/p/red5/
But I don’t know what version is installed on my server so I don’t know which boot.jar file should I use.

If someone knows the solution to my problem, please help me :|

Best regards

Avatar

Redsky

April 6th, 2010 at 10:34 pm

Hi again,

It looks like I have solved my problem.

In this point of tutorial:

svn co http://red5.googlecode.com/svn/java/server/trunk red5

I used url of stable version of red5 instead of the newest:

svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1 red5

When I run: /usr/share/red5/red5.sh

It says something about installer creation complete and I use Ctrl+C to get back to command line.

Then I am checking ports with: netstat -ant
and ports 1935 and 5080 have “LISTEN” on the right.

Next I am trying to connect to port 5080 with telnet: telnet localhost 5080
Everything is ok.

But here comes another problem.
When I am going in my browser to http://my-ip:5080/ it can’t connect at all.
It works ok without :5080 so http://my-ip/

I am using router so I guess I have to forward some ports for RED5 to work properly.

So I forwarded 4 ports to local ip of my server:

RTMP: 1935
RTMPT: 8088
HTTP servlet engine port: 5080
Debug proxy port: 1936

And I still can’t connect with http://my-ip:5080/ :| Help

Avatar

Redsky

April 7th, 2010 at 10:10 pm

Yay it works! :D

It was firewall. I disabled Shorewall firewall and everything is up and running.

Good luck guys :)

Avatar

Baduy

April 28th, 2010 at 7:47 pm

How to running php from red5 server and how to make red5 server executable so we do need to starting manually, anyone can help?
thanks for advance

Avatar

Brian Wallace

May 8th, 2010 at 4:35 am

add this to your crontab Mate… ( works like a charm )

@reboot cd /usr/local/red5/ ; ./red5.sh & >/dev/null 2>&1

Just replace the cd /path/to/your/path

Thanks, Webmaster at LinuxTuts ( http://www.linuxtuts.net )

Avatar

Problem installing red5 media server

May 24th, 2010 at 3:05 pm

[...] with java. I am running Ubuntu 10.04 and have been using this tutorial from an older Ubuntu version Getting RED 5 up and running on Ubuntu 9.04 | Sandeep Ghael When I get to this command /usr/share/red5/red5.sh & I get this error: Starting Red5 [...]

Avatar

chief

May 25th, 2010 at 7:46 pm

I am using Ubuntu 10.04 and cannot get it to work. I believe all I have installed all of the necessary necessary files.

I used this: svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1 red5

and

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.20

but I am stilling getting this

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:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.red5.server.Bootstrap. Program will exit.

I also tried replaced boot.jar file with the one in the 0.9.1 zip file but still this same error came up.

Avatar

chief

May 26th, 2010 at 6:55 pm

I got it working.

Install(the easy way) on Ubuntu 10.04:

1)Install all the libraries listed above. updatedb is deprecated, but that is fine.

2)Download the current .tar file

3)Extract into a directory.(I used my home directory)

4) cd red5directory

5) sh red5.sh

6) localhost:5080

Avatar

Tapas Mishra

June 14th, 2010 at 5:17 am

I noticed if I run it /usr/share/red5/red5.sh then it wont run.
But if you do a cd /usr/share/red5/ and then ./red5.sh then it will start.

Avatar

Francesco R.

June 16th, 2010 at 3:07 pm

Great!
THANK YOU so much!!!

Avatar

Pankaj Dangi

September 25th, 2010 at 3:13 pm

Avatar

Miki

September 25th, 2010 at 3:15 pm

Can someone help me with script for Red5 autostart on bootstrap???

I can’t run red5 by typing /usr/share/red5/ red5.sh & ?! that dont work but I can run if I first get into /usr/share/red directory and after that run ./red5.sh

I dont know how can I make script for autostart..I am linux beginner :( and all script I did find dont work for my ubuntu 8.04

Avatar

Suryakant Maurya

February 3rd, 2011 at 6:27 am

Thanks a lot. I install red5 server in ubuntu 10.10 version.

Avatar

Ali

February 22nd, 2011 at 10:24 am

Hi,

I already have a apache server but for Red5 I need to install Apache Ant, but I dont want to replace my apache server with another version!

it seems for this case I have to asign an IP address for Ant server, but I don’t know how can I do that?!

I would appreciate your help and your advice.

Ali

Avatar

Atul

May 4th, 2011 at 1:14 am

Hello ,

I tried to install Red5 on Ubuntu server using the steps given in below url-
http://sandeepghael.com/2009/07/getting-red-5-up-and-running-on-ubuntu-9-04/

I followed all the steps but when i try to access the page using
http://myip:5080/ i am not able to connect.

Browser says –
The connection has timed out
The server is taking too long to respond.

I have even disabled the firewall. But still haven’t got the desired output.

Can anyone please let me know what might be the issue?
Your quick response will be really helpful.

Thanks,
Atul

Comment Form

top