Bitnami ActiveMQ Installer

NOTE: Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under "Start -> Bitnami APPNAME Stack -> Application console" (Windows). Learn more.
NOTE: When running the commands shown on this page, replace the installdir placeholder with the full installation directory for your Bitnami stack.

Description

Apache ActiveMQ is an open source message broker written in Java together with a full Java Message Service (JMS) client.

First steps with the Bitnami ActiveMQ Stack

Welcome to your new Bitnami application! Here are a few questions (and answers!) you might need when first starting with your application.

What are the system requirements?

Before you download and install your application, check that your system meets these requirements.

How do I install the Bitnami ActiveMQ Stack?

Windows, OS X and Linux installer
  • Download the executable file for the Bitnami ActiveMQ Stack from the Bitnami website.

  • Run the downloaded file:

    • On Linux, give the installer executable permissions and run the installation file in the console.
    • On other platforms, double-click the installer and follow the instructions shown.

Check the FAQ instructions on how to download and install a Bitnami Stack for more details.

The application will be installed to the following default directories:

Operating System Directory
Windows C:\Bitnami\APPNAME-VERSION
Mac OS X /Applications/APPNAME-VERSION
Linux /opt/APPNAME-VERSION (running as root user)
OS X VM
  • Download the OS X VM file for the Bitnami ActiveMQ Stack from the Bitnami website.
  • Begin the installation process by double-clicking the image file and dragging the WordPress OS X VM icon to the Applications folder.
  • Launch the VM by double-clicking the icon in the Applications folder.

What credentials do I need?

You need application credentials, consisting of a username and password. These credentials allow you to log in to your new Bitnami application.

What is the administrator username set for me to log in to the application for the first time?

  • For Windows, Linux and OS X installers, the username was configured by you when you first installed the application.
  • For OS X VMs, the username can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

What is the administrator password?

  • For Windows, Linux and OS X installers, the password was configured by you when you first installed the application.
  • For OS X VMs, the password can be obtained by clicking the Bitnami badge at the bottom right corner of the application welcome page.

How to start or stop the services?

Linux

Bitnami native installers include a graphical tool to manage services. This tool is named manager-linux-x64.run on Linux and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

      $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql, postgresql or apache:

      $ sudo installdir/ctlscript.sh restart mysql
      $ sudo installdir/ctlscript.sh restart postgresql
      $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

      $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

Mac OS X

Bitnami native installers include a graphical tool to manage services. This tool is named manager-osx on Mac OS X and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

    $ sudo installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql or apache:

     $ sudo installdir/ctlscript.sh restart mysql
     $ sudo installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

     $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

NOTE: If you are using the stack manager for Mac OS X-VM, please check the following blog post to learn how to manage services from its graphical tool.

Windows

Bitnami native installers include a graphical tool to manage services. This tool is named manager-windows.exe on Windows and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart services. Server log messages can be checked in the "Server Events" tab.

Management tool

The Windows native installer creates shortcuts to start and stop services created in the Start Menu, under "Programs -> Bitnami APPNAME Stack -> Bitnami Service". Servers can also be managed from the Windows "Services" control panel. Services are named using the format APPNAMESERVICENAME, where APPNAME is a placeholder for the application name and SERVICENAME is a placeholder for the service name. For example, the native installer for the Bitnami WordPress Stack installs services named wordpressApache and wordpressMySQL.

These services will be automatically started during boot. To modify this behaviour, refer to the section on disabling services on Windows.

How to connect to the ActiveMQ admin panel?

You can connect to the ActiveMQ admin panel by browsing to http://localhost:8161/.

Access ActiveMQ admin panel

NOTE: You must use the same credentials you have entered when you first installed the application.

How to connect to ActiveMQ from a different machine?

IMPORTANT: Bitnami Native Installers do not modify the firewall configuration of your computer, therefore the ActiveMQ ports could be open which is a significant security risk. You are strongly advised to close the ActiveMQ ports (refer to the FAQ for more information on this).

By default, all ActiveMQ transport connectors are enabled. To disable one of them, edit the installdir/activemq/conf/activemq.xml file, and remove the line related to that connector:

<transportConnectors>
   <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
   <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
   <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
   <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
   <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
   <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

In case of changes to the configuration file, restart the server to have the changes take effect:

$ sudo installdir/ctlscript.sh restart activemq

To test the server connectivity, run one of the ActiveMQ examples from a different machine using these instructions.

How to change the ActiveMQ administration panel password?

You can modify the ActiveMQ admin panel password in the file installdir/activemq/conf/jetty-realm.properties:

admin: NEWPASSWORD, admin

How to change the ActiveMQ connector password?

To change the connector password, follow these steps:

  • Generate a new secret-password pair:

     $ installdir/activemq/bin/activemq encrypt --password NEWSECRET --input NEWPASSWORD
    
  • Substitute the encrypted password (from the last line of the previous command output) in installdir/activemq/conf/credentials-enc.properties:

     activemq.password=ENC(NEWENCRYPTEDPASSWORD)
    
  • Change the value of the secret in the file installdir/activemq/conf/activemq.xml:

     <bean id="configurationEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEnc\    ryptor">
        <property name="algorithm" value="PBEWithMD5AndDES"/>
        <property name="password" value="NEWSECRET"/>
     </bean>
    

How can I run a command in the Bitnami ActiveMQ Stack?

Load the Bitnami Console and then run the command as usual.

How to run an ActiveMQ example?

The following steps walk you through running an ActiveMQ example using the Java source code.

  • First, ensure that you have Maven installed on the server. If you don't, install it following these instructions:
    • Debian:

      $ sudo apt-get install maven
      
    • CentOS:

      $ sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
      $ sudo yum install apache-maven
      
  • Next, activate a Maven profile. To do this, modify the Maven settings.xml file (usually located in /etc/maven/settings.xml or /etc/maven2/settings.xml, although the path might differ on your server) and include the following:

     <profiles>
       ...  
       <profile>
         <id>env-dev</id>
         <activation>
           <property>
             <name>target-env</name>
             <value>dev</value>
           </property>
         </activation>
         <properties>
           <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
           <maven.compiler.fork>true</maven.compiler.fork>
         </properties>
       </profile>
     </profiles>
    
      <activeProfiles>
       <activeProfile>env-dev</activeProfile>
     </activeProfiles> 
    
  • Go to the examples/ folder and install it using maven:

     $ cd installdir/activemq/examples/amqp/java
     $ sudo mvn install
    
  • Export the environment variables you need and run the example. Note that you can obtain your server's private IP address by using the /sbin/ifconfig command.

     $ export ACTIVEMQ_USER=admin
     $ export ACTIVEMQ_PASSWORD=PASSWORD
     $ export ACTIVEMQ_HOST=localhost
     $ java -cp target/amqp-example-0.1-SNAPSHOT.jar example.Listener &
     $ java -cp target/amqp-example-0.1-SNAPSHOT.jar example.Publisher
    

Execute the Listener and Publisher on different machines. You should now see the example running.

How to run the ActiveMQ web demos?

ActiveMQ comes with a number of Web demos that illustrate how to use the ActiveMQ broker with REST and AJAX. The Web demos are not activated in the default configuration, so you must follow the steps below to get them running:

  • Edit the installdir/activemq/examples/conf/activemq-demo.xml file and change the 'locations' property to reflect the location of the encrypted credentials file, located at installdir/activemq/conf/credentials-enc.properties:

     <property name="locations">
           <value>file:${activemq.conf}/credentials-enc.properties</value>
     </property>
    
  • If the ActiveMQ server is currently running, stop it:

     $ sudo installdir/ctlscript.sh stop activemq
    
  • Run the example:

     $ cd installdir/activemq
     $ sudo ./bin/activemq console xbean:installdir/activemq/examples/conf/activemq-demo.xml
    

    The ActiveMQ broker should now start.

  • Log in to the Web administration panel and view the demos by browsing to http://DOMAIN:8161/demo. If needed, use the credentials obtained from the server dashboard to log in.

How to create a full backup of ActiveMQ?

The Bitnami ActiveMQ Stack is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

NOTE: If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

Backup on Linux and Mac OS X

Follow these steps:

  • Change to the directory in which you wish to save your backup.

     $ cd /your/directory
    
  • Stop all servers.

     $ sudo installdir/ctlscript.sh stop
    
  • Create a compressed file with the stack contents.

     $ sudo tar -pczvf application-backup.tar.gz installdir
    
  • Start all servers.

     $ sudo installdir/ctlscript.sh start
    
  • Download or transfer the application-backup.tar.gz file to a safe location.

You should now download or transfer the application-backup.tar.gz file to a safe location.

Backup on Windows

Follow these steps:

  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Create a compressed file with the stack contents. You can use a graphical tool like 7-Zip or WinZip or just right-click the folder, click "Send to", and select the "Compressed (zipped) folder" option.

  • Download or transfer the compressed file to a safe location.

  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

Restore on Linux and Mac OS X

Follow these steps:

  • Change to the directory containing your backup:

    $ cd /your/directory
    
  • Stop all servers.

    $ sudo installdir/ctlscript.sh stop
    
  • Move the current stack to a different location:

    $ sudo mv installdir /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directory:

    $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers.

    $ sudo installdir/ctlscript.sh start
    
IMPORTANT: When restoring, remember to maintain the original permissions for the files and folders. For example, if you originally installed the stack as the root user on Linux, make sure that the restored files are owned by root as well.

Restore on Windows

  • Change to the directory containing your backup:

       $ cd /your/directory
    
  • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

  • Uninstall the previous services by executing the following command:

        $ serviceinstall.bat
    
  • Create a safe folder named Backups in the desktop and move the current stack to it. Remember to replace PATH with the right location of your folder:

        $ move installdir \PATH\Backups
    
  • Uncompress the backup file using a tool like 7-Zip or Winzip or just double-click the .zip file to uncompress it, and move it to the original directory.
  • Install services by running the following commands from an elevated command prompt:

      $ cd installdir
      $ serviceinstall.bat INSTALL
    
  • Start all servers using the shortcuts in the Start Menu or the graphical manager tool.

How to debug ActiveMQ errors?

The main ActiveMQ log file is created at installdir/activemq/data/activemq.log.

nativeInstaller

Bitnami Documentation