歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 14.04下Red5源碼編譯

Ubuntu 14.04下Red5源碼編譯

日期:2017/2/28 14:27:05   编辑:Linux教程

編譯環境:Ubuntu14.04/JDK7

RHEL5 流媒體服務器的搭建--Red5 http://www.linuxidc.com//Linux/2010-03/25162.htm

在RHEL6.4下安裝Red5 http://www.linuxidc.com/Linux/2013-07/87728.htm

Linux環境下安裝Red5 0.7 流媒體服務器 http://www.linuxidc.com//Linux/2008-04/12293.htm

Ubuntu下Red5出現HTTP ERROR:404錯誤的解決方案 http://www.linuxidc.com//Linux/2008-05/13083.htm

如何在 Linux 服務器上安裝 Red5? http://www.linuxidc.com//Linux/2012-06/63015.htm

使用 Eclipse 創建第一個 Red5 應用程序示例 - 使用 Red5 在線錄制視頻 http://www.linuxidc.com//Linux/2012-06/63023.htm

步驟:

1、svn檢出源碼(兩種方式)

svn co --depth empty https://github.com/Red5/red5-server (最新版)

svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5-read-only(我使用的是這個1.0.2-RC4版)

2、編譯,跳過test

mvn -Dmaven.test.skip=true install

編譯結果如下:

[INFO] Installing /home/linuxidc/wmw/red5-google/red5-read-only/target/red5-server-1.0.2-RC4-sources.jar to /home/linuxidc/.m2/repository/org/red5/red5-server/1.0.2-RC4/red5-server-1.0.2-RC4-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:21.353s
[INFO] Finished at: Wed Oct 15 09:34:22 CST 2014
[INFO] Final Memory: 16M/40M
[INFO] ------------------------------------------------------------------------

進去看看都有什麼:

[email protected]:~/wmw/red5-google/red5-read-only$ ls
build.properties license.txt pom.xml src target
[email protected]:~/wmw/red5-google/red5-read-only$ cd target/
[email protected]:~/wmw/red5-google/red5-read-only/target$ ls
apidocs <span >red5-server-1.0.2-RC4-bootstrap.jar</span>
archive-tmp <span >red5-server-1.0.2-RC4.jar</span>
classes red5-server-1.0.2-RC4-javadoc.jar
generated-sources <span > red5-server-1.0.2-RC4-server.tar.gz</span>
javadoc-bundle-options red5-server-1.0.2-RC4-server.zip
lib red5-server-1.0.2-RC4-sources.jar
maven-archiver test-classes

red5-server-1.0.2-RC4-server.tar.gz 這個就是我們編譯後的red5-server了,先解壓看一下:

[email protected]:~/wmw/red5-google/red5-read-only/target/red5-server-1.0.2-RC4$ ls -l
總用量 852
drwxrwxr-x 2 linuxidc walfred 4096 10月 15 09:35 conf
drwxrwxr-x 2 linuxidc walfred 4096 10月 15 09:35 lib
-rw-rw-r-- 1 linuxidc walfred 1324 10月 15 09:15 license.txt
drwxrwxr-x 2 linuxidc walfred 4096 10月 15 09:35 plugins
-rw-rw-r-- 1 linuxidc walfred 1421 10月 15 09:21 red5.bat
-rw-rw-r-- 1 linuxidc walfred 168 10月 15 09:21 red5-debug.bat
-rwxr-xr-x 1 linuxidc walfred 220 10月 15 09:33 red5-debug.sh
-rw-rw-r-- 1 linuxidc walfred 1383 10月 15 09:21 red5-highperf.bat
-rwxr-xr-x 1 linuxidc walfred 622 10月 15 09:33 red5-highperf.sh
-rw-rw-r-- 1 linuxidc walfred 21745 10月 15 09:33 red5-server-bootstrap.jar
-rw-rw-r-- 1 linuxidc walfred 793004 10月 15 09:33 red5-server.jar
-rwxr-xr-x 1 linuxidc walfred 1670 10月 15 09:33 red5.sh
-rw-rw-r-- 1 linuxidc walfred 308 10月 15 09:21 red5-shutdown.bat
-rwxr-xr-x 1 linuxidc walfred 344 10月 15 09:33 red5-shutdown.sh
drwxrwxr-x 6 linuxidc walfred 4096 10月 15 09:35 webapps

運行red5.sh

[INFO] [Launcher:/installer] org.red5.server.Context - Setting parent bean factory as core
[INFO] [Launcher:/installer] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:live] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:vod] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:/] org.red5.server.scope.WebScope - Set server [Server@1e3695map[[empty]]]
[INFO] [Launcher:/installer] org.red5.server.Server - Add mapping global: default host: localhost context: installer
[INFO] [Launcher:live] org.red5.server.Server - Add mapping global: default host: context: live
[INFO] [Launcher:vod] org.red5.server.Server - Add mapping global: default host: context: vod
[INFO] [Launcher:/] org.red5.server.Server - Add mapping global: default host: context:
[WARN] [Launcher:/] org.red5.server.scope.Scope - Invalid scope rejected: Scope [name=, path=/default, type=APPLICATION, autoStart=true, creationTime=1413342261664, depth=1, enabled=true, running=false]
[WARN] [Launcher:/] org.red5.server.scope.Scope - Scope not added to parent
[INFO] [Launcher:/installer] org.red5.server.Server - Add mapping global: default host: localhost:5080 context: installer
[INFO] [Launcher:/installer] org.red5.server.service.Installer - Installer service created

3、下載拷貝依賴關系

[email protected]:~/wmw/red5-google/red5-read-only$ <span >mvn dependency:copy-dependencies</span>

這時候target下會多出一個文件夾 dependency

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Red5 :: Server 1.0.2-RC4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.6:copy-dependencies (default-cli) @ red5-server ---
[INFO] Copying httpclient-4.2.1.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependencytpclient-4.2.1.jar
[INFO] Copying commons-beanutils-1.8.3.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/commons-beanutils-1.8.3.jar
[INFO] Copying spring-beans-3.1.4.RELEASE.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/spring-beans-3.1.4.RELEASE.jar
[INFO] Copying bcprov-jdk15on-1.47.jar to /home/linuxidc/wmw/red5-google/red5-read-only/target/dependency/bcprov-jdk15on-1.47.jar
.....................................
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.703s
[INFO] Finished at: Wed Oct 15 09:36:59 CST 2014
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------

4、打包所有的package,跳過test

mvn -Dmaven.test.skip=true -Dmaven.buildNumber.doUpdate=false package

此時重新生成新的可運行的red5-server-1.0.2-RC4-server.tar.gz

...................................................................................................................[INFO] Building jar: /home/linuxidc/wmw/red5-google/red5-read-only/target/red5-server-1.0.2-RC4-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.994s
[INFO] Finished at: Wed Oct 15 10:01:19 CST 2014
[INFO] Final Memory: 14M/35M
[INFO] ------------------------------------------------------------------------

解壓出來新的red5-server-1.0.2-RC4-server.tar.gz,與之前編譯的進行一次比較,如下圖,主要區別是生成了新的lib庫文件:

5、運行red.sh

[WARN] [Launcher:/] org.red5.server.scope.Scope - Invalid scope rejected: Scope [name=, path=/default, type=APPLICATION, autoStart=true, creationTime=1413341225677, depth=1, enabled=true, running=false]
[WARN] [Launcher:/] org.red5.server.scope.Scope - Scope not added to parent
[INFO] [Launcher:/installer] org.red5.server.service.Installer - Installer service created

ok,finished

Ubuntu 14.04 下載、安裝、配置的相關知識 http://www.linuxidc.com/Linux/2014-04/100370.htm

Ubuntu 14.04系統下載地址:http://www.linuxidc.com/Linux/2014-04/100352.htm

Windows 7下硬盤安裝Ubuntu 14.04圖文教程 http://www.linuxidc.com/Linux/2014-04/100369.htm

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved