网站建设和成本,网络营销方式变化背后的逻辑与趋势,做网站容易挣钱吗,华为云自助建站好不好在网上看了不少安装red5-server的方法#xff0c;在我电脑上都好像安装不成功#xff0c;本来是很简单的事#xff0c;因为刚接触#xff0c;结果费了不少时间。这里整理出ubuntu16.04 成功安装的方法#xff0c;以便给搭建一个参考。 #xff08;一#xff09;安装JDK … 在网上看了不少安装red5-server的方法在我电脑上都好像安装不成功本来是很简单的事因为刚接触结果费了不少时间。这里整理出ubuntu16.04 成功安装的方法以便给搭建一个参考。 一安装JDK 1. 终端输入apt-cache search openjdk 运行结果
licaibiaolcb:~/test/RTMP$ sudo apt-cache search openjdk
[sudo] password for licaibiao:
Sorry, try again.
[sudo] password for licaibiao:
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (document
default-jdk-headless - Standard Java or Java compatible Development Kit (hea
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
openjdk-8-jdk - OpenJDK Development Kit (JDK)
openjdk-8-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-8-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
openjdk-8-source - OpenJDK Development Kit (JDK) source files
icedtea-8-plugin - web browser plugin based on OpenJDK and IcedTea to execut
jtreg - Regression Test Harness for the OpenJDK platform
libhsdis0-fcml - HotSpot disassembler plugin using FCML
libreoffice - office productivity suite (metapackage)
openjdk-8-jre-dcevm - Alternative VM for OpenJDK 8 with enhanced class redef
openjdk-8-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openjdk-9-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-9-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-9-doc - OpenJDK Development Kit (JDK) documentation
openjdk-9-jdk - OpenJDK Development Kit (JDK)
openjdk-9-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-9-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-9-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-9-source - OpenJDK Development Kit (JDK) source files
uwsgi-app-integration-plugins - plugins for integration of uWSGI and applica
uwsgi-plugin-jvm-openjdk-8 - Java plugin for uWSGI (OpenJDK 7)
uwsgi-plugin-jwsgi-openjdk-8 - JWSGI plugin for uWSGI (OpenJDK 7)
uwsgi-plugin-ring-openjdk-8 - Closure/Ring plugin for uWSGI (OpenJDK 7)
uwsgi-plugin-servlet-openjdk-8 - JWSGI plugin for uWSGI (OpenJDK 7)
java-package - Utility for creating Java Debian packages2.这里我们安装openjdk-8-jdk因为我安装openjdk-9-jdk的时候有出错。 运行安装命令
sudo apt-get install openjdk-8-jdk 3.测试是否安装成功java -version
licaibiaolcb:~$ java -version
openjdk version 1.8.0_121
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode) 4.配置java_home变量: 运行echo export JAVA_HOME/usr/lib/jvm/java-8-openjdk-amd64/~/.bashrc 添加变量 source .bashrc 使变量生效
licaibiaolcb:~$ $JAVA_HOME
licaibiaolcb:~$ echo export JAVA_HOME/usr/lib/jvm/java-8-openjdk-amd64/~/.bashrc
licaibiaolcb:~$ $JAVA_HOME
licaibiaolcb:~$ source .bashrc
licaibiaolcb:~$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64/二安装red5 1.下载red5 linux 安装包https://github.com/Red5/red5-server/releases 国外网站下载很慢 我这里提供一个已经下载好的安装包red5-server-1.0.9-M6 2.创建目录 mkdir -p /usr/share/red5 3.设置环境变量 export RED5_HOME/usr/share/red5 4.将安装包解压到目录 /usr/share/red5 5. 开始运行red5 cd /usr/share/red5 ./red5.sh 6.结束运行red5 cd /usr/share/red5 ./red5-shutdown.sh
安装结束
测试red5是否安装成功 1运行red5 2浏览器输入本地IP:5080 比如我的IP地址为192.168.0.6则输入http://192.168.0.6:5080/ 出现下面界面表示安装成功。 附启动脚本
Configure init script
#!/bin/sh
#
# /etc/init.d/red5 -- startup script for the red5 server
#
# Based on the tomcat6 init script.
# Written by Miquel van Smoorenburg miquelscistron.nl.
# Modified for Ubuntu red5 by Fred Dixon ffdixonbigbluebutton.org
# Modified for Debian GNU/Linux by Ian Murdock imurdockgnu.ai.mit.edu.
# Modified for Tomcat by Stefan Gybas sgybasdebian.org.
# Modified for Tomcat6 by Thierry Carrez thierry.carrezubuntu.com.
#
### BEGIN INIT INFO
# Provides: red5
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Start red5.
# Description: Start the red5 service.
### END INIT INFOset -e PATH/bin:/usr/bin:/sbin:/usr/sbin
NAMEred5
DESCRed5 Server
RED5_HOME/mnt/opt/$NAME
DEFAULT/etc/default/$NAME
UMASK0002# These variables are needed by Xuggler
export XUGGLE_HOME/usr/local
export PATH$PATH:$XUGGLE_HOME/bin
export LD_LIBRARY_PATH$XUGGLE_HOME/lib:$LD_LIBRARY_PATHif [ id -u -ne 0 ]; thenecho You need root privileges to run this scriptexit 1
fi# Make sure red5 is started with system locale
if [ -r /etc/default/locale ]; then. /etc/default/localeexport LANG
fi. /lib/lsb/init-functions
. /etc/default/rcS# The following variables can be overwritten in $DEFAULT# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
# defined in $DEFAULT)
JDK_DIRS/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm# Look for the right JVM to use
for jdir in $JDK_DIRS; doif [ -r $jdir/bin/java -a -z ${JAVA_HOME} ]; thenJAVA_HOME$jdirfi
done
export JAVA_HOME# Output file
if [ -z $OUT_FILE ]; thenOUT_FILE/var/log/red5.out
fi# End of variables that can be overwritten in $DEFAULT# overwrite settings from default file
if [ -f $DEFAULT ]; then. $DEFAULT
fiif [ ! -f $RED5_HOME/red5.jar ]; thenlog_failure_msg $NAME is not installedexit 1
fi#
# Function to wait if there are connections still open for 1935. Some browsers hang on to a connection
# that prevents a ./red5 restart from binding to port 1935
#
wait_1935_close () {ACTIVE$(netstat -ant | grep 1935 | wc | awk -F {print $1})if [ $ACTIVE ! 0 ]; thenecho -n Waiting for $ACTIVE connections on 1935 to close before starting Red5 while [ $ACTIVE ! 0 ]; doecho -n .sleep 5ACTIVE$(netstat -ant | grep 1935 | wc | awk -F {print $1})donefiecho
}# Define other required variables
RED5_PID/var/run/$NAME.pidRED5_MAINCLASSorg.red5.server.Bootstrap
RED5_CLASSPATH$RED5_HOME/boot.jar:$RED5_HOME/conf:$RED5_HOME/lib/ejb3-persistence.jar
JAVA_OPTS-Dpython.homelib -Xms128M -Xmx128M -Dred5.root$RED5_HOME -Dlogback.ContextSelectororg.red5.logging.LoggingContextSelector -Dcatalina.useNamingtrue -Djava.security.debugfailure -cp $RED5_CLASSPATH org.red5.server.Bootstrapcase $1 instart)if [ -z $JAVA_HOME ]; thenlog_failure_msg no JDK found - please set JAVA_HOMEexit 1fiif [ ! -d $RED5_HOME/conf ]; thenlog_failure_msg invalid RED5_HOME: $RED5_HOMEexit 1filog_daemon_msg Starting $DESC $NAMEif start-stop-daemon --start --test --pidfile $RED5_PID \--startas $JAVA_HOME/bin/java \/dev/null; thenwait_1935_closestart-stop-daemon --start --background --make-pidfile --chuid red5 --umask $UMASK \--chdir $RED5_HOME --pidfile $RED5_PID --startas $JAVA_HOME/bin/java -- $JAVA_OPTSsleep 5# Because we pushed it into the background, we need to check its statusif start-stop-daemon --test --start --pidfile $RED5_PID --startas $JAVA_HOME/bin/java /dev/null; thenlog_end_msg 1elselog_end_msg 0fielselog_progress_msg (already running)log_end_msg 0fi;;stop)log_daemon_msg Stopping $DESC $NAMEif start-stop-daemon --start --test --pidfile $RED5_PID \--startas $JAVA_HOME/bin/java \/dev/null; thenlog_progress_msg (not running)elsestart-stop-daemon --stop --pidfile $RED5_PID \--startas $JAVA_HOME/bin/javasleep 5rm -f $RED5_PIDfilog_end_msg 0;;status)if start-stop-daemon --start --test --pidfile $RED5_PID \--startas $JAVA_HOME/bin/java \/dev/null; thenif [ -f $RED5_PID ]; thenlog_success_msg $DESC is not running, but pid file exists.exit 1elselog_success_msg $DESC is not running.exit 3fielselog_success_msg $DESC is running with pid cat $RED5_PIDfi;;restart|force-reload)if start-stop-daemon --test --stop --pidfile $RED5_PID \--startas $JAVA_HOME/bin/java \/dev/null; then$0 stopsleep 1fi$0 start;;*)log_success_msg Usage: $0 {start|stop|restart|force-reload|status}exit 1;;
esacexit 0