Monday, August 24, 2015

Install Red5 server on CentOS 6.7 (actual for summer 2015)

There are a lot of tutorials, but all of them are old and not correct. This is the fresh one.
1. First, we need to install openjdk.
# yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y



2. Install Ant
cd /usr/local/src
# wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.6-bin.tar.gz
# tar zxvf apache-ant-1.9.6-bin.tar.gz
mv apache-ant-1.9.6/ /usr/local/ant

3. Export paths for all needed software (Java & Ant) 
# export ANT_HOME=/usr/local/ant
# export JAVA_HOME=/usr/lib/jvm/java
# export PATH=$PATH:/usr/local/ant/bin
# export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
# echo "export ANT_HOME=/usr/local/ant" >> /etc/bashrc
# echo "export JAVA_HOME=/usr/lib/jvm/java" >> /etc/bashrc
# echo "export PATH=$PATH:/usr/local/ant/bin" >> /etc/bashrc
# echo "export CLASSPATH=.:$JAVA_HOME/lib/classes.zip" >> /etc/bashrc

4. Download and install Red5
# wget http://obed.am/red5-server-1.0.4-RELEASE-server.tar.gz
# tar zxvf red5-server-1.0.4-RELEASE-server.tar.gz
# mv /usr/local/src/red5-server-1.0.4-RELEASE /usr/local/red5

5. Download and install init script
# wget -O /etc/init.d/red5 http://obed.am/red5.txt
# chmod +x /etc/init.d/red5


6. Allow connections on red5 ports (5080 and 1935)

# iptables -A INPUT -p tcp -m tcp –dport 5080 -j ACCEPT

# iptables -A INPUT -p tcp -m tcp –dport 1935 -j ACCEPT

7. Now we need to add red5 to autorun

# chkconfig red5 on

8. Red5 Server Command

# /etc/init.d/red5 start
# /etc/init.d/red5 stop
# /etc/init.d/red5 status
9. Test the result
Go to http://yourserver.com:5080/demos/ofla_demo.html to test Red5 Server over RTMP

That's all. Feel free to ask anything. 
#red5 #java #linux #centos #flash #streaming #rtmp

51 comments:

  1. Do you have a guide for centos 7?

    ReplyDelete
  2. Yes please and can you install wordpress and test videowhisper plugins:
    https://wordpress.org/plugins/search.php?q=videowhisper
    http://www.videowhisper.com/?p=RTMP+Applications

    ReplyDelete
    Replies
    1. dear friend, videowhisper isn't compatible with the latest versions of red5

      Delete
    2. I got videowhisper to work with red5.

      http://www.videowhisper.com/?p=RTMP+Applications

      These PHP default setting values are required by this software:
      + error_reporting E_ALL ^ E_NOTICE
      + short_open_tag On
      + safe mode Off (if using older php, as fuction is deprecated in PHP 5.3 and removed in PHP 5.4)
      + open_basedir restrictions should allow accessing CMS configuration and libraries (depending on integration)
      + scripts require write permissions on certain files and folders (to store snapshots, chat logs, sessions) depending on edition

      Delete
  3. can you make one on ubuntu 14.04

    ReplyDelete
    Replies
    1. In 2 hours i'll finish centos7 how-to, tomorrow will prepare ubuntu 14.04

      Delete
  4. iptables -A INPUT -p tcp -m tcp –dport 5080 -j ACCEPT
    Bad argument `–dport'

    any ideas :-(

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. please use double -, i mean --dport

      Delete
    3. This worked, thanks. Then option `-m' requires an argument occurred

      Delete
    4. Its empty huh. # iptables -L
      Chain INPUT (policy ACCEPT)
      target prot opt source destination

      Chain FORWARD (policy ACCEPT)
      target prot opt source destination

      Chain OUTPUT (policy ACCEPT)
      target prot opt source destination

      Delete
    5. heh. so you don't need to open ports )

      Delete
    6. RTMP default port - 1935 seems to be opened. (tested with http://202.29.13.250/port_tester.html). Others failed

      Delete
    7. Any ideas why demos wouldn't work then?
      When I click connect on ofla_demo.html I get:
      (132) Connections: true | true
      (7257) connected?: true
      (7268) NetConnection.onStatus:
      level = error
      code = NetConnection.Connect.Failed

      Delete
    8. do you stream something to your red5 server ?

      Delete
    9. Nothing yet. I'm just trying to get the demos working and figure out how everything works, then use HDFVR+Red5 to record/stream via html/js

      Delete
    10. What about your operation system? Also show me your
      netstat -anp | grep LISTEN

      Delete
    11. It's CentOS VPS server and 1935 seems to be there in netstat.

      tcp 0 0 :::1935 :::* LISTEN 9883/java

      Delete
    12. Also,

      tcp 0 0 :::5080 :::* LISTEN 9883/java

      Delete
    13. iptables -A INPUT -p tcp -m tcp -d 5080 -j ACCEPT

      Delete
  5. just opening ports is my problem:-(

    ReplyDelete
  6. Hi, why you do not use v1.0.7 or latest stable 1,0,6

    ReplyDelete
  7. Can you tell me how to install hls plugin for red5?
    the guide on git shows for ubuntu but i am using centos

    ReplyDelete
  8. Did you do one for ubuntu / debian yet?

    ReplyDelete
  9. Thanks for your nice tutorial! Do you make a tut about red5 and HLS plugin?

    ReplyDelete
  10. am wondering if red5 i.0.6 will work with videowhipser on centos7

    ReplyDelete
  11. bro this red5 1.0.4 red link not working :(

    ReplyDelete
  12. bro this link no working http://obed.am/red5-server-1.0.4-RELEASE-server.tar.gz

    ReplyDelete
  13. bro this link no working http://obed.am/red5-server-1.0.4-RELEASE-server.tar.gz

    ReplyDelete
    Replies
    1. Guys calm down. i will restore download links today!

      Delete
  14. wget http://obed.am/red5-server-1.0.4-RELEASE-server.tar.gz
    --2016-05-23 11:14:05-- http://obed.am/red5-server-1.0.4-RELEASE-server.tar.gz
    Resolving obed.am (obed.am)... failed: Name or service not known.
    wget: unable to resolve host address ‘obed.am’

    ReplyDelete
    Replies
    1. Guys calm down. i will restore download links today!

      Delete
  15. Guys calm down. i will restore download links today!

    ReplyDelete
  16. Is it possible to install admin panel on it?

    ReplyDelete