0x00 安装
- 添加APT源
deb http://www.rabbitmq.com/debian/ testing main
- 添加密钥
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
- 安装
sudo apt-get update
sudo apt-get install rabbitmq-server
0x01 修改控制脚本
切换到/usr/lib/rabbitmq/bin
目录
修改rabbitmqctl
和 rabbitmq-plugins
脚本
添加一个HOME变量,指向/var/lib/rabbitmq
如下所示
RABBITMQ_USE_LONGNAME=${RABBITMQ_USE_LONGNAME} \
HOME=/var/lib/rabbitmq \
exec ${ERL_DIR}erl \
-pa "${RABBITMQ_HOME}/ebin" \
...
0x02 启用管理后台
sudo ./rabbitmq-plugins enable rabbitmq-management
0x03 添加用户
sudo ./rabbitmqctl add_user admin admin
sudo ./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
sudo ./rabbitmqctl set_user_tags admin administrator
0x04 启用远程访问用户
编辑/etc/rabbitmq/rabbitmq.config
[
{rabbit,[{tcp_listeners,[5672]},{loopback_users,["admin"]}]}
]
0x05 重启服务
invoke-rc.d rabbitmq-server restart
打开 http://x.x.x.x:15672/ 使用admin帐号登录即可。