Update README for archival
[reddit.git] / install / setup_rabbitmq.sh
blobf2fe89337b6b1f64c9390d2c853cba1d77574f48
1 #!/bin/bash
2 # The contents of this file are subject to the Common Public Attribution
3 # License Version 1.0. (the "License"); you may not use this file except in
4 # compliance with the License. You may obtain a copy of the License at
5 # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
6 # License Version 1.1, but Sections 14 and 15 have been added to cover use of
7 # software over a computer network and provide for limited attribution for the
8 # Original Developer. In addition, Exhibit A has been modified to be consistent
9 # with Exhibit B.
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
13 # the specific language governing rights and limitations under the License.
15 # The Original Code is reddit.
17 # The Original Developer is the Initial Developer. The Initial Developer of
18 # the Original Code is reddit Inc.
20 # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit
21 # Inc. All Rights Reserved.
22 ###############################################################################
24 # load configuration
25 RUNDIR=$(dirname $0)
26 source $RUNDIR/install.cfg
28 ###############################################################################
29 # Configure RabbitMQ
30 ###############################################################################
31 if ! sudo rabbitmqctl list_vhosts | egrep "^/$"
32 then
33 sudo rabbitmqctl add_vhost /
36 if ! sudo rabbitmqctl list_users | egrep "^reddit"
37 then
38 sudo rabbitmqctl add_user reddit reddit
41 sudo rabbitmqctl set_permissions -p / reddit ".*" ".*" ".*"
42 sudo rabbitmq-plugins enable rabbitmq_management
43 sudo service rabbitmq-server restart