CentOS 6.5 64位下安装httpsqs

系统环境:CentOS 6.5 64位
安装方式:编译安装
防火墙:开启
软件版本: httpsqs 1.7

一、    环境准备:
1.    安装libevent-2.0.12-stable.tar.gz

Bash
[root@iZ94ebgv853Z ~]# wget http://soft.7dot.com/soft/libevent-2.0.12-stable.tar.gz
[root@iZ94ebgv853Z ~]# tar xf libevent-2.0.12-stable.tar.gz
[root@iZ94ebgv853Z ~]# cd libevent-2.0.12-stable
[root@iZ94ebgv853Z libevent-2.0.12-stable]# ./configure --prefix=/usr/local/libevent-2.0.12-stable/
[root@iZ94ebgv853Z libevent-2.0.12-stable]#make
[root@iZ94ebgv853Z libevent-2.0.12-stable]#make install


2、安装tokyocabinet-1.4.47.tar.gz

Bash
[root@iZ94ebgv853Z ~]# wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz
[root@iZ94ebgv853Z ~]# tar xf tokyocabinet-1.4.47.tar.gz
[root@iZ94ebgv853Z ~]# cd tokyocabinet-1.4.47
[root@iZ94ebgv853Z tokyocabinet-1.4.47]# ./configure --prefix=/usr/local/tokyocabinet-1.4.47/


提示错误:configure: error: zlib.h is require
需要安装zlib

Bash
[root@iZ94ebgv853Z ~]# wget http://www.winimage.com/zLibDll/zlib-1.2.5.tar.gz
[root@iZ94ebgv853Z ~]# tar xf zlib-1.2.5.tar.gz 
[root@iZ94ebgv853Z ~]# cd zlib-1.2.5
[root@iZ94ebgv853Z zlib-1.2.5]# ./configure


修改Makefile如下参数:

Bash
CC=gcc -fPIC
CFLAGS=-O3 -fPIC -D_LARGEFILE64_SOURCE=1
Bash
[root@iZ94ebgv853Z zlib-1.2.5]#make
[root@iZ94ebgv853Z zlib-1.2.5]#make install


再次编译:

Bash
[root@iZ94ebgv853Z tokyocabinet-1.4.47]# ./configure --prefix=/usr/local/tokyocabinet-1.4.47/


提示错误:configure: error: bzlib.h is require
需要安装bzlib

Bash
[root@iZ94ebgv853Z ~]# wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
[root@iZ94ebgv853Z ~]# tar xf bzip2-1.0.6.tar.gz 
[root@iZ94ebgv853Z ~]# cd bzip2-1.0.6


修改Makefile如下参数:

Bash
CC=gcc -fPIC
CFLAGS=-Wall -Winline -O2 -fPIC -g $(BIGFILES)
Bash
[root@iZ94ebgv853Z bzip2-1.0.6]# make && make install



再次编译:

Bash
[root@iZ94ebgv853Z tokyocabinet-1.4.47]# ./configure --prefix=/usr/local/tokyocabinet-1.4.47/
[root@iZ94ebgv853Z tokyocabinet-1.4.47]# make && make install



二、安装httpsqs-1.7.tar.gz

Bash
[root@iZ94ebgv853Z ~]# wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz
[root@iZ94ebgv853Z ~]# tar xf httpsqs-1.7.tar.gz 
[root@iZ94ebgv853Z ~]# cd httpsqs-1.7
[root@iZ94ebgv853Z httpsqs-1.7]# make && make install



三、    配置httpsqs

Bash
[root@iZ94ebgv853Z ~]# mkdir /usr/local/httpsqs_queue   #建立存储目录


建立启动脚本httpsqs.sh

Bash
[root@iZ94ebgv853Z ~]# vim /etc/init.d/httpsqs.sh


内容如下:

Bash
! /bin/sh
ulimit -SHn 65535
/usr/bin/httpsqs -d -p 1218 -t 10 -c 10000 -m 512 -x /usr/local/httpsqs_queue -a pwd123



带密码启动:

Bash
/usr/bin/httpsqs -d -p 1218 -t 10 -c 10000 -m 512 -x /usr/local/httpsqs_queue -a pwd123

不带密码启动:

Bash
/usr/bin/httpsqs -d -p 1218 -t 10 -c 10000 -m 512 -x /usr/local/httpsqs_queue
Bash
[root@iZ94ebgv853Z ~]# chmod +x /etc/init.d/httpsqs.sh  #增加可执行权限


在/etc/rc.local中添加:

Bash
/bin/bash /etc/init.d/httpsqs.sh


四、    设置防火墙

Bash
[root@iZ94ebgv853Z ~]# iptables -I INPUT 1 -p tcp --dport 1218 -j ACCEPT
[root@iZ94ebgv853Z ~]# service iptables save



五、    测试:
写队列

Bash
http://IP:1218/?name=your_queue_name&opt=put&data=TEXT&auth=pwd123



读队列

Bash
http://IP:1218/?charset=utf-8&name=your_queue_name&opt=get&auth=pwd123

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值