HTTPSQS队列服务安装

1、安装依赖的关系包

yum install bzip2-devel

安装libevent,下载libevent

http://libevent.org/

解压安装

./configure --prefix=/opt/libevent
make && make install


2、安装tokyocabinet依赖包,到下面地址下载

https://code.google.com/p/httpsqs/downloads/list

3、解压安装

./configure --prefix=/opt/tokyo
make&&make install

4、下载HTTPSQS主程序

http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz

解压后,进入目录

vim Makefile 

更改里面的内容,如下


# Makefile for httpsqs
CC=gcc
CFLAGS=-Wl,-rpath,/opt/libevent/lib/:/opt/tokyo/lib/ -L/opt/libevent/lib/ -levent -L/opt/tokyo/lib/ -ltokyocabinet -I/opt/libevent/include/ -I/opt/tokyo/include/ -lz -lbz2 -lrt -lpthread -lm -lc -O2 -g

更改并保存

make && make install

错误处理:

/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [httpsqs] Error 1

需要安装:yum install zlib-devel
启动服务

httpsqs -d -p 1218 -x /home/httpsqs/queue