centos6.5 安装rabbitmq

Posted on Posted in linux
Tips: 本文创建于2016年7月15日,已超过 2 年,内容或图片可能已经失效!

环境

CentOS release 6.5 (Final)

需要的包

erlang otp_src_19.0.1.tar.gz

rabbitmq rabbitmq-server-generic-unix-3.6.3.tar.xz

wxwidgets wxWidgets-3.1.0.tar.bz2

安装

[root@mhealthid1 src]# yum -y install ncurses-devel openssl openssl-devel gtk+extra unixODBC-devel gcc-c++ gcc gtk2-devel mesa* freeglut*   
  
[root@mhealthid1 src]# pwd  
/usr/src  
[root@mhealthid1 src]# tar jxvf wxWidgets-3.1.0.tar.bz2  
[root@mhealthid1 src]# cd wxWidgets-3.1.0  
[root@mhealthid1 wxWidgets-3.1.0]# ./configure --with-opengl --enable-debug --enable-unicode  
[root@mhealthid1 wxWidgets-3.1.0]# make && make install  
  
[root@mhealthid1 src]# tar xvf otp_src_19.0.1.tar.gz  
[root@mhealthid1 src]# cd otp_src_19.0  
[root@mhealthid1 otp_src_19.0]# ./configure --prefix=/usr/local/erlang --enable-halfword-emulator --enable-m64-build --with-ssl --without-javac  
[root@mhealthid1 otp_src_19.0]# make && make install  
[root@mhealthid1 otp_src_19.0]# cd /usr/bin  
[root@mhealthid1 bin]# rm -f erl  
[root@mhealthid1 bin]# rm -f erlc  
[root@mhealthid1 bin]# rm -f epmd  
[root@mhealthid1 bin]# rm -f run_erl  
[root@mhealthid1 bin]# rm -f to_erl  
[root@mhealthid1 bin]# rm -f dialyzer  
[root@mhealthid1 bin]# rm -f typer  
[root@mhealthid1 bin]# rm -f escript  
[root@mhealthid1 bin]# rm -f ct_run  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/erl erl  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/erlc erlc  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/epmd epmd  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/run_erl run_erl  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/to_erl to_erl  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/dialyzer dialyzer  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/typer typer  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/escript escript  
[root@mhealthid1 bin]# ln -s /usr/local/erlang/lib/erlang/bin/ct_run ct_run  
  
[root@mhealthid1 local]# pwd  
/usr/local  
[root@mhealthid1 local]# xz -d rabbitmq-server-generic-unix-3.6.3.tar.xz   
[root@mhealthid1 local]# tar xvf rabbitmq-server-generic-unix-3.6.3.tar  
[root@mhealthid1 local]# mv rabbitmq_server-3.6.3 rabbitmq  
[root@mhealthid1 rabbitmq]# pwd  
/usr/local/rabbitmq/etc/rabbitmq  
[root@mhealthid1 rabbitmq]# vim enabled_plugins  
[rabbitmq_management,  
rabbitmq_management_visualiser,  
rabbitmq_tracing].  
[root@mhealthid1 rabb
itmq]# vim rabbitmq.config  
[  
{mnesia, [{dump_log_write_threshold, 1000}]},  
{rabbit, [{vm_memory_high_watermark, 0.4}]},  
{rabbitmq_management,  
[{listener, [{port, 55673},  
{ip, "0.0.0.0"}  
]}  
]}  
].  
[root@mhealthid1 rabbitmq]# vim rabbitmq-env.conf  
ABBITMQ_NODENAME=FZTEC-240088  
RABBITMQ_NODE_IP_ADDRESS=0.0.0.0  
RABBITMQ_NODE_PORT=5672  
RABBITMQ_LOG_BASE=/usr/local/rabbitmq/log  
RABBITMQ_PLUGINS_DIR=/usr/local/rabbitmq/plugins  
RABBITMQ_MNESIA_BASE=/usr/local/rabbitmq/mnesia  
[root@mhealthid1 rabbitmq]# nohup /usr/local/rabbitmq/sbin/rabbitmq-server >> rabbitmq.log 2>&1 & 
# 或者  /usr/local/rabbitmq/sbin/rabbitmq-server -detached
# ./sbin/rabbitmqctl  stop 停止服务,用ctl管理

(1) 新增一个用户

rabbitmqctl add_user Username Password
rabbitmqctl set_user_tags Username administrator

(2) 删除一个用户

rabbitmqctl delete_user Username

(3) 修改用户的密码

rabbitmqctl change_password Username Newpassword

(4) 查看当前用户列表

rabbitmqctl list_users

php 安装扩展

yum install librabbitmq-devel.x86_64   
wget http://pecl.php.net/get/amqp-1.2.0.tgz  
tar zxvf amqp-1.2.0.tgz   
cd amqp-1.2.0  
/usr/local/php/bin/phpize   
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp   
make  
make install  
vim /usr/local/php/etc/php.ini   
extension=amqp.so  
/usr/local/php/sbin/php-fpm -y /usr/local/php/etc/php-fpm.conf  
» 转载请注明来源:呢喃 » centos6.5 安装rabbitmq