Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Default Configuration

Variable

Default

Description

x.y.z

5.5.0

Current stable ActiveMQ version

ACTIVEMQ_HOME

/usr/local/apache-activemq-x.y.z

Installation directory

Installing ActiveMQ
  1. Download the latest stable ActiveMQ release (apache-activemq-x.y.z.tar.gz).
  2. Move to the installation root cd /usr/local.
  3. Unpack the release tar xzvf /path/to/apache-activemq-x.y.z.tar.gz
  4. Create ActiveMQ user account useradd activemq
  5. Edit the configuration files vim /usr/local/apache-activemq-x.y.z/conf/{activemq,jetty}.xml
  6. Set up key store in /usr/local/apache-activemq-x.y.z/conf/broker.ks
  7. Create trust store and import trusted certificates into /usr/local/apache-activemq-x.y.z/conf/broker.ts
  8. Setup service script
Service/Init Script

Something like this should work:

  1. Create the three files mentioned below...
  2. chmod +x /etc/init.d/activemq
  3. chkconfig --add activemq
  4. chkconfig activemq on
  5. /etc/init.d/activemq start
/home/activemq/activemq-start.sh
#!/bin/bash
echo Starting ActiveMQ....
sh /usr/local/apache-activemq-x.y.z/bin/activemq start
/home/activemq/activemq-stop.sh
#!/bin/bash
echo Stopping ActiveMQ....
sh /usr/local/apache-activemq-x.y.z/bin/activemq stop
/etc/init.d/activemq
#!/bin/bash
#
# activemq       Starts ActiveMQ.
#
# chkconfig: 345 88 12
# description: ActiveMQ is a JMS Messaging Queue Server.
### BEGIN INIT INFO
# Provides: $activemq
### END INIT INFO

# Source function library.
. /etc/init.d/functions

[ -f /home/activemq/activemq-start.sh ] || exit 0
[ -f /home/activemq/activemq-stop.sh ] || exit 0

RETVAL=0

umask 077

start() {
       echo -n $"Starting ActiveMQ: "
       daemon su -c /home/activemq/activemq-start.sh activemq
       echo
       return $RETVAL
}
stop() {
       echo -n $"Shutting down ActiveMQ: "
       daemon su -c /home/activemq/activemq-stop.sh activemq
       echo
       return $RETVAL
}
restart() {
       stop
       start
}
case "$1" in
start)
       start
       ;;
stop)
       stop
       ;;
restart|reload)
       restart
       ;;
*)
       echo $"Usage: $0 {start|stop|restart}"
       exit 1
esac

exit $?
Importing certificates into java trust store

If (re-)starting from scratch remove the trust store file beforehand as duplicate aliases are not allowed.

#!/bin/bash

TRUST_STORE=broker.ts
CERTIFICATES=*.crt # This could be a list instead e.g. "clientA.crt other_file.crt"

for cert in ${CERTIFICATES};
do
        # imports each certificate under an alias that matches its file name
        keytool -alias "${cert}" -importcert -noprompt -keystore "${TRUST_STORE}" -storepass 123456 -file "${cert}"
done
  • No labels