1.安装nginx1.8.1
1) 下载安装包 http://nginx.org/en/download.html
2)创建一个文件夹,并解压刚才下载的包
tar zxvf nginx-1.8.1.tar.gz
- cd /mnt/nginx-1.8.1
- ./configure
- yum -y install pcre-devel
- yum -y install openssl-devel
- make
- make install
- cd /usr/local/nginx/sbin
- ./nginx -t
3) 启动,访问测试
4) 其他命令
2.安装memcahce
curl -O http://www.monkey.org/~provos/libevent-2.0.13-stable.tar.gz
tar -zxvf libevent-2.0.13-stable.tar.gz 先安装libevent(参考http://blog.csdn.net/zhangm168/article/details/6272801)
tar -zxvf memcached-1.4.0.tar.gz 解压
cd memcached-1.4.0
./configure --with-libevent=/usr/local 设置安装依赖libevent
make 编译
make install 安装
/usr/local/bin/memcached -d -m 200 -u root -c 256 -p 11211 -P /tmp/memcache.pid 启动memcahce
3.配置tomcat
tomcat的配置文件 context.xml。
修改后的tomcat node1配置文件
[root@node1 ~]# cd /data/node1/conf/
[root@node1 conf]# tail context.xml
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:192.168.1.84:11211"
requestUriIgnorePattern=".*\.(png|gif|jpg|css|js|ico|jpeg|htm|html)$"
sessionBackupTimeout="1800000"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>
</Context>
4.在tomcat中导入支持msm的jar包
5.修改nginx