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

安装

[[email protected] src]# yum -y install ncurses-devel openssl openssl-devel gtk+extra unixODBC-devel gcc-c++ gcc gtk2-devel mesa* freeglut*   
  
[[email protected] src]# pwd  
/usr/src  
[[email protected] src]# tar jxvf wxWidgets-3.1.0.tar.bz2  
[[email protected] src]# cd wxWidgets-3.1.0  
[[email protected] wxWidgets-3.1.0]# ./configure --with-opengl --enable-debug --enable-unicode  
[[email protected] wxWidgets-3.1.0]# make && make install  
  
[[email protected] src]# tar xvf otp_src_19.0.1.tar.gz  
[[email protected] src]# cd otp_src_19.0  
[[email protected] otp_src_19.0]# ./configure --prefix=/usr/local/erlang --enable-halfword-emulator --enable-m64-build --with-ssl --without-javac  
[[email protected] otp_src_19.0]# make && make install  
[[email protected] otp_src_19.0]# cd /usr/bin  
[[email protected] bin]# rm -f erl  
[[email protected] bin]# rm -f erlc  
[[email protected] bin]# rm -f epmd  
[[email protected] bin]# rm -f run_erl  
[[email protected] bin]# rm -f to_erl  
[[email protected] bin]# rm -f dialyzer  
[[email protected] bin]# rm -f typer  
[[email protected] bin]# rm -f escript  
[[email protected] bin]# rm -f ct_run  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/erl erl  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/erlc erlc  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/epmd epmd  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/run_erl run_erl  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/to_erl to_erl  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/dialyzer dialyzer  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/typer typer  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/escript escript  
[[email protected] bin]# ln -s /usr/local/erlang/lib/erlang/bin/ct_run ct_run  
  
[[email protected] local]# pwd  
/usr/local  
[[email protected] local]# xz -d rabbitmq-server-generic-unix-3.6.3.tar.xz   
[[email protected] local]# tar xvf rabbitmq-server-generic-unix-3.6.3.tar  
[[email protected] local]# mv rabbitmq_server-3.6.3 rabbitmq  
[r[email protected] rabbitmq]# pwd  
/usr/local/rabbitmq/etc/rabbitmq  
[[email protected] rabbitmq]# vim enabled_plugins  
[rabbitmq_management,  
rabbitmq_management_visualiser,  
rabbitmq_tracing].  
[[email protected] 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"}  
]}  
]}  
].  
[[email protected] 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  
[[email protected] 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