JBoss.orgCommunity Documentation

Chapter 3. Installing the JBoss Communications Media Server

3.1. Java Development Kit: Installing, Configuring and Running
3.2. Media Server Binary Distribution: Installing, Configuring and Running
3.2.1. Pre-Install Requirements and Prerequisites
3.2.2. Downloading
3.2.3. Installing
3.2.4. Running
3.2.5. Stopping
3.2.6. Server Structure
3.2.7. Uninstalling

The JBoss Communications Media Server is available in both binary and source code distributions. The simplest way to get started with the Media Server is to download the ready-to-run binary distribution. Alternatively, the source code for the JBoss Communications Media Server can be obtained by checking it out from its repository using the Subversion version control system ( SVN ), and then built using the Maven build system. Whereas installing the binary distribution is recommended for most users, obtaining and building the source code is recommended for those who want access to the latest revisions and Media Server capabilities.

Installing the Java Development Kit

The MobicentsJBCP platform is written in Java. A working Java Runtime Environment (JRE) or Java Development Kit (JDK) must be installed prior to running the server. The required versiom must be version 5 or higher.

It is possible to run most MobicentsJBCP servers, such as the JAIN SLEE Server, using a Java 6 JRE or JDK.

JRE or JDK?

Although MobicentsJBCP servers are capable of running on the Java Runtime Environment, this guide assumes the audience is mainly developers interested in developing Java-based, MobicentsJBCP-driven solutions. Therefore, installing the Java Development Kit is covered due to the anticipated audience requirements.

32-Bit or 64-Bit JDK

If the system uses 64-Bit Linux or Windows architecure, the 64-bit JDK is strongly recommended over the 32-bit version. The following heuristics should be considered in determining whether the 64-bit Java Virtual Machine (JVM) is suitable:

Downloading

Download the Sun JDK 5.0 (Java 2 Development Kit) from Sun's website: http://java.sun.com/javase/downloads/index_jdk5.jsp. Click the Download link next to "JDK 5.0 Update <x>" (where <x> is the latest minor version release number).

The Sun website offers two download options:

  • A self-extracting RPM (for example, jdk-1_5_0_16-linux-i586-rpm.bin)

  • A self-extracting file (e.g. jdk-1_5_0_16-linux-i586.bin)

If installing the JDK on Red Hat Enterprise Linux, Fedora, or another RPM-based Linux system, it is recommended that the self-extracting file containing the RPM package is selected. This option will set up and use the SysV service scripts in addition to installing the JDK. The RPM option is also recommended if the MobicentsJBCP platform is being set up in a production environment.

Installing

The following procedures detail how to install the Java Development Kit on both Linux and Windows.

Important

A -compat package is not required for RPM installations. The -compat package performs the same SysV service script set up that the RPM version of the JDK installer does.

Configuring

Configuring the system for the JDK consists of two tasks: setting the JAVA_HOME environment variable, and ensuring the system is using the proper JDK (or JRE) using the alternatives command. Setting JAVA_HOME generally overrides the values for java, javac and java_sdk_1.5.0 in alternatives, however it is recommended to specify the value for consistency.

Setting the JAVA_HOME Environment Variable on Generic Linux

After installing the JDK, ensure the JAVA_HOME environment variable exists and points to the location of the JDK installation.

Setting the JAVA_HOME Environment Variable on Linux

Determine whether JAVA_HOME is set by executing the following command:

~]$ echo $JAVA_HOME

If JAVA_HOME is not set, the value must be set to the location of the JDK installation on the system. This can be achieved by adding two lines to the ~/.bashrc configuration file. Open ~/.bashrc (or create it if it does not exist) and add a line similar to the following one anywhere inside the file:

export JAVA_HOME="/usr/lib/jvm/jdk1.5.0_<version>"

The changes should also be applied for other users who will be running the MobicentsJBCP on the machine (any environment variables exported from ~/.bashrc files are local to that user).

Setting java, javac and java_sdk_1.5.0 using the alternatives command
Selecting the Correct System JVM on Linux using alternatives

On systems with the alternatives command, including Red Hat Enterprise Linux and Fedora, it is possible to choose which JDK (or JRE) installation to use, as well as which java and javac executables should be run when called.

As the superuser, call /usr/sbin/alternatives with the --config java option to select between JDKs and JREs installed on your system:

home]$ sudo /usr/sbin/alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   2           /usr/lib/jvm/jre-1.6.0-sun/bin/java
*+ 3         /usr/lib/jvm/jre-1.5.0-sun/bin/java

Enter to keep the current selection[+], or type selection number:
        

The Sun JDK, version 5, is required to run the java executable. In the alternatives information printout above, a plus (+) next to a number indicates the option currently being used. Press Enter to keep the current JVM, or enter the number corresponding to the JVM to select that option.

As the superuser, repeat the procedure above for the javac command and the java_sdk_1.5.0 environment variable:

home]$ sudo /usr/sbin/alternatives --config javac
home]$ sudo /usr/sbin/alternatives --config java_sdk_1.5.0
Setting the JAVA_HOME Environment Variable on Windows

For information on how to set environment variables in Windows, refer to http://support.microsoft.com/kb/931715.

Testing

To ensure the correct JDK or Java version (5 or higher), and that the java executable is in the PATH environment variable, run the java -version command in the terminal from the home directory:

home]$ java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b03)
Java HotSpot(TM) Client VM (build 1.5.0_16-b03, mixed mode, sharing)
Uninstalling

It is not necessary to remove a particular JDK from a system, because the JDK and JRE version can be switched as required using the alternatives command, and/or by setting JAVA_HOME.

Uninstalling the JDK on Linux

On RPM-based systems, uninstall the JDK using the yum remove <jdk_rpm_name> command.

Uninstalling the JDK on Windows

On Windows systems, check the JDK entry in the Start menu for an uninstall option, or use Add/Remove Programs.

This section details how to install the Mobicents Media Server.

The latest version of the Media Server is available from http://www.mobicents.org/mms-downloads.html . The top row of the table holds the latest version. Click the Download link to start the download.

Once the requirements and prerequisites have been met, the Media Server can be installed onto the system. Follow the instructions below for the operating system on which the server will reside.

In the Linux terminal or Windows command prompt, the Standalone Media Server has started successfully if the last line of output is similar to the following

2100 [main] INFO  org.mobicents.media.server.bootstrap.MainDeployer  - [[[[[[[[[ Mobicents Media Server: release.version=2.0.0.CR3 Started ]]]]]]]]]

Detailed instructions for stopping the Media Server are given below, arranged by platform. If the server is correctly stopped, the following three lines are displayed as the last output in the Linux terminal or Command Prompt:

				[Server] Shutdown complete Shutdown complete Halting VM
			

Now the server is installed, it is important to understand the layout of the server directories. An understanding of the server structure is useful when deploying examples, and making configuration changes. It is also useful to understand what components can be removed to reduce the server boot time.

The directory structure in the Standalone Media Server installation directory is named using a standard structure. Table 3.1, “Directory Structure” describes each directory, and the type of information contained within each location.

Table 3.1. Directory Structure

Directory NameDescription
bin All the entry point JARs and start scripts included with the Media Server distribution are located in the bin directory
conf The conf directory contains the bootstrap descriptor, bootstrap-beans.xml by default, file for a given server configuration. This defines the core services that are fixed for the lifetime of the server. It also contains the log4j.xml that defines the logging filter.
deploy The deploy directory is the default location the deployment service looks to at start time for deployment content. This may be overridden through the MainDeployer's path attribute.
lib Contains the startup JAR files used by the server.
log Contains the logs from the bootstrap logging service. The log directory is the default directory into which the bootstrap logging service places its logs, however, the location can be overridden by altering the log4j.xml configuration file. This file is located in the /conf directory.
mbrola Contains the MBROLA binary and voices. The available voices are Please note that MBROLA is not LGPL model. To understand license please look at http://tcts.fpms.ac.be/synthesis/mbrola/mbrlicen.html
media The media directory used by Components like MediaPlayer (AudioPlayer, VideoPlayer) and Recorder. This is configurable property. These components tries to locate media file in media directory before failing. Recoder by default will write the recorded file to this folder.
temp temp is created automatically when the server is started. The MainDeployer creates a temp/deployment-beans.xml which contains all the beans defined in *-beans.xml file's from /deploy directory.

The Standalone Media Server uses a number of XML configuration files that control various aspects of the server. Table 3.2, “Core Configuration File Set” describes the location of the key configuration files, and provides a description of the