NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Installing ActiveMQ
Fetch and unpack ActiveMQ
cd /opt
wget http://www.mirrorservice.org/sites/ftp.apache.org//activemq/5.15.9/apache-activemq-5.15.9-bin.tar.gz
tar zxf apache-activemq-5.15.9-bin.tar.gz
ln -s apache-activemq-5.15.9 activemq

Create the ActiveMQ user and set ownership
useradd activemq -d /opt/activemq -M
chown activemq: -R /opt/apache-activemq-5.15.9
chown activemq: -h /opt/activemq
(check for pkill)
Create the init script and enable it
Create a file, /etc/init.d/activemq, with the following content:
#!/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/rc.d/init.d/functions
# Source LSB function library.
if [ -r /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
else
exit 1
fi

DISTRIB_ID=`lsb_release -i -s 2>/dev/null`

NAME="$(basename $0)"
unset ISBOOT
if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
NAME="${NAME:3}"
ISBOOT="1"
fi

# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser"
else
SU="/bin/su"
fi

. /etc/sysconfig/activemq

RETVAL=0

umask 077

start() {
echo -n $"Starting ActiveMQ: "
$SU - $ACTIVEMQ_USER -c "${ACTIVEMQ_START}" >> $ACTIVEMQ_LOG 2>&1 &
RETVAL="$?"
if [ "$RETVAL" -eq 0 ]; then
log_success_msg
touch /var/lock/subsys/${NAME}
else
log_failure_msg
fi

return $RETVAL
}
stop() {
pkill -u activemq java
}
restart() {
stop
sleep 5
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?

Create a file, /etc/sysconfig/activemq, with the following content:
# sysconfig file

# Oracle
JAVA_HOME=/usr/java/default

ACTIVEMQ_USER=activemq
ACTIVEMQ_BASE=/opt/activemq
ACTIVEMQ_START="${ACTIVEMQ_BASE}/bin/activemq start"
ACTIVEMQ_STOP="${ACTIVEMQ_BASE}/bin/activemq stop"
ACTIVEMQ_LOG=/var/log/activemq/activemq.log
#ACTIVEMQ_LOG=/dev/null
ACTIVEMQ_START="JAVA_HOME=${JAVA_HOME} ACTIVEMQ_OPTS="-Xmx8g -Dorg.apache.activemq.UseDedicatedTaskRunner=false" ${ACTIVEMQ_START}"

export ACTIVEMQ_USER ACTIVEMQ_BASE ACTIVEMQ_START ACTIVEMQ_STOP ACTIVEMQ_LOG
ACTIVEMQ_OPTS JAVA_HOME

Create the logrotation file, /etc/logrotate.d/activemq:

/var/log/activemq/activemq.log {
missingok
notifempty
compress
size 1M
daily
create 0600 activemq activemq
}

Enable and start the service
mkdir -p /var/log/activemq
chmod +x /etc/init.d/activemq
chkconfig activemq on

[Unit]
Description=ActiveMq_Autostart_script
After=network.target

[Service]
Type=forking
Restart=always
User=root
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
ExecReload=/opt/activemq/bin/activemq restart
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target
/etc/systemd/system/
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.