Installing Red5 3.5 on Slicehost Ubuntu 8.04.01 Hardy

Red5 is an open source flash server – an alternative to Adobe’s flash media server.

This article details how to install it. It is pulled together from here, here, here and my own experience.

Add multiverse to sources list

1 sudo nano /etc/apt/sources.list
      
1 deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
      2 deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
      3 
      4 deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
      5 deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
      6 
      7 deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
      8 deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
      

Give permissions on iptables

Do the following in your terminal on your slicehost server.

1 # become sudo user
      2 su
      
1 iptables-save > /etc/iptables.up.rules
      
1 nano /etc/iptables.test.rules
      

Paste the following in:

 1 *filter
       2 
       3 
       4 #  Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
       5 -A INPUT -i lo -j ACCEPT
       6 -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
       7 
       8 
       9 #  Accepts all established inbound connections
      10 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
      11 
      12 
      13 #  Allows all outbound traffic
      14 #  You can modify this to only allow certain traffic
      15 -A OUTPUT -j ACCEPT
      16 
      17 
      18 # Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
      19 -A INPUT -p tcp --dport 80 -j ACCEPT
      20 -A INPUT -p tcp --dport 443 -j ACCEPT
      21 
      22 
      23 #  Allows SSH connections
      24 #
      25 # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
      26 # NOTE!!!: BY DEFAULT THIS IS 22, BUT YOU MIGHT HAVE CREATED A CUSTOM PORT. BE CAREFUL ON THIS. MINE HERE IS 22222.
      27 -A INPUT -p tcp -m state --state NEW --dport 22222 -j ACCEPT
      28 
      29 
      30 # Allow ping
      31 -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
      32 
      33 
      34 # log iptables denied calls
      35 -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
      36 
      37 ## ADD THE FOLLOWING FOR RED5
      38 # Subversion
      39 -A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT
      40 
      41 # Red5 RTMP
      42 -A INPUT -p tcp -m tcp --dport 1935 -j ACCEPT
      43 
      44 # Red5 RTMPT
      45 -A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT
      46 
      47 # Red5 HTTP servlet engine port
      48 -A INPUT -p tcp -m tcp --dport 5080 -j ACCEPT
      49 
      50 # Red5 Debug proxy port
      51 -A INPUT -p tcp -m tcp --dport 1936 -j ACCEPT
      52 
      53 COMMIT
      

 1 *filter
2
3
4 # Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn’t use lo0
5 -A INPUT -i lo -j ACCEPT
6 -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
7
8
9 # Accepts all established inbound connections
10 -A INPUT -m state —state ESTABLISHED,RELATED -j ACCEPT
11
12
13 # Allows all outbound traffic
14 # You can modify this to only allow certain traffic
15 -A OUTPUT -j ACCEPT
16
17
18 # Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
19 -A INPUT -p tcp —dport 80 -j ACCEPT
20 -A INPUT -p tcp —dport 443 -j ACCEPT
21
22
23 # Allows SSH connections
24 #
25 # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
26 # NOTE!!!: BY DEFAULT THIS IS 22, BUT YOU MIGHT HAVE CREATED A CUSTOM PORT. BE CAREFUL ON THIS. MINE HERE IS 22222.
27 -A INPUT -p tcp -m state —state NEW —dport 22222 -j ACCEPT
28
29
30 # Allow ping
31 -A INPUT -p icmp -m icmp —icmp-type 8 -j ACCEPT
32
33
34 # log iptables denied calls
35 -A INPUT -m limit —limit 5/min -j LOG —log-prefix "iptables denied: " —log-level 7
36
37 ## ADD THE FOLLOWING FOR RED5
38 # Subversion
39 -A INPUT -p tcp -m tcp —dport 3690 -j ACCEPT
40
41 # Red5 RTMP
42 -A INPUT -p tcp -m tcp —dport 1935 -j ACCEPT
43
44 # Red5 RTMPT
45 -A INPUT -p tcp -m tcp —dport 8088 -j ACCEPT
46
47 # Red5 HTTP servlet engine port
48 -A INPUT -p tcp -m tcp —dport 5080 -j ACCEPT
49
50 # Red5 Debug proxy port
51 -A INPUT -p tcp -m tcp —dport 1936 -j ACCEPT
52
53 COMMIT

1 # saves rules permanently.
      2 iptables-save > /etc/iptables.up.rules
      
1 nano /etc/iptables.test.rules
      

Dependencies

1 apt-get install subversion
      2 apt-get install java-package
      3 apt-get install sun-java6-jdk
      4 apt-get install sun-java6-jre
      5 apt-get install ant
      

Install Red5

 1 mkdir -p ~/svn/red5
       2 cd ~/svn/red5
       3 svn co http://red5.googlecode.com/svn/java/server/trunk red5
       4 
       5 export JAVA_HOME=/usr/lib/jvm/java-6-sun/
       6 export ANT_HOME=/usr/share/ant/
       7 
       8 cd ~/svn/red5/red5
       9 /usr/share/ant/bin/ant
      10 
      11 mkdir /usr/share/red5
      12 cp -R ~/svn/red5/red5/dist/* /usr/share/red5/
      13 
      14 cd /usr/share/red5
      15 chmod 755 red5.sh
      

Start playing with Red5

Browse to http://your-slice-ip:5080/ and watch the video.

Picture of Scott Motte

delicious facebook rss twitter

Spitfire Sky | github | archives | resume