memcached

安装libevent 
tar zxvf libevent-1.4.5-stable.tar.gz 
cd libevent-1.4.5-stable 
./configure --prefix=/usr/ 
make 
make install

安装memcache 
tar zxvf memcached-1.2.5.tar.gz
cd memcached-1.2.5
./configure --with-libevent=/usr/ 
make 
make install 

配置LD_LIBRARY_PATH

 vim ~/.bash_profile
# 在最后加入一行 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib 

启动memcache
memcached -d -m 128 -p 12000 -u root
参数名称 作用
-d 作为守护进程启动
-m 指定使用的内存大小
-p 服务器端的监听端口
-u 用于运行memcached的用户 

确认memcache成功启动
[root@ESXVM016401 libevent]# ps aux | grep memcached
root 19913 0.0 0.0 18240 2184 ? Ss 11:14 0:00 memcached -d -m 128 -p 12000 -u root
root 19933 0.0 0.0 61148 700 pts/4 R+ 11:17 0:00 grep memcached 

IHS中需要修改的地方:
打开httpd.conf cd /opt/IBM/HTTPServer/conf
vim httpd.conf

加载mod_rewrite
去掉该行行首的#
 # LoadModule rewrite_module modules/mod_rewrite.so
添加重写规则,紧跟在所有LoadModule指令之后
 <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteRule ^/online/s/(.*)/(.*)\.html$ /online/$1Action.do?method=$2&staticDisplay=front&%{QUERY_STRING} [PT]
     RewriteRule ^/online/si/(.*)/(.*)/(.*)\.html$ /online/$1Action.do?method=$2&id=$3&staticDisplay=front&%{QUERY_STRING} [PT]
     RewriteRule ^/online/sc/(.*)/(.*)/(.*)\.html$ /online/$1Action.do?method=$2&category=$3&staticDisplay=front&%{QUERY_STRING} [PT]
     RewriteRule ^/online/st/(.*)/(.*)/(.*)\.html$ /online/$1Action.do?method=$2&typeId=$3&staticDisplay=front&%{QUERY_STRING} [PT]
</IfModule>

posted @ 2009-04-28 19:23  大熊x  阅读(212)  评论(0编辑  收藏  举报