1) install the Java 6 Environment
You can use yum directly.
1
Yum-y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
2) install subversion
To get a proper version, I will use svn and install svn first:
1
Yum install svn
It depends on whether your release source is available. If I do not, I will use it.
1
Yum install subversion
3) install ant, ivy, and apache Projects
It should be noted that yum can install ant, but it is always faulty after installation. It may be incomplete!
You can also download the project file and put the source file under the src directory of usr:
1
Cd/usr/src
2
Wget http://mirrors.isu.net.sa/pub/apache//ant/binaries/apache-ant-1.8.2-bin.tar.bz2
3
Tar jxvf apache-ant-1.8.2-bin.tar.bz2
4
Mv apache-ant-1.8.2/usr/local/ant
5
Svn co https://svn.apache.org/repos/asf/ant/ivy/core/trunk (ivy)
4) modify the environment configuration because ant is used for compilation below
Set variables for Ant and Java at the end of/etc/profile
1
Export ANT_HOME =/usr/local/ant
2
Export JAVA_HOME =/usr/lib/jvm/java
3
Export PATH = $ PATH:/usr/local/ant/bin
4
Export CLASSPATH =.: $ JAVA_HOME/lib/classes.zip
5
Save
6
Restart reboot
5) Compile ivy jar
1
Cd/usr/local/ant/ivy
2
Ant jar
3
Cp build/artifact/jars/ivy. jar/usr/local/ant/lib/
6) Write environment variables for shell configuration to facilitate later use of ant and java
1
Echo "export ANT_HOME =/usr/local/ant">/etc/bashrc
2
Echo "export JAVA_HOME =/usr/lib/jvm/java">/etc/bashrc
3
Echo "export PATH = $ PATH:/usr/local/ant/bin">/etc/bashrc
7) download and install red5
1
Cd/usr/src
2
Svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
3
Mv red5/usr/local/
4
Cd/usr/local/red5
5
Ant prepare
6
Ant dist
If build successful appears at the end, it indicates the operation is SUCCESSFUL.
8) copy and initialize the configuration file.
1
Cp-r dist/conf.
2
./Red5.sh
The Installer service created is displayed, indicating that the operation is successful. Press ctrl + C to stop the operation.
9) configure system services
Vi/etc/init. d/red5
01
#! /Bin/sh
02
# For RedHat and cousins:
03
# Chkconfig: 2345 85
04
# Description: Red5 flash streaming server
05
# Processname: red5
06
PROG = red5
07
RED5_HOME =/usr/local/red5
08
DAEMON = $ RED5_HOME/$ PROG. sh
09
PIDFILE =/var/run/$ PROG. pid
10
# Source function library
11
./Etc/rc. d/init. d/functions
12
[-R/etc/sysconfig/red5] &./etc/sysconfig/red5
13
RETVAL = 0
14
Case "$1" in
15
Start)
16
Echo-n $ "Starting $ PROG :"
17
Cd $ RED5_HOME
18
$ DAEMON>/dev/null 2>/dev/null &
19
RETVAL =$?
20
If [$ RETVAL-eq 0]; then
21
Echo $! > $ PIDFILE
22
Touch/var/lock/subsys/$ PROG
23
Fi
24
[$ RETVAL-eq 0] & success $ "$ PROG startup" | failure $ "$ PROG startup"
25
Echo
26
;;
27
Stop)
28
Echo-n $ "Shutting down $ PROG :"
29
Killproc-p $ PIDFILE
30
RETVAL =$?
31
Echo
32
[$ RETVAL-eq 0] & rm-f/var/lock/subsys/$ PROG
33
;;
34
Restart)
35
$0 stop
36
$0 start
37
;;
38
Status)
39
Status $ PROG-p $ PIDFILE
40
RETVAL =$?
41
;;
42
*)
43
Echo $ "Usage: $0 {start | stop | restart | status }"
44
RETVAL = 1
45
Esac
46
Exit $ RETVAL
Or wget http://www.sohailriaz.com/downloads/red5.txt
10) grant the running permission
1
Chmod + x/etc/init. d/red5
11) install and start the service
1
/Sbin/chkconfig -- add red5
2
/Sbin/chkconfig red5 on
3
/Sbin/service red5 start
12) Detection System
1
/Etc/init. d/red5 status
When you access http: // IP: 5080 on the webpage, the installation and configuration are successful!
13) further questions
Http: // ip: 5080/demos/port_tester.html
Test the port status of the website. If it is found to be all failed, there may be a problem:
01
But if you went to port_tester.swf using demos above or your application shows connections FAILS, this is an issue of RTMPT and RTMPTS. You can see it by running
02
/Usr/local/red5/red5.sh
03
Output trancated
04
[INFO] [main] org. red5.server. tomcat. TomcatLoader-RTMPT server bean was not found
05
[INFO] [main] org. red5.server. tomcat. TomcatLoader-RTMPS server bean was not found
06
Output truncated
07
If you see this you have to uncomment the RTMPT and RTMPTS TomcatLoader in/usr/local/red5/conf/red5-core.xml
08
Vi/usr/local/red5/conf/red5-core.xml
09
Search for a lines
10
<! -RTMPT->
11
<! -
12
<Bean id = "rtmpt. server" class = "org.red5.server.net. rtmpt. TomcatRTMPTLoader" init-method = "init" lazy-init = "true">
13
Remove the <! -From start of <bean and-> from end
14
Same goes for RTMPS
15
<! -RTMPS->
16
<! -
17
<Bean id = "rtmps. server" class = "org.red5.server.net. rtmps. TomcatRTMPSLoader" init-method = "init" lazy-init = "true">
18
Remove the <! -From start of <bean and-> from end
19
Restart the red5 services and connection fails problem will be fixed.
20
If you any question please use comments.
14) set a firewall
Add the following content to the/etc/sysconfig/iptables file:
1
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 1935-j ACCEPT-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 5080- j ACCEPT
Restart Firewall
1
/Sbin/service iptables restart
Check whether the port is open
1
/Sbin/iptables-L-n
15) further test
* Note: All the demos in Red5 must be installed before they can run normally.
Download http://red5.googlecode.com/files/admin.jsp
Upload to red5/webapps/root
Download http://red5.googlecode.com/files/AdminPlugin-1.0.zip
Decompress the package to red5/plugins.
Restart Red5/etc/init. d/red5 restart
Accessing http://www.bkjia.com/admin. jsp
From yezi's blog