码迷,mamicode.com
首页 > 其他好文 > 详细

tomcat+redis

时间:2016-08-13 01:10:54      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

tomcat配置好redis后一直打不开网页 ,各种版本各种jar包更换还是不行,context.xml配上那句话tomcat重启后就无法打开网页,最后参考了一文章找到问题是:tomcat-redis-session-manager1.2.jar里面的RedisSessionHandlerValve和RedisSessionManager的路径是com/orangefunction/tomcat/  ,网上文章写的路径可能和你的jar包里的路径不一样导致出错,这里一定要把jar解压开看看路径和tomcat的context.xml里面写的是不是一样

<Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" />
<Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager"

 

参考1

参考2

tomcat安装配置

redis3.2.2安装

nginx安装

 

nginx负载均衡配置 


[root@nginx conf]# vi nginx.conf   主要修改两个地方  还有一些日志的行去掉注释,粗体的两个地方要一直

#gzip on;
upstream localhost {
server 192.168.1.5:8080 weight=1;
server 192.168.1.6:8080 weight=2;
}

 


location / {
root html;
index index.html index.htm;
proxy_pass http://localhost;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100m;
}

 

.5 .6是tomcat

.112nginx   

.7.8是redis

 

http://192.168.1.112/session.jsp   通过nginx负载均衡转发到tomcat后的结果sessionid一样  如果单独访问两个tomcat的话session还是不一样的

tomcat+redis

标签:

原文地址:http://www.cnblogs.com/hanxing/p/5766927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!