zoukankan      html  css  js  c++  java
  • tomcat+redis

    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还是不一样的

  • 相关阅读:
    GitHub 实现多人协同提交代码并且权限分组管理
    前端第一篇文章-http标准
    介绍Android电量
    音频编码格式
    PPT
    Word
    HTML 之 JavaScript
    HTML 之 CSS
    HTML 之 HTTP 协议(请求协议以及响应协议)
    HTML 之 标签
  • 原文地址:https://www.cnblogs.com/hanxing/p/5766927.html
Copyright © 2011-2022 走看看