File: BuildingRed5.html

package info (click to toggle)
red5 0.9.1-4squeeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,940 kB
  • ctags: 8,350
  • sloc: java: 42,118; xml: 12,170; sh: 269; makefile: 32
file content (93 lines) | stat: -rw-r--r-- 21,625 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Chapter&nbsp;7.&nbsp;Building Red5</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.74.0"><link rel="home" href="index.html" title="Red5 - Reference Documentation"><link rel="up" href="red5-getting-started.html" title="Part&nbsp;I.&nbsp;Getting Started"><link rel="prev" href="Red5Libraries.html" title="Chapter&nbsp;6.&nbsp;Red5 Libraries"><link rel="next" href="ReleasingRed5.html" title="Chapter&nbsp;8.&nbsp;Releasing Red5"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" style="background-color:white;border:none;height:73px;border:1px solid black;"><a style="border:none;" href="http://osflash.org/red5" title="Red5 Open Source Flash Server"><img style="border:none;" src="images/red5-banner.png"></img></a><a style="border:none;" href="http://osflash.org/red5" title="Red5 Open Source Flash Server"><img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/red5-banner-logo.png"></img></a></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="BuildingRed5"></a>Chapter&nbsp;7.&nbsp;Building Red5</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="BuildingRed5BuildEnvironmentSetup"></a>7.1.&nbsp;Build Environment Setup</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5Ant"></a>7.1.1.&nbsp;Ant</h3></div></div></div><p>Apache Ant 1.7 and above is required for building the Red5 project source code. 
				download here 
				<a class="link" href="http://archive.apache.org/dist/ant/binaries/" target="_top">http://archive.apache.org/dist/ant/binaries/</a> 
			</p><p>The path to the ant binary must be on your system PATH environment variable (test by 
				typing ant -version at a system prompt) defined, typically </p><div class="literallayout"><p><br>
PATH=$PATH:/usr/local/ant&nbsp;<br>
</p></div><p>You can check this on windows by typing set PATH or on unix by typing echo $PATH </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5Java"></a>7.1.2.&nbsp;Java</h3></div></div></div><p>Java 1.5 or 1.6 and above is required for running ant, compiling the source and running the 
				Red5 server. </p><p>Download Java 5 
				<a class="link" href="http://java.sun.com/j2se/1.5.0/download.html" target="_top">http://java.sun.com/j2se/1.5.0/download.html</a> 
			</p><p>Download Java 6 
				<a class="link" href="http://java.sun.com/j2se/1.6.0/download.html" target="_top">http://java.sun.com/j2se/1.6.0/download.html</a> 
			</p><p>You must have the environment variables for JAVA_HOME and JAVA_VERSION defined, 
				typically </p><div class="literallayout"><p><br>
JAVA_HOME=C:\development\j2sdk\1.5.0_07&nbsp;JAVA_VERSION=1.5&nbsp;You&nbsp;can&nbsp;check&nbsp;this&nbsp;on&nbsp;<br>
windows&nbsp;by&nbsp;typing&nbsp;set&nbsp;JAVA_HOME&nbsp;or&nbsp;on&nbsp;unix&nbsp;by&nbsp;typing&nbsp;echo&nbsp;$JAVA_HOME&nbsp;<br>
</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5Red5"></a>7.1.3.&nbsp;Red5</h3></div></div></div><p>You must have the environment variables for RED5_HOME defined, 
				typically </p><div class="literallayout"><p><br>
RED5_HOME=/www/red5_server<br>
</p></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../images/admons/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>
				 
				FAILURE TO SETUP YOUR ENVIRONMENT VARIABLES WILL PREVENT YOUR FROM BEING ABLE TO BUILD PROPERLY

</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/admons/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>
				 
				You don't need netbeans or eclipse unless you need an IDE for java. 

				Download Netbeans here [http://www.netbeans.org] 

				Download Eclipse here [http://www.eclipse.org]

</p></td></tr></table></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="BuildingRed5Building"></a>7.2.&nbsp;Building</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5GettingRed5Source"></a>7.2.1.&nbsp;Getting Red5 Source</h3></div></div></div><p>The Red5 source code is available at the 
				<a class="link" href="http://code.google.com/p/red5/" target="_top">google code project page</a> and svn repository.
			</p><div class="orderedlist"><ol type="1"><li><p>With your favourite SVN client check out the source code from svn at this address 
						<a class="link" href="http://red5.googlecode.com/svn/java/server/trunk/" target="_top">http://red5.googlecode.com/svn/java/server/trunk/</a> or 
						<a class="link" href="https://red5.googlecode.com/svn/java/server/trunk/" target="_top">https://red5.googlecode.com/svn/java/server/trunk/</a> if you have a google code login.
					</p></li><li><p>Team members will be added to the google code project group and in your google code login you will find the svn password for committing changes at this address 
						<a class="link" href="http://code.google.com/hosting/settings" target="_top">http://code.google.com/hosting/settings</a>. 
					</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5GettingRed5DemoApplicationsSource"></a>7.2.2.&nbsp;Getting Red5 Demo Applications Source</h3></div></div></div><div class="orderedlist"><ol type="1"><li><p>With your favourite SVN client check out the source code from svn at this address 
						<a class="link" href="http://red5.googlecode.com/svn/java/example/trunk/" target="_top">http://red5.googlecode.com/svn/java/example/trunk/</a> or 
						<a class="link" href="https://red5.googlecode.com/svn/java/example/trunk/" target="_top">https://red5.googlecode.com/svn/java/example/trunk/</a> if you have a google code login.
					</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5GettingRed5FlashDemoSource"></a>7.2.3.&nbsp;Getting Red5 Flash Demo Source</h3></div></div></div><div class="orderedlist"><ol type="1"><li><p>With your favourite SVN client check out the source code from svn at this address 
						<a class="link" href="http://red5.googlecode.com/svn/flash/trunk/" target="_top">http://red5.googlecode.com/svn/flash/trunk/</a> or 
						<a class="link" href="https://red5.googlecode.com/svn/flash/trunk/" target="_top">https://red5.googlecode.com/svn/flash/trunk/</a> if you have a google code login.
					</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5Runningtheantbuild"></a>7.2.4.&nbsp;Running the ant build</h3></div></div></div><p>To build the red5 source simply run the following command from the command line inside 
				the red5 source directory. </p><div class="literallayout"><p><br>
ant&nbsp;dist&nbsp;<br>
</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5CurrentAntTargets"></a>7.2.5.&nbsp;Current Ant Targets</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p>all - Runs clean, prepare, compile, jar, javadoc targets</p></li><li><p>bootstrap - Compile and start the server using the bootstrap class</p></li><li><p>checkout - checks out the Red5 server source (requires svnant.jar)</p></li><li><p>checkout-all - checks out the entire Red5 project sources from the root level to a specified directory</p></li><li><p>clean - cleans up all the files and directories</p></li><li><p>compile - Compiles Red5</p></li><li><p>compile_core - Build Red5 server sources and downloads java 6 dependancies</p></li><li><p>compile_core_compatibility - Build Red5 server sources and downloads java 5 dependancies</p></li><li><p>compile_demos - Copies over the root and installer webapp</p></li><li><p>compile_script - Compiles scripting sources</p></li><li><p>compile_tests - Compiles junit test classes</p></li><li><p>compile_war - Compiles Red5 into a war distribution</p></li><li><p>console - launches a non-SSL jconsole for managing Red5 in JMX.</p></li><li><p>console-ssl - launches a SSL jconsole for managing Red5 in JMX with SSL enabled.</p></li><li><p>doc-all - Generate docbook documentation for html-single, multi html and pdf.</p></li><li><p>doc-clean - Cleans the docbook files.</p></li><li><p>doc-html - Compile reference documentation to chunked html.</p></li><li><p>doc-htmlsingle - Compile reference documentation to single html.</p></li><li><p>doc-pdf - Compile reference documentation to pdf.</p></li><li><p>doc-prepare - Extra preparation for the documentation.</p></li><li><p>dist - Make Binary distribution.</p></li><li><p>dist-archive - Create archive file for distribution.</p></li><li><p>dist-cluster - Create Edge/Origin distribution.</p></li><li><p>dist-debian - Create Debian package.</p></li><li><p>dist-edge - Builds a Red5 edge distribution.</p></li><li><p>dist-origin - Builds a Red5 origin distribution.</p></li><li><p>dist-installer - Make Installer distribution.</p></li><li><p>dist-macosx - Create Mac OSX installer.</p></li><li><p>dist-windows - Create Windows installer.</p></li><li><p>dist-redhat - Create Redhat installer.</p></li><li><p>ivyclear - Clears out the Ivy cache.</p></li><li><p>jar-determine-classpath - Determine classpath for jar file.</p></li><li><p>jar - Make Archive.</p></li><li><p>javadoc - Generate JavaDoc.</p></li><li><p>java6.check - Checks for Java 6. </p></li><li><p>prepare - Prepares for building Red5.</p></li><li><p>server - Compile and start the server.</p></li><li><p>shutdown - Shuts down the running Red5 instance.</p></li><li><p>udp_server - Compile and start experimental UDP server.</p></li><li><p>run-tests - Run JUnit tests and generate HTML reports.</p></li><li><p>run-tests-systemtest - Runs some end-to-end system tests against a test server using a flash client.</p></li><li><p>run-tests-server - Run the selftest server.</p></li><li><p>svn-add - Add files to svn.</p></li><li><p>remotejar - Creates a jar that may be deployed with remote applications.</p></li><li><p>retrieve - Retrieves the libraries if needed.</p></li><li><p>rtmps_keystore - Creates the keystore file in the conf directory required by RTMPS.</p></li><li><p>truststore - Creates a duplicate keystore file and generates a truststore file for jconsole SSL connections.</p></li><li><p>upload-snapshot - Uploads a snapshot of Red5 to the repository.</p></li><li><p>war_demos - Build wars for demo apps.</p></li><li><p>webwar - Make Web Archive. </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5AntandIvy"></a>7.2.6.&nbsp;Ant and Ivy</h3></div></div></div><p>When cleaning the dependancy libraries using and ant ivy with the following command</p><div class="literallayout"><p><br>
ant&nbsp;ivyclear<br>
</p></div><p>It is required to run the rebuild of Red5 in a particular way to make sure ivy retrieved the libraries correctly. </p><div class="literallayout"><p><br>
ant&nbsp;-Divy.conf.name="java6,&nbsp;eclipse"&nbsp;dist<br>
</p></div><p>More information here 
				<a class="link" href="docs:Ivy" target="_top">setup with Eclipse</a>
			</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="BuildingRed5Howtobuildwitheclipse"></a>7.3.&nbsp;How to build with eclipse</h2></div></div></div><p>This guide assumes eclipse 3.1.0 and you have downloaded the entire red5 build from the 
			subversion repository at 
			<a class="link" href="https://red5.googlecode.com/svn/java/server/trunk" target="_top">https://red5.googlecode.com/svn/java/server/trunk</a> 
		</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5RecommendedEclipsePlugins"></a>7.3.1.&nbsp;Recommended Eclipse Plugins</h3></div></div></div><p>The following plugins are recommended or required for building red5 in eclipse.</p><div class="itemizedlist"><ul type="disc"><li><p>IvyIDE - 
						<a class="link" href="http://ant.apache.org/ivy/ivyde/download.cgi" target="_top">http://ant.apache.org/ivy/ivyde/download.cgi</a>. See here for installation / update instructions 
						<a class="link" href="docs:Ivy" target="_top">setup with Eclipse</a> 
					</p></li><li><p>Spring IDE - 
						<a class="link" href="http://springide.org/project/wiki" target="_top">http://springide.org/project/wiki</a>
					</p></li><li><p>Subclipse SVN Plugin - 
						<a class="link" href="http://subclipse.tigris.org/" target="_top">http://subclipse.tigris.org/</a>
					</p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5ImportingtheRed5Project"></a>7.3.2.&nbsp;Importing the Red5 Project</h3></div></div></div><p>There are two ways to import the Red5 project. Either import an already downloaded working copy of the Red5 project or import the project directly from SVN.</p><div class="itemizedlist"><ul type="disc"><li><p>Import the checked out working copy. </p></li></ul></div><div class="orderedlist"><ol type="1"><li><p>Start Eclipse </p></li><li><p>From the File menu select "import" </p></li><li><p>In the Import dialog box select the item "Existing Projects into Workspace" and hit next </p></li><li><p>hit the "browse" button next to the "Select root directory" text box </p></li><li><p>select the root folder where you downloaded the red5 repository,(e.g. c:\projects </p></li></ol></div><div class="blockquote"><blockquote class="blockquote"><p>\osflash\red5 or /www/red5_server) and hit ok </p></blockquote></div><div class="orderedlist"><ol type="1"><li><p>Make sure red5 is selected in the projects area and hit "Finish"</p></li><li><p>Eclipse should automatically build the project, you can force a build from the "project" </p></li></ol></div><div class="blockquote"><blockquote class="blockquote"><p>menu and selecting "build project" </p></blockquote></div><div class="itemizedlist"><ul type="disc"><li><p>Import the project working copy from SVN. (Subclipse must be installed)</p></li></ul></div><div class="orderedlist"><ol type="1"><li><p>Start Eclipse </p></li><li><p>From the File menu select "import" </p></li><li><p>In the Import dialog box select SVN and then select the item "Checkout Projects from SVN" and hit next </p></li><li><p>A list of available SVN urls will be available, if it is not available select "Create a new repository location" click next and enter 
						<a class="link" href="http://red5.googlecode.com/svn/java/server/trunk" target="_top">http://red5.googlecode.com/svn/java/server/trunk</a> or       
					</p></li></ol></div><div class="blockquote"><blockquote class="blockquote"><p>
					<a class="link" href="https://red5.googlecode.com/svn/java/server/trunk" target="_top">https://red5.googlecode.com/svn/java/server/trunk</a>  if you have a google code login.
				</p></blockquote></div><div class="orderedlist"><ol type="1"><li><p>Click Finish.</p></li><li><p>Eclipse should automatically build the project, you can force a build from the "project" </p></li></ol></div><div class="blockquote"><blockquote class="blockquote"><p>menu and selecting "build project" </p></blockquote></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5UpdatingtheRed5source"></a>7.3.3.&nbsp;Updating the Red5 source</h3></div></div></div><div class="orderedlist"><ol type="1"><li><p>In eclipse right click the Red5 source project</p></li><li><p>Locate to "Team" and then "Update"</p></li><li><p>The source will be updated from SVN</p></li><li><p>Right click the Red5 project and select Refresh.</p></li><li><p>The project should also be cleaned after each update, select Project -&gt; Clean.</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5DebuggingRed5inEclipse"></a>7.3.4.&nbsp;Debugging Red5 in Eclipse</h3></div></div></div><div class="orderedlist"><ol type="1"><li><p>Click the arrow next to the Debug icon menu and then click "Open Debug Dialog". </p></li><li><p>Click "Java Application" in the menu then right click and "New". </p></li><li><p>Type a name for the debug configuration (ie "Red") and type </p></li></ol></div><div class="blockquote"><blockquote class="blockquote"><p>"org.red5.server.Bootstrap" an the main class. </p></blockquote></div><div class="orderedlist"><ol type="1"><li><p>Select the Arguments tab</p></li><li><p>Place this into Program Arguments</p></li></ol></div><div class="literallayout"><p><br>
-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector&nbsp;-Dcatalina.useNaming=true&nbsp;&nbsp;-Djava.security.debug=failure<br>
</p></div><div class="orderedlist"><ol type="1"><li><p>Place this into VM Arguments</p></li></ol></div><div class="literallayout"><p><br>
-cp&nbsp;./conf<br>
</p></div><div class="orderedlist"><ol type="1"><li><p>In OSX with JDK 5 and JDK6 to specify JDK6 the PATH variable has to be set. Goto the Environment Tab, add a new vairable called PATH, and place this in there</p></li></ol></div><div class="literallayout"><p><br>
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin<br>
</p></div><div class="orderedlist"><ol type="1"><li><p>Click Apply and Close.</p></li><li><p>Right click the project and choose Build Path -&gt; Configure Build Path. </p></li><li><p>In the Source Tab, choose Add Folder and select the src/conf directory.</p></li><li><p>Make sure "Allow output folders for source folders" is selected.</p></li><li><p>Under red5_server/src/conf, select Output Folder and choose edit. </p></li><li><p>Select Specific output, select the root directory and choose "create new folder". </p></li><li><p>Select conf, the output folder for the Red5 configs will now be placed into red5_server/conf. </p></li><li><p>With the imported red5 project selected click the debug icon and it will launch the </p></li></ol></div><p> server. </p><div class="orderedlist"><ol type="1"><li><p>Console logging will appear in the console window. </p></li></ol></div><div class="literallayout"><p><br>
If&nbsp;you&nbsp;get&nbsp;an&nbsp;error&nbsp;in&nbsp;the&nbsp;console&nbsp;like&nbsp;:&nbsp;<br>
java.net.BindException:&nbsp;Address&nbsp;already&nbsp;in&nbsp;use:&nbsp;bind&nbsp;at&nbsp;sun.nio.ch.Net.bind(Native&nbsp;<br>
Method)&nbsp;at&nbsp;sun.nio.ch.ServerSocketChannelImpl.bind(Unknown&nbsp;<br>
Source)&nbsp;at&nbsp;sun.nio.ch.ServerSocketAdaptor.bind(Unknown&nbsp;Source)&nbsp;at&nbsp;<br>
org.apache.mina.io.socket.SocketAcceptor.registerNew(SocketAcceptor.java:362)&nbsp;<br>
at&nbsp;org.apache.mina.io.socket.SocketAcceptor.access$800(SocketAcceptor.java:46)&nbsp;<br>
at&nbsp;org.apache.mina.io.socket.SocketAcceptor$Worker.run(SocketAcceptor.java:238)&nbsp;<br>
Exception&nbsp;in&nbsp;thread&nbsp;"main"&nbsp;<br>
<br>
Then&nbsp;the&nbsp;socket&nbsp;red5&nbsp;wants&nbsp;to&nbsp;run&nbsp;is&nbsp;in&nbsp;use,&nbsp;you&nbsp;can&nbsp;change&nbsp;the&nbsp;socket&nbsp;and&nbsp;I&nbsp;will&nbsp;write&nbsp;this&nbsp;<br>
up&nbsp;later&nbsp;today&nbsp;once&nbsp;I&nbsp;speak&nbsp;with&nbsp;Luke.<br>
</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="BuildingRed5AntIvyandEclipse"></a>7.3.5.&nbsp;Ant, Ivy and Eclipse</h3></div></div></div><p>When cleaning the dependancy libraries using ant and ivy with the following command</p><div class="literallayout"><p><br>
ant&nbsp;ivyclear<br>
</p></div><p>It is required to run the rebuild of Red5 in a particular way to make sure ivy retrieved the libraries correctly. </p><div class="literallayout"><p><br>
ant&nbsp;-Divy.conf.name="java6,&nbsp;eclipse"&nbsp;dist<br>
</p></div><p>Then back in eclipse right click the "ivy.xml" in the project and click Refresh it will also resolve the libraries in Eclipse.</p><p>More information here 
				<a class="link" href="Documentation/Tutorials/IvySetupWithEclipse" target="_top">Documentation/Tutorials/IvySetupWithEclipse</a>
			</p></div></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Red5Libraries.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ReleasingRed5.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;6.&nbsp;Red5 Libraries&nbsp;</td><td width="20%" align="center"><span style="color:white;font-size:90%;"><a href="http://osflash.org/red5" title="Red5">Red5 Open Source Flash Server</a></span></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;8.&nbsp;Releasing Red5</td></tr></table></div></body></html>