1.安装erlang运行环境
wget https://www.rabbitmq.com/releases/erlang/erlang-19.0-1.el6.x86_64.rpm
yum -y install erlang-19.0-1.el6.x86_64.rpm
输入erl测试是否成功 输入halt().退出
2.安装rabbitmq-server
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.14/rabbitmq-server-3.6.14-1.el6.noarch.rpm
yum -y install rabbitmq-server-3.6.14-1.el6.noarch.rpm
service rabbitmq-server start
service rabbitmq-server status
service rabbitmq-server restart
service rabbitmq-server stop
3.安装amqp-c
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
tar -zxvf rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
./configure --prefix=/usr/local/rabbitmq-c
make && make install
4.安装amqp拓展
安装依赖
yum install epel-release
yum install autoconf gcc gcc-c++ librabbitmq librabbitmq-devel
wget https://pecl.php.net/get/amqp-1.9.4.tgz
tar xf amqp-1.9.4.tgz
cd amqp-1.9.4
/www/server/php/73/bin/phpize
./configure --with-php-config=/www/server/php/73/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
make && make install
修改php.ini配置增加拓展amqp.so 并重启php-fpm
5.一些命令
增加用户 rabbitmqctl add_user 'test' 'test'
列出用户 rabbitmqctl list_users
授权用户 rabbitmqctl set_permissions -p / test '.*' '.*' '.*'