Skip to content

Instantly share code, notes, and snippets.

@tuananh
Created March 30, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuananh/043dfa79fb46345c3dc530a92ec23a82 to your computer and use it in GitHub Desktop.
Save tuananh/043dfa79fb46345c3dc530a92ec23a82 to your computer and use it in GitHub Desktop.
Install RabbitMQ on Debian/Ubuntu based systems
#!/bin/sh
# Variables
USER="admin"
PASS="password"
# Assert Root User
SCRIPTUSER=`whoami`
if [ "$SCRIPTUSER" != "root" ]
then
echo "You must be root to run this script. Try sudo?"
exit 1
fi
# Install librabbitmq (required for compiling libraries)
apt-get update -qq
apt-get install git -y
git clone git://github.com/alanxz/rabbitmq-c.git
cd rabbitmq-c
git submodule init
git submodule update
autoreconf -i && ./configure && make && sudo make install
# Setup Repo and Install
echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
apt-key add rabbitmq-signing-key-public.asc
apt-get update
apt-get install rabbitmq-server -y
service rabbitmq-server start
# Configure Setup
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user $USER $PASS
rabbitmqctl set_user_tags $USER administrator
rabbitmqctl set_permissions -p / $USER ".*" ".*" ".*"
rabbitmqctl delete_user guest
service rabbitmq-server restart
# Show settings
echo "Default Login:"
echo " user: $USER"
echo " pass: $PASS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment