blob: 63efe52b0fd25a5acd97c3b27824fee8eefd9175 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link href="http://activemq.apache.org/styles/site.css" rel="stylesheet" type="text/css"/>
<link href="http://activemq.apache.org/styles/type-settings.css" rel="stylesheet" type="text/css"/>
<script src="http://activemq.apache.org/styles/prototype.js" type="text/javascript"></script>
<script src="http://activemq.apache.org/styles/rico.js" type="text/javascript"></script>
<script src="http://activemq.apache.org/styles/site.js" type="text/javascript"></script>
<style type="text/css">
.maincontent { overflow:hidden; }
</style>
<!--[if IE]>
<style type="text/css">
.maincontent { width:100%; }
</style>
<![endif]-->
<link href='http://activemq.apache.org/styles/highlighter/styles/shCore.css' rel='stylesheet' type='text/css' />
<link href='http://activemq.apache.org/styles/highlighter/styles/shThemeEclipse.css' rel='stylesheet' type='text/css' />
<script src='http://activemq.apache.org/styles/highlighter/scripts/shCore.js' type='text/javascript'></script>
<script src='http://activemq.apache.org/styles/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
<script type="text/javascript">
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<title>
Apache ActiveMQ &#8482; -- Version 5 Getting Started
</title>
</head>
<body>
<div class="white_box">
<div class="header">
<div class="header_l">
<div class="header_r">
</div>
</div>
</div>
<div class="content">
<div class="content_l">
<div class="content_r">
<div>
<!-- Banner -->
<div id="asf_logo">
<div id="activemq_logo">
<a shape="rect" style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" href="http://activemq.apache.org" title="The most popular and powerful open source Message Broker">ActiveMQ</a>
<a shape="rect" style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" href="http://www.apache.org" title="The Apache Software Foundation">ASF</a>
</div>
</div>
<div class="top_red_bar">
<div id="site-breadcrumbs">
<a href="using-activemq-5.html">Using ActiveMQ 5</a>&nbsp;&gt;&nbsp;<a href="version-5-getting-started.html">Version 5 Getting Started</a>
</div>
<div id="site-quicklinks">
<p><a shape="rect" href="download.html">Download</a> | <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/apidocs/index.html">JavaDocs</a> <a shape="rect" href="javadocs.html">More...</a> | <a shape="rect" href="source.html">Source</a> | <a shape="rect" href="discussion-forums.html">Forums</a> | <a shape="rect" href="support.html">Support</a></p>
</div>
</div>
<table border="0">
<tbody>
<tr>
<td valign="top" width="100%">
<div class="wiki-content maincontent"><h2 id="Version5GettingStarted-Introduction">Introduction</h2><p>This document describes how to install and configure ActiveMQ for both Unix and Windows' platforms.</p><h2 id="Version5GettingStarted-DocumentOrganization">Document Organization</h2><p>The Getting Started Guide for ActiveMQ contains the following sections:</p><p><style type="text/css">/*<![CDATA[*/
div.rbtoc1502137418893 {padding: 0px;}
div.rbtoc1502137418893 ul {list-style: disc;margin-left: 0px;}
div.rbtoc1502137418893 li {margin-left: 0px;padding-left: 0px;}
/*]]>*/</style></p><div class="toc-macro rbtoc1502137418893">
<ul class="toc-indentation"><li><a shape="rect" href="#Version5GettingStarted-Introduction">Introduction</a></li><li><a shape="rect" href="#Version5GettingStarted-DocumentOrganization">Document Organization</a></li><li><a shape="rect" href="#Version5GettingStarted-Pre-InstallationRequirements">Pre-Installation Requirements</a></li><li><a shape="rect" href="#Version5GettingStarted-InstallationProcedureforWindows">Installation Procedure for Windows</a>
<ul class="toc-indentation"><li><a shape="rect" href="#Version5GettingStarted-WindowsBinaryInstallation">Windows Binary Installation</a></li><li><a shape="rect" href="#Version5GettingStarted-WindowsSourceInstallation">Windows Source Installation</a></li><li><a shape="rect" href="#Version5GettingStarted-WindowsDeveloper'sRelease">Windows Developer's Release</a></li></ul>
</li><li><a shape="rect" href="#Version5GettingStarted-InstallationProcedureforUnix">Installation Procedure for Unix</a>
<ul class="toc-indentation"><li><a shape="rect" href="#Version5GettingStarted-UnixBinaryInstallationUnixBinaryInstallation">Unix Binary Installation</a></li><li><a shape="rect" href="#Version5GettingStarted-UnixSourceInstallation">Unix Source Installation</a></li><li><a shape="rect" href="#Version5GettingStarted-UnixDeveloper'sRelease">Unix Developer's Release</a></li></ul>
</li><li><a shape="rect" href="#Version5GettingStarted-StartingActiveMQStartingActiveMQ">Starting ActiveMQ</a>
<ul class="toc-indentation"><li><a shape="rect" href="#Version5GettingStarted-OnWindows">On Windows</a></li><li><a shape="rect" href="#Version5GettingStarted-OnUnix">On Unix</a></li><li><a shape="rect" href="#Version5GettingStarted-Morehelp">More help</a></li></ul>
</li><li><a shape="rect" href="#Version5GettingStarted-TestingtheInstallationTestingtheInstallation">Testing the Installation</a></li><li><a shape="rect" href="#Version5GettingStarted-MonitoringActiveMQ">Monitoring ActiveMQ</a></li><li><a shape="rect" href="#Version5GettingStarted-StoppingActiveMQ">Stopping ActiveMQ</a></li><li><a shape="rect" href="#Version5GettingStarted-StartingActiveMQwithadifferentconfigurationfileStartingActiveMQwithadifferentconfigurationfile">Starting ActiveMQ with a different configuration file</a>
<ul class="toc-indentation"><li><a shape="rect" href="#Version5GettingStarted-ActiveMQ5.8orolder">ActiveMQ 5.8 or older</a></li><li><a shape="rect" href="#Version5GettingStarted-ActiveMQ5.9onwards">ActiveMQ 5.9 onwards</a></li></ul>
</li><li><a shape="rect" href="#Version5GettingStarted-ConfiguringActiveMQ">Configuring ActiveMQ</a></li><li><a shape="rect" href="#Version5GettingStarted-AdditionalResources">Additional Resources</a></li></ul>
</div><h2 id="Version5GettingStarted-Pre-InstallationRequirements">Pre-Installation Requirements</h2><p><strong>Hardware:</strong></p><ul><li>60 MB of free disk space for the ActiveMQ binary distribution.</li><li>200 MB of free disk space for the ActiveMQ source or developer's distributions.</li></ul><p><strong>Operating Systems:</strong></p><ul><li>Windows: Windows XP SP2, Windows 2000.</li><li>Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.</li></ul><p><strong>Environment:</strong></p><ul><li>Java Developer Kit (JDK) 1.7.x or greater for deployment and 1.7.x (Java 7) for compiling/building.</li><li>The JAVA_HOME environment variable must be set to the directory where the JDK is installed, e.g., <code>c:\Program Files\jdk.1.7.0_xx_xx</code>.</li><li>Maven 3.0 or greater (required when installing source or developer's releases).</li><li><a shape="rect" class="external-link" href="http://cvs.apache.org/repository/geronimo-spec/jars/">JARs</a> that will be used must be added to the classpath.</li></ul><h2 id="Version5GettingStarted-InstallationProcedureforWindows">Installation Procedure for Windows</h2><p>This section of the Getting Started Guide explains how to install binary and source distributions of ActiveMQ on a Windows system.</p><h4 id="Version5GettingStarted-WindowsBinaryInstallation">Windows Binary Installation</h4><p>This procedure explains how to download and install the binary distribution on a Windows system.</p><ol><li>From a browser, navigate to <a shape="rect" class="external-link" href="http://activemq.apache.org/">activemq.apache.org/</a>.</li><li>Click the <a shape="rect" href="download.html">Download</a> link in the navigation pane (the left pane).</li><li>Select the latest distribution (for older releases, click the link to the archives).<br clear="none"> For a binary distribution, the filename will be similar to: <code>activemq-x.x.x.zip</code>.</li><li>Extract the files from the ZIP file into a directory of your choice.</li><li>Proceed to the <a shape="rect" href="version-5-getting-started.html">#Starting ActiveMQ</a> section of this document.</li><li>Following start-up, go to the <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section of this document.</li></ol><h4 id="Version5GettingStarted-WindowsSourceInstallation">Windows Source Installation</h4><p>This procedure explains how to download and install the source distribution on a Windows system.</p><p><strong>NOTE:</strong> ActiveMQ requires Java 7 to run and to build</p><ol><li>From a browser, navigate to <a shape="rect" class="external-link" href="http://activemq.apache.org/">activemq.apache.org/</a>.</li><li>Click the <a shape="rect" href="download.html">Download</a> link in the navigation pane (the left pane).</li><li>Select the latest distribution (for older releases, click the link to the archives).<br clear="none"> For a source distribution, the filename will be similar to: <code>activemq-x.x-src.zip</code>.</li><li>Extract ActiveMQ from the ZIP file into a directory of your choice.</li><li><span class="confluence-anchor-link" id="Version5GettingStarted-WindowsSourceInstallation"></span> Build ActiveMQ using Maven 2.1 or greater and Java 1.7.</li></ol><p>The recommended method of building ActiveMQ is the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
mvn clean install
</pre>
</div></div><p>where [activemq_install_dir] is the directory in which ActiveMQ was installed.</p><p>If the above build fails on some tests, type the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
mvn clean install -Dmaven.test.skip=true
</pre>
</div></div><ol><li><p>If you prefer to use an IDE, then you can auto-generate the IDE's project file using maven plugins:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">mvn eclipse:eclipse
</pre>
</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">mvn idea:idea
</pre>
</div></div><p>Feel free to use any other applicable IDE. Please refer to the <a shape="rect" class="external-link" href="http://maven.apache.org/plugins/index.html">plugin reference</a> for more details.</p></li><li><p>Start ActiveMQ from the target directory, for example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]\assembly\target
unzip activemq-x.x-SNAPSHOT.zip
cd activemq-x.x-SNAPSHOT
bin\activemq
</pre>
</div></div><p><strong>NOTE:</strong> Working directories get created relative to the current directory. To create the working directories in the proper place, ActiveMQ must be launched from its home/installation directory.</p></li><li>Proceed to the <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section.</li></ol><div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Warning</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>If you are building ActiveMQ 5.x under Windows using Cygwin there is a path name length limitation. If the path name length is exceeded, you may see build errors. To correct this, move the ActiveMQ source directory higher in the file system tree, e.g., /cygdrive/c/d/sm.</p></div></div><h4 id="Version5GettingStarted-WindowsDeveloper'sRelease">Windows Developer's Release</h4><p>This procedure explains how to download and install the latest developer's snapshot.</p><p><strong>NOTE:</strong> ActiveMQ requires Java 7&#160;to run and to build</p><ol><li>From a browser, navigate to <a shape="rect" class="external-link" href="http://activemq.apache.org/">activemq.apache.org/</a>.</li><li>Click the <a shape="rect" href="download.html">Download</a> link in the navigation pane (the left pane).</li><li>Click the Maven ActiveMQ SNAPSHOT link.</li><li>Select the version of ActiveMQ to download</li><li>Extract the files from the ZIP file into a directory of your choice.</li><li>If a binary snapshot was downloaded, proceed to the <a shape="rect" href="version-5-getting-started.html">#Starting ActiveMQ</a> section of this document.<br clear="none"> If a source snapshot was downloaded, perform step 6 and step 7 of the <a shape="rect" href="version-5-getting-started.html">#Windows Source Installation</a> procedure.</li><li>Following start-up, proceed to the <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section.</li></ol><h2 id="Version5GettingStarted-InstallationProcedureforUnix">Installation Procedure for Unix</h2><h4 id="Version5GettingStarted-UnixBinaryInstallationUnixBinaryInstallation"><span class="confluence-anchor-link" id="Version5GettingStarted-UnixBinaryInstallation"></span> Unix Binary Installation</h4><p>This procedure explains how to download and install the binary distribution on a Unix system.<br clear="none"> <strong>NOTE:</strong> There are several alternative ways to perform this type of installation.</p><ol><li><p>Download the activemq gzip file to the Unix machine, using either a browser or a tool, i.e., wget, scp, ftp, etc. for example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&gt; wget http://activemq.apache.org/path/tofile/apache-activemq-5.8-tar.gz
</pre>
</div></div></li><li><p>Extract the files from the gzip file into a directory of your choice. For example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&gt; tar zxvf activemq-x.x.x.tar.gz
</pre>
</div></div></li><li><p>If the <code>ActiveMQ</code> start-up script is not executable, change its permissions. The <code>ActiveMQ</code> script is located in the <code>bin</code> directory. For example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">&gt; cd [activemq_install_dir]/bin
&gt; chmod 755 activemq
</pre>
</div></div></li><li>Proceed to the <a shape="rect" href="version-5-getting-started.html">#Starting ActiveMQ</a> section of this document.</li><li>Following start-up, go to the <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section.</li></ol><h4 id="Version5GettingStarted-UnixSourceInstallation">Unix Source Installation</h4><p>This procedure explains how to download and install the source distribution on a Unix system. This procedure assumes the Unix machine has a browser. Please see the previous <a shape="rect" href="version-5-getting-started.html">#Unix Binary Installation</a> section for details on how to install ActiveMQ without a browser.</p><p><strong>NOTE:</strong> ActiveMQ requires Java 7 to run and to build</p><ol><li>From a browser, navigate to <a shape="rect" class="external-link" href="http://activemq.apache.org/">activemq.apache.org/</a>.</li><li>Click the <a shape="rect" href="download.html">Download</a> link in the navigation pane (the left pane).</li><li>Click the Maven ActiveMQ SNAPSHOT link.</li><li>Select the version of ActiveMQ to download<br clear="none"> For a source distribution, the filename will be similar to: <code>activemq-x.x-src.tar.gz</code>.</li><li><p>Extract the files from the ZIP file into a directory of your choice. For example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">tar zxvf activemq.x.x-src.tar.gz
</pre>
</div></div></li><li><p>Build ActiveMQ using Maven 3.0 or greater and Java 7:<br clear="none"> The preferred method of building ActiveMQ is the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
mvn clean install
</pre>
</div></div><p>If Maven crashes with a java.lang.OutOfMemoryError, you you need to do this first (assuming a Bourne-like shell):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">export MAVEN_OPTS=-Xmx1024M
</pre>
</div></div><p>If the above build fails on some tests, do the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
mvn clean install -Dmaven.test.skip=true
</pre>
</div></div><p>If you prefer to use an IDE then you can auto-generate the IDE's project file using maven plugins:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">mvn eclipse:eclipse
</pre>
</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">mvn idea:idea
</pre>
</div></div><p>Feel free to use any other applicable IDE. Please refer to the <a shape="rect" class="external-link" href="http://maven.apache.org/reference/plugins/plugins.html">plugin reference</a> for more details.<br clear="none"> <strong>NOTE:</strong> Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.</p></li><li>Proceed to the <a shape="rect" href="version-5-getting-started.html">#Starting ActiveMQ</a> section of this document.</li><li>Proceed to <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section.</li></ol><h4 id="Version5GettingStarted-UnixDeveloper'sRelease">Unix Developer's Release</h4><p>This procedure explains how to download and install the latest developer's snapshot.</p><p><strong>NOTE:</strong> ActiveMQ requires Java 7 to run and to build</p><ol><li>From a browser, navigate to <a shape="rect" class="external-link" href="http://activemq.apache.org/">activemq.apache.org/</a>.</li><li>Click the <a shape="rect" href="version-5-getting-started.html">#Download</a> link in the navigation pane (the left pane).</li><li>Click the Maven ActiveMQ SNAPSHOT link.</li><li>Select the version of ActiveMQ to download</li><li><p>Extract the files from the gzip file into a directory of your choice. For example:<br clear="none"> For a binary developer's snapshot:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">tar zxvf activemq-x.x.x.tar.gz
</pre>
</div></div><p>For a source developer's snapshot:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">tar zxvf activemq-x.x.x-src.tar.gz
</pre>
</div></div></li><li><p>If a binary snapshot was downloaded, to make it executable, the <code>ActiveMQ</code> script may need its permissions changed:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]/bin
chmod 755 activemq
</pre>
</div></div></li><li>For a binary snapshot, proceed to the <a shape="rect" href="version-5-getting-started.html">#Starting ActiveMQ</a> section of this document.</li><li>If a source snapshot was downloaded perform steps 6 - 8 of the <a shape="rect" href="version-5-getting-started.html">#Unix Source Installation</a> procedure.</li><li>Proceed to the <a shape="rect" href="version-5-getting-started.html">#Testing the Installation</a> section.</li></ol><h2 id="Version5GettingStarted-StartingActiveMQStartingActiveMQ"><span class="confluence-anchor-link" id="Version5GettingStarted-StartingActiveMQ"></span> Starting ActiveMQ</h2><p>There now follows instructions on how to <a shape="rect" href="run-broker.html">run the ActiveMQ Message Broker</a>.</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>See also <a shape="rect" class="unresolved" href="#">Starting ActiveMQ with a different configuration file</a></p></div></div><h3 id="Version5GettingStarted-OnWindows">On Windows</h3><p>From a console window, change to the installation directory and run <code>ActiveMQ</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
</pre>
</div></div><p>where <code>activemq_install_dir</code> is the directory in which ActiveMQ was installed, e.g., <code>c:\Program Files\ActiveMQ-5.x</code>.</p><p>Then type (depending on ActiveMQ version):</p><p><strong>ActiveMQ 5.10 onwards</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin\activemq start
</pre>
</div></div><p><strong>ActiveMQ 5.9 or older</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin\activemq
</pre>
</div></div><p><strong>NOTE:</strong> Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.</p><h3 id="Version5GettingStarted-OnUnix">On Unix</h3><p>From a command shell, change to the installation directory and run <code>ActiveMQ</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
</pre>
</div></div><p>where <code>activemq_install_dir</code> is the directory in which ActiveMQ was installed, e.g., <code>/usr/local/activemq-5.x</code>. <br clear="none" class="atl-forced-newline"> Then type:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq start
OR
bin/activemq start &gt; /tmp/smlog 2&gt;&amp;1 &amp;;
Note: /tmp/smlog may be changed to another file name.
</pre>
</div></div><p><strong>NOTE:</strong> Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory.</p><div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Warning</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">nohup bin/activemq &gt; /tmp/smlog 2&gt;&amp;1 &amp;
</pre>
</div></div></div></div><h3 id="Version5GettingStarted-Morehelp">More help</h3><p>For other ways of running the broker see <a shape="rect" href="run-broker.html">Here</a>. For example you can run an <a shape="rect" href="how-do-i-embed-a-broker-inside-a-connection.html">embedded broker</a> inside your JMS Connection to avoid starting a separate process.</p><h2 id="Version5GettingStarted-TestingtheInstallationTestingtheInstallation"><span class="confluence-anchor-link" id="Version5GettingStarted-TestingtheInstallation"></span> Testing the Installation</h2><p>If ActiveMQ is up and running without problems, the Window's console window or the Unix command shell will display information similar to the following log line:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">INFO ActiveMQ JMS Message Broker (ID:apple-s-Computer.local-51222-1140729837569-0:0) has started
</pre>
</div></div><p><br clear="none" class="atl-forced-newline"> ActiveMQ's default port is 61616. From another window run netstat and search for port 61616.</p><p>From a Windows console, type:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">netstat -an|find "61616"
</pre>
</div></div><p><strong>OR</strong></p><p>From a Unix command shell, type:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">netstat -an|grep 61616
</pre>
</div></div><h2 id="Version5GettingStarted-MonitoringActiveMQ">Monitoring ActiveMQ</h2><p>You can monitor ActiveMQ using the <a shape="rect" href="web-console.html">Web Console</a> by pointing your browser at</p><p><a shape="rect" class="external-link" href="http://localhost:8161/admin" rel="nofollow">http://localhost:8161/admin</a></p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>From ActiveMQ 5.8 onwards the web apps is secured out of the box.<br clear="none"> The default username and password is admin/admin. You can configure this in the conf/jetty-real.properties file.</p></div></div><p>Or you can use the <a shape="rect" href="jmx.html">JMX</a> support to view the running state of ActiveMQ.</p><p>For more information see the file <code>docs/WebConsole-README.txt</code> in the distribution.</p><h2 id="Version5GettingStarted-StoppingActiveMQ">Stopping ActiveMQ</h2><p>For both Windows and Unix installations, terminate ActiveMQ by typing "CTRL-C" in the console or command shell in which it is running.</p><p>If ActiveMQ was started in the background on Unix, the process can be killed, with the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">cd [activemq_install_dir]
</pre>
</div></div><p>where <code>activemq_install_dir</code> is the directory in which ActiveMQ was installed, e.g., <code>/usr/local/activemq-5.x</code>. <br clear="none" class="atl-forced-newline"> Then type:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq stop
</pre>
</div></div><p>Or you can do the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">ps -ef|grep activemq
kill [PID]
where [PID] is the process id of the ActiveMQ process.
</pre>
</div></div><h2 id="Version5GettingStarted-StartingActiveMQwithadifferentconfigurationfileStartingActiveMQwithadifferentconfigurationfile"><span class="confluence-anchor-link" id="Version5GettingStarted-StartingActiveMQwithadifferentconfigurationfile"></span> Starting ActiveMQ with a different configuration file</h2><p>By default ActiveMQ uses the <code>conf/activemq.xml</code> as the main configuration file when starting. If you want to use a different configuration file you can specify this as a parameter.</p><h4 id="Version5GettingStarted-ActiveMQ5.8orolder">ActiveMQ 5.8 or older</h4><p>For example to use <code>conf/activemq-demo.xml</code> which includes the web demos, you do as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq console xbean:conf/activemq-demo.xml
</pre>
</div></div><p>To start Active in console mode and load the <code>conf/activemq-demo.xml</code> file. Yes you need the <code>xbean:</code> as prefix.</p><p>And to launch as a background process you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq start xbean:conf/activemq-demo.xml
</pre>
</div></div><h4 id="Version5GettingStarted-ActiveMQ5.9onwards">ActiveMQ 5.9 onwards</h4><p>For example to use <code>examples/conf/activemq-demo.xml</code> which includes the web demos, you do as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq console xbean:examples/conf/activemq-demo.xml
</pre>
</div></div><p>To start Active in console mode and load the <code>examples/conf/activemq-demo.xml</code> file. Yes you need the <code>xbean:</code> as prefix.</p><p>And to launch as a background process you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">bin/activemq start xbean:examples/conf/activemq-demo.xml
</pre>
</div></div><h2 id="Version5GettingStarted-ConfiguringActiveMQ">Configuring ActiveMQ</h2><p>The ActiveMQ broker should now run. You can configure the broker by specifying an <a shape="rect" href="xml-configuration.html">Xml Configuration</a> file as a parameter to the <em>activemq</em> command. An alternative is to use the <a shape="rect" href="broker-configuration-uri.html">Broker Configuration URI</a> to configure things on the command line in a concise format (though the configuration options are not as extensive as if you use Java or XML code). You can also</p><p>Also see <a shape="rect" href="configuring-transports.html">Configuring Transports</a> to see how you can configure the various connection, transport and broker options using the connection URL in the ActiveMQConnectionFactory.</p><p>See the <a shape="rect" href="initial-configuration.html">Initial Configuration</a> for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code</p><p>If you want to use JNDI to connect to your JMS provider then please view the <a shape="rect" href="jndi-support.html">JNDI Support</a>. If you are a Spring user you should read about <a shape="rect" href="spring-support.html">Spring Support</a></p><p>After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the <a shape="rect" href="configuration.html">Configuration</a> section.</p><h2 id="Version5GettingStarted-AdditionalResources">Additional Resources</h2><p>If you are new to using ActiveMQ, running the <a shape="rect" href="web-samples.html">Web Samples</a> or the <a shape="rect" href="examples.html">Examples</a> is a good next step to learn more about ActiveMQ.</p></div>
</td>
<td valign="top">
<div class="navigation">
<div class="navigation_top">
<div class="navigation_bottom">
<h3 id="Navigation-Overviewhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=35985"><a shape="rect" href="overview.html">Overview</a></h3><ul class="alternate"><li><a shape="rect" href="index.html">Index</a></li><li><a shape="rect" href="news.html">News</a></li><li><a shape="rect" href="new-features.html">New Features</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li><li><a shape="rect" href="faq.html">FAQ</a></li><li><a shape="rect" href="articles.html">Articles</a></li><li><a shape="rect" href="books.html">Books</a></li><li><a shape="rect" href="download.html">Download</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/licenses/">License</a></li></ul><h3 id="Navigation-Search">Search</h3><div>
<form enctype="application/x-www-form-urlencoded" method="get" action="http://www.google.com/search" style="font-size: 10px;">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
<input maxlength="255" type="text" name="q" size="15" value="value"><br clear="none">
<input type="submit" name="btnG" value="Search">
<input type="hidden" name="domains" value="activemq.apache.org">
<input type="hidden" name="sitesearch" value="activemq.apache.org">
</form>
</div>
<h3 id="Navigation-SubProjects">Sub Projects</h3><ul class="alternate"><li><a shape="rect" class="external-link" href="http://activemq.apache.org/artemis/">Artemis</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/apollo" title="ActiveMQ Apollo">Apollo</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/cms/">CMS</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/nms/" title="NMS is the .Net Messaging API">NMS</a></li></ul><h3 id="Navigation-Communityhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=36130"><a shape="rect" href="community.html">Community</a></h3><ul class="alternate"><li><a shape="rect" href="support.html">Support</a></li><li><a shape="rect" href="contributing.html">Contributing</a></li><li><a shape="rect" href="discussion-forums.html">Discussion Forums</a></li><li><a shape="rect" href="mailing-lists.html">Mailing Lists</a></li><li><a shape="rect" href="irc.html">IRC</a></li><li><a shape="rect" class="external-link" href="http://javabot.evanchooly.com/logs/%23apache-activemq/today" rel="nofollow">IRC Log</a></li><li><a shape="rect" href="security-advisories.html">Security Advisories</a></li><li><a shape="rect" href="site.html">Site</a></li><li><a shape="rect" class="external-link" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a shape="rect" href="projects-using-activemq.html">Projects Using ActiveMQ</a></li><li><a shape="rect" href="users.html">Users</a></li><li><a shape="rect" href="team.html">Team</a></li><li><a shape="rect" href="thanks.html">Thanks</a></li></ul><h3 id="Navigation-Featureshttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=35883"><a shape="rect" href="features.html">Features</a></h3><ul class="alternate"><li><a shape="rect" href="advisory-message.html">Advisory Message</a></li><li><a shape="rect" href="clustering.html">Clustering</a></li><li><a shape="rect" href="cross-language-clients.html">Cross Language Clients</a></li><li><a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a></li><li><a shape="rect" href="jmx.html">JMX</a></li><li><a shape="rect" href="jms-to-jms-bridge.html">JMS to JMS Bridge</a></li><li><a shape="rect" href="masterslave.html">MasterSlave</a></li><li><a shape="rect" href="message-groups.html">Message Groups</a></li><li><a shape="rect" href="networks-of-brokers.html">Networks of Brokers</a></li><li><a shape="rect" href="performance.html">Performance</a></li><li><a shape="rect" href="persistence.html">Persistence</a></li><li><a shape="rect" href="security.html">Security</a></li><li><a shape="rect" href="virtual-destinations.html">Virtual Destinations</a></li><li><a shape="rect" href="visualisation.html">Visualisation</a></li><li><a shape="rect" href="features.html">More ...</a></li></ul><h3 id="Navigation-Connectivityhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=36167"><a shape="rect" href="connectivity.html">Connectivity</a></h3><ul class="alternate"><li><a shape="rect" href="ajax.html">Ajax</a></li><li><a shape="rect" href="amqp.html">AMQP</a></li><li><a shape="rect" href="axis-and-cxf-support.html">Axis and CXF Support</a></li><li><a shape="rect" href="c-integration.html">C Integration</a></li><li><a shape="rect" href="activemq-c-clients.html">C++</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/nms/">C# and .Net Integration</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/cms/">CMS</a></li><li><a shape="rect" href="j2ee.html">J2EE</a></li><li><a shape="rect" href="jboss-integration.html">JBoss Integration</a></li><li><a shape="rect" class="external-link" href="http://docs.codehaus.org/display/JETTY/Integrating+with+ActiveMQ" rel="nofollow">Jetty</a></li><li><a shape="rect" href="jndi-support.html">JNDI Support</a></li><li><a shape="rect" class="external-link" href="http://activemq.apache.org/nms/" title="NMS is the .Net Messaging API">NMS</a></li><li><a shape="rect" href="rest.html">REST</a></li><li><a shape="rect" href="rss-and-atom.html">RSS and Atom</a></li><li><a shape="rect" href="spring-support.html">Spring Support</a></li><li><a shape="rect" href="stomp.html">Stomp</a></li><li><a shape="rect" href="tomcat.html">Tomcat</a></li><li><a shape="rect" href="unix-service.html">Unix Service</a></li><li><a shape="rect" href="weblogic-integration.html">WebLogic Integration</a></li><li><a shape="rect" href="xmpp.html">XMPP</a></li><li><a shape="rect" href="connectivity.html">More ...</a></li></ul><h3 id="Navigation-UsingActiveMQ5https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=71176"><a shape="rect" href="using-activemq-5.html">Using ActiveMQ 5</a></h3><ul class="alternate"><li><a shape="rect" href="version-5-getting-started.html">Getting Started</a></li><li><a shape="rect" href="version-5-initial-configuration.html">Initial Configuration</a></li><li><a shape="rect" href="version-5-run-broker.html">Running a Broker</a></li><li><a shape="rect" href="how-do-i-embed-a-broker-inside-a-connection.html">Embedded Brokers</a></li><li><a shape="rect" href="activemq-command-line-tools-reference.html">Command Line Tools</a></li><li><a shape="rect" href="configuring-version-5-transports.html">Configuring Transports</a></li><li><a shape="rect" href="version-5-examples.html">Examples</a></li><li><a shape="rect" href="version-5-web-samples.html">Web Samples</a></li><li><a shape="rect" href="how-can-i-monitor-activemq.html">Monitoring the Broker</a></li><li><a shape="rect" href="version-5-xml-configuration.html">Xml Configuration</a></li><li><a shape="rect" href="xml-reference.html">Xml Reference</a></li><li><a shape="rect" href="using-activemq-5.html">More ...</a></li></ul><h3 id="Navigation-Toolshttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=35912"><a shape="rect" href="tools.html">Tools</a></h3><ul class="alternate"><li><a shape="rect" href="web-console.html">Web Console</a></li><li><a shape="rect" href="activemq-performance-module-users-manual.html">Maven2 Performance Plugin</a></li></ul><h3 id="Navigation-Supporthttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=35919"><a shape="rect" href="support.html">Support</a></h3><ul class="alternate"><li><a shape="rect" class="external-link" href="http://issues.apache.org/jira/browse/AMQ">Issues</a></li><li><a shape="rect" class="external-link" href="http://issues.apache.org/activemq/browse/AMQ?report=com.atlassian.jira.plugin.system.project:roadmap-panel">Roadmap</a></li><li><a shape="rect" class="external-link" href="http://issues.apache.org/activemq/browse/AMQ?report=com.atlassian.jira.plugin.system.project:changelog-panel">Change log</a></li></ul><h3 id="Navigation-Developershttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=35903"><a shape="rect" href="developers.html">Developers</a></h3><ul class="alternate"><li><a shape="rect" href="source.html">Source</a></li><li><a shape="rect" href="building.html">Building</a></li><li><a shape="rect" href="developer-guide.html">Developer Guide</a></li><li><a shape="rect" href="becoming-a-committer.html">Becoming a committer</a></li><li><a shape="rect" href="code-overview.html">Code Overview</a></li><li><a shape="rect" href="wire-protocol.html">Wire Protocol</a></li><li><a shape="rect" href="release-guide.html">Release Guide</a></li></ul><h3 id="Navigation-Tests">Tests</h3><ul class="alternate"><li><a shape="rect" href="activemq-performance-module-users-manual.html">Maven2 Performance Plugin</a></li><li><a shape="rect" href="benchmark-tests.html">Benchmark Tests</a></li><li><a shape="rect" href="jmeter-system-tests.html">JMeter System Tests</a></li><li><a shape="rect" href="jmeter-performance-tests.html">JMeter Performance Tests</a></li><li><a shape="rect" href="integration-tests.html">Integration Tests</a></li></ul><h3 id="Navigation-ProjectReports">Project Reports</h3><ul class="alternate"><li><a shape="rect" href="junit-reports.html">JUnit Reports</a></li><li><a shape="rect" href="source-xref.html">Source XRef</a></li><li><a shape="rect" href="test-source-xref.html">Test Source XRef</a></li><li><a shape="rect" href="xml-reference.html">Xml Reference</a></li></ul>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="bottom_red_bar"></div>
</div>
</div>
</div>
</div>
<div class="black_box">
<div class="footer">
<div class="footer_l">
<div class="footer_r">
<div>
<a href="http://activemq.apache.org/privacy-policy.html">Privacy Policy</a> -
(<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=71184">edit this page</a>)
</div>
</div>
</div>
</div>
</div>
</div>
<div class="design_attribution">
&copy; 2004-2011 The Apache Software Foundation.
<br/>
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
<br/>
<a href="http://hiramchirino.com">Graphic Design By Hiram</a>
</div>
<!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content -->
<span style="display: none">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1347593-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</span>
</body>
</html>