FAMILY = Father And Mother I Love You

部署标签

搭建Tomcat集群&通过Redis缓存共享session的一种流行方案

我们使用单台Tomcat的时候不会有共享sesssion的疑虑,只要使用Tomcat的默认配置即可,session即可存储在Tomcat上。但是随着业务的扩大,增加Tomcat节点构成Tomcat集群大势所趋,分布式带来了增加更大规模并发请求的优势,但是也随之到来了一个问题,每个Tomcat只存储来访问自己的请求产生的session,如果Tomcat-A已经为客户端C创建了会话session,那么Tomcat-B并不知道客户端已与集群中的Tomcat-A产生了会话,在访问时就会为C再创建一份session,如果是基于session的验证会话权限的接口(如用户登录认证后才可访问的数据接口),将会导致在访问集群中不同节点的时候重复认证。session的不共享导致原来的会话管理机制在Tomcat集群中无法工作。
4139826312592ba7407981c_articlexjpg

2018-10-21

16 Tips to Speed-up Your Website

If it’s taking more than 3 seconds then you should be really worried about your site speed. Because No-one really likes slow loading websites.

googlepagespeedpng

There is no meaning of doing all the hard work to produce amazing content because if your website is too slow to load, the user is going to get bounced from your website.

So if you are really worried about your website speed and want to optimize it for your user and SEO you are at the right place.

How to Run Java Program Automatically on Tomcat Startup

Recently I wanted to start my standalone Java Application on Tomcat Startup. Also found so many other related questions on net. i.e.

  • I need to run an application that can run automatically that when the tomcat starts..? any suggestions…?
  • how can I start my application by default on tomcat server start/restart?
  • Is it possible to edit tomcat startup services?
  • How to Start a service automatically when the tomcat starts
    ApacheTomcatCrunchifyTipsjpg

Apache Web Server Hardening and Security Guide

The Web Server is a crucial part of web-based applications. Apache Web Server is often placed at the edge of the network hence it becomes one of the most vulnerable services to attack.

Having default configuration supply much sensitive information which may help hacker to prepare for an attack the web server.

The majority of web application attacks are through XSS, Info Leakage, Session Management and PHP Injection attacks which are due to weak programming code and failure to sanitize web application infrastructure.

apachesecurityhardeningguidepng

开源博客Solo零基础搭建,以及Apache、Tomcat下多应用部署

终于下定决心搭建一个博客,记录下日常的生活了。经过对比,还是觉得solo这个框架相对来说比较简单,同时也是对Java比较熟吧,在此感谢B3log的无私奉献。先来张张小妞的生活照吧。
1378805150jpg

搭建过程整体比较顺利,官方已经有比较详细的教程了,我主要修改采用了MariaDB。同时验证了以下参数的意义:

  1. 如果单个项目使用一个数据库的话,可以考虑去掉local.properties中的jdbc.tablePrefix,数据库表就不需要增加prefix了;
  2. 第二参数就是solo.properties中的uploadDir,如果配置相对路径,将是Tomcat(如果你使用Tomcat的话)的根目录。

另外,最主要的问题是解决同一域名访问Apache及Tomcat下多个应用的问题。