给运维整理的CentOS7的rabbitmq安装步骤
目录
不废话,直接上代码;no bb, show me the code; (安装 rabbitmq, rabbitmq-c, 和 php amqp 拓展)
直接上代码
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget gtk2-devel binutils-devel
wget https://erlang.org/download/otp_src_24.0.tar.gz
mv otp_src_24.0 /usr/local/
cd /usr/local/
cd otp_src_24.0/
mkdir ../erlang
./configure --prefix=/usr/local/erlang
make install
echo 'export PATH=$PATH:/usr/local/erlang/bin' >> /etc/profile
source /etc/profile
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.19/rabbitmq-server-generic-unix-3.8.19.tar.xz
yum install -y xz
/bin/xz -d rabbitmq-server-generic-unix-3.8.19.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.8.19.tar
mv rabbitmq_server-3.8.19/ /usr/local/
cd /usr/local/
mv rabbitmq_server-3.8.19/ rabbitmq/
echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
source /etc/profile
rabbitmqctl add_user jyp 123456
rabbitmqctl set_permissions -p "/" jyp ".*" ".*" ".*"
rabbitmqctl set_user_tags jyp administrator
rabbitmqctl delete_user guest
rabbitmq-server -detached
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
wget https://pecl.php.net/get/amqp-1.9.4.tgz
tar -zxvf amqp-1.9.4.tgz
cd amqp-1.9.4
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
make
make install
然后在 php.ini 添加 amqp.so , 使用 php -m 能看到这个拓展就说明完成了
|