配置lighttpd with mod_magnet 支持memcache 支持cache-fam

0
1284

mod_magnet模块相信用lighttpd跑wordpress的同学不会太陌生,supercache插件就需要它的支持,来提供更为强大的rewrite支持,而对cache的支持有助于提高代码的执行效率。

首先安装一些必要的包:

yum install gamin-devel  libevent-devel pcre-devel
yum install --enablerepo=rpmforge libmemcache-devel

然后是rpm包:

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
wget http://packages.sw.be/lua/lua-devel-5.1.4-1.el5.rf.i386.rpm
wget http://packages.sw.be/lua/lua-5.1.4-1.el5.rf.i386.rpm
rpm -i lua-5.1.4-1.el5.rf.i386.rpm
rpm -i lua-devel-5.1.4-1.el5.rf.i386.rpm

安装

yum install gcc glib2-devel autoconf automake libtool openssl-devel pcre-devel bzip2-devel gzip-devel zlib-develyum install gcc glib2-devel autoconf automake libtool openssl-devel pcre-devel bzip2-devel gzip-devel zlib-devel

一次性都装上 😛

接着来lighttpd的部分:

有些系统本身没有make, 安装一下,一条命令就搞定了

yum install make


下载lighty 1.4.26

wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.gz
tar -zxvf lighttpd-1.4.26.tar.gz
cd lighttpd-1.4.26

注入:

export LUA_CFLAGS="-I/usr/local/include" 
 export LUA_LIBS="-L/usr/local/lib -llua"

安装:

./configure -–with-fam -–with-memcache --with-pcre --with-lua --with-zlib --with-openssl --sbindir=/usr/sbin --sysconfdir=/etc/lighttpd
make
make install
cp /usr/local/lxlabs/kloxo/file/lighttpd/conf/kloxo/virtualhost.conf /etc/lighttpd/conf/kloxo/

重起服务:

/etc/init.d/lighttpd restart 或者 service lighttpd restart