JBoss.orgCommunity Documentation

Chapter 3. Installing the Mobicents Media Server

3.1. Java Development Kit: Installing, Configuring and Running
3.2. JBoss Application Server 5.x.y embedded 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. Setting the JBOSS_HOME Environment Variable
3.2.5. Running
3.2.6. Stopping
3.2.7. Server Structure
3.2.8. Testing
3.2.9. Uninstalling
3.3. Standalone Media Server Binary Distribution: Installing, Configuring and Running
3.3.1. Pre-Install Requirements and Prerequisites
3.3.2. Downloading
3.3.3. Installing
3.3.4. Running
3.3.5. Stopping
3.3.6. Server Structure
3.3.7. Testing
3.3.8. Uninstalling
3.4. Writing and Running Tests Against the Media Server

The Mobicents Media Server distribution is available in two forms: Standalone and Embedded in JBoss Application Server 5. The standalone version is more preferred for carrier production deployment while JBoss Application Server 5 version is most useful for development

The Mobicents 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 Mobicents 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.

The Mobicents Media Server either comes bundled with the JBoss Application Server or Standalone. This section details how to install the Mobicents Media Server that comes bundled with JBoss Application Server 5. For installation of Standalone Mobicents Media Server, refer to Section 3.3, “ Standalone Media Server Binary Distribution: Installing, Configuring and Running ”

The latest version of the JBoss embedded Media Server is available from http://www.mobicents.org/mms/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 JBoss embedded Media Server can be installed onto the system. Follow the instructions below for the operating system on which the server will reside.

The Mobicents Platform (Mobicents) is built on top of the JBoss Application Server (JBoss AS). You do not need to set the JBOSS_HOME environment variable to run any of the Mobicents Platform servers unless JBOSS_HOME is already set.

The best way to know for sure whether JBOSS_HOME was set previously or not is to perform a simple check which may save you time and frustration.

Checking to See If JBOSS_HOME is Set on Linux

At the command line, echo $JBOSS_HOME to see if it is currently defined in your environment:

~]$ echo $JBOSS_HOME

The Mobicents Platform and most Mobicents servers are built on top of the JBoss Application Server (JBoss AS). When the Mobicents Platform or Mobicents servers are built from source, then JBOSS_HOME must be set, because the Mobicents files are installed into (or “over top of” if you prefer) a clean JBoss AS installation, and the build process assumes that the location pointed to by the JBOSS_HOME environment variable at the time of building is the JBoss AS installation into which you want it to install the Mobicents files.

This guide does not detail building the Mobicents Platform or any Mobicents servers from source. It is nevertheless useful to understand the role played by JBoss AS and JBOSS_HOME in the Mobicents ecosystem.

The immediately-following section considers whether you need to set JBOSS_HOME at all and, if so, when. The subsequent sections detail how to set JBOSS_HOME on Linux and Windows

You DO NOT NEED to set JBOSS_HOME if...

You MUST set JBOSS_HOME if you are:

Naturally, if you installed the Mobicents Platform or one of the Mobicents server binary releases which do not bundle JBoss AS, yet requires it to run, then you should install JBoss AS before setting JBOSS_HOME or proceeding with anything else.

Setting the JBOSS_HOME Environment Variable on Linux

The JBOSS_HOME environment variable must point to the directory which contains all of the files for the Mobicents Platform or individual Mobicents server that you installed. As another hint, this topmost directory contains a bin subdirectory.

Setting JBOSS_HOME in your personal ~/.bashrc startup script carries the advantage of retaining effect over reboots. Each time you log in, the environment variable is sure to be set for you, as a user. On Linux, it is possible to set JBOSS_HOME as a system-wide environment variable, by defining it in /etc/bashrc, but this method is neither recommended nor detailed in these instructions.

Setting the JBOSS_HOME Environment Variable on Windows

The JBOSS_HOME environment variable must point to the directory which contains all of the files for the Mobicents Platform or individual Mobicents server that you installed. As another hint, this topmost directory contains a bin subdirectory.

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

In the Linux terminal or Windows command prompt, the JBoss embedded Media Server has started successfully if the last line of output is similar to the following (ending with “Started in 23s:648ms” ):

11:27:34,663 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 37s:637ms

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 JBoss embedded 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.


The Media Server uses a number of XML configuration files that control various aspects of the server. In case of embedded Media Server all the files related Media Server are placed in mms-jboss-5.1.0.GA-<version>/jboss-5.1.0.GA/server/default/deploy/mobicents-media-server Table 3.2, “Core Configuration File Set” describes the location of the key configuration files, and provides a description of the


The Mobicents Media Server either comes bundled with the JBoss Application Server or Standalone. This section details how to install the Standalone Mobicents Media Server. For installation of JBoss embedded Mobicents Media Server, refer to Section 3.2, “ JBoss Application Server 5.x.y embedded Media Server Binary Distribution: Installing, Configuring and Running ”

The latest version of the Standalone 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 Standalone 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.CR2 Started ]]]]]]]]]

Detailed instructions for stopping the Standalone 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.3, “Directory Structure” describes each directory, and the type of information contained within each location.


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


For information about the different kinds of tests that the Media Server provides, refer to Writing and Running Tests Against MMS .