在网上看了不少安装red5-server的方法,在我电脑上都好像安装不成功,本来是很简单的事,因为刚接触,结果费了不少时间。这里整理出Ubuntu 16.04 成功安装的方法,以便给搭建一个参考。
(一)安装JDK
1. 终端输入:apt-cache search openjdk
运行结果:
linuxidc@linuxidc:~/test/RTMP$ sudo apt-cache search openjdk
[sudo] password for linuxidc:
Sorry, try again.
[sudo] password for linuxidc:
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 packages
2.这里我们安装openjdk-8-jdk,因为我安装openjdk-9-jdk的时候有出错。
运行安装命令:
sudo apt-get install openjdk-8-jdk
3.测试是否安装成功:java -version
linuxidc@linuxidc:~$ 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 使变量生效
linuxidc@linuxidc:~$ $JAVA_HOME
linuxidc@linuxidc:~$ echo export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/">>~/.bashrc
linuxidc@linuxidc:~$ $JAVA_HOME
linuxidc@linuxidc:~$ source .bashrc
linuxidc@linuxidc:~$ 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也可以到Linux公社1号FTP服务器下载
FTP地址:ftp://ftp1.linuxidc.com
用户名:ftp1.linuxidc.com
密码:
在 2017年LinuxIDC.com/9月/Ubuntu 16.04 安装搭建Red5流媒体服务器/
------------------------------------------分割线------------------------------------------
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,则输入::5080/ 出现下面界面表示安装成功。
附启动脚本
Configure init script