For Fedora:
1. Install Java (JDK)
2. Install Ant
Extract apache-ant-[VERSION]-bin.tar.gz to /usr/ant/
3. Export variables
export ANT_HOME=/usr/ant/
export JAVA_HOME=/usr/java/latest/
export _JAVA_OPTIONS="-Xmx64m"
4. Install Red5
svn export http://red5.googlecode.com/svn/java/server/trunk/ /opt/red5/
cd /opt/red5/
ant
5. Setup iptables
# Red5 RTMP
-A INPUT -p tcp -m tcp --dport 1935 -j ACCEPT
# Red5 RTMPT
-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT
# Red5 HTTP servlet engine port
-A INPUT -p tcp -m tcp --dport 5080 -j ACCEPT
# Red5 Debug proxy port
-A INPUT -p tcp -m tcp --dport 1936 -j ACCEPT
6. Test Red5
cd /opt/red5/dist/
./red5.sh &
Be patient, Red5 needs a looooooong time to start.
Use "top" to check if "java" is running.
Visit http://[SERVER]:5080
7. Add init script
/etc/init.d/red5
1. Install Java (JDK)
2. Install Ant
Extract apache-ant-[VERSION]-bin.tar.gz to /usr/ant/
3. Export variables
export ANT_HOME=/usr/ant/
export JAVA_HOME=/usr/java/latest/
export _JAVA_OPTIONS="-Xmx64m"
4. Install Red5
svn export http://red5.googlecode.com/svn/java/server/trunk/ /opt/red5/
cd /opt/red5/
ant
5. Setup iptables
# Red5 RTMP
-A INPUT -p tcp -m tcp --dport 1935 -j ACCEPT
# Red5 RTMPT
-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT
# Red5 HTTP servlet engine port
-A INPUT -p tcp -m tcp --dport 5080 -j ACCEPT
# Red5 Debug proxy port
-A INPUT -p tcp -m tcp --dport 1936 -j ACCEPT
6. Test Red5
cd /opt/red5/dist/
./red5.sh &
Be patient, Red5 needs a looooooong time to start.
Use "top" to check if "java" is running.
Visit http://[SERVER]:5080
7. Add init script
/etc/init.d/red5
QUOTE |
#!/bin/sh # For RedHat and cousins: # chkconfig: 2345 85 85 # description: Red5 flash streaming server # processname: red5 PROG=red5 RED5_HOME=/opt/red5/dist DAEMON=$RED5_HOME/$PROG.sh PIDFILE=/var/run/$PROG.pid export ANT_HOME=/usr/ant/ export JAVA_HOME=/usr/java/latest/ export _JAVA_OPTIONS="-Xmx64m" # Source function library . /etc/rc.d/init.d/functions [ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5 RETVAL=0 case "$1" in start) echo -n $"Starting $PROG: " cd $RED5_HOME $DAEMON >/dev/null 2>/dev/null & RETVAL=$? if [ $RETVAL -eq 0 ]; then echo $! > $PIDFILE touch /var/lock/subsys/$PROG fi [ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup" echo ;; stop) echo -n $"Shutting down $PROG: " killproc -p $PIDFILE RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG ;; restart) $0 stop $0 start ;; status) status $PROG -p $PIDFILE RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|status}" RETVAL=1 esac exit $RETVAL |
For Debian:
Similar to above.
1 & 2. Install Java and Ant (non-free packages)
aptitude install sun-java6-jdk ant
3. Skip this step
7. Add init script
/etc/init.d/red5
QUOTE |
# #!/bin/sh -e # # Startup script for Red5 export RED5_HOME=/opt/red5/dist start_red5="$RED5_HOME/red5.sh start" stop_red5="$RED5_HOME/red5_shutdown.sh stop" start() { echo -n "Starting Red5: " ${start_red5} echo "done." } stop() { echo -n "Shutting down Red5: " ${stop_red5} echo "done." } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0 |
Comments
Post a Comment