Home > Article > Backend Development > nginx+tomcat7+redis cluster configuration
1. Prepare the required installation packages and jar packages
nginx-1.6.3.tar.gz
apache-tomcat-7.0.62.tar.gz
redis-3.0.2.tar.gz
jdk- 7u79-linux-x64.tar.gz
jedis-2.1.0.jar
commons-pool-1.6.jar
tomcat-redis-session-manager-tomcat-7.jar
Description: used here The jedis version is 2.1.0, and commons-pool is 1.6.
There are many places on the Internet that use versions of jedis 2.6 or above and commons-pool 2.0. The class not found error will occur. This is due to the commons-pool 2.0 version. The commons/pool/impl folder is missing.
2.tomcat configuration
Add tomcat session management in context.xml
<Valve className="com.radiadesign.catalina.session.RedisSessionHandlerValve" /> <Manager className="com.radiadesign.catalina.session.RedisSessionManager" host="192.168.2.20"//redis的host地址 port="6379"//端口 database="0" maxInactiveInterval="60" />//redis的key值超时时间
3.nginx configuration
upstream tomcat{
0.0.1:18098;
}
server
{
listen 80;
server_name www.myserver.com;
index maomingIndex.do index.do index.jsp index.html;
location/{
proxy_redirect off;
proxy_pass http://tomcat ;
rewrite_log; -session-manager/downloadsjedis source code address: https://github.com/xetorthio/jedis
The above introduces the nginx+tomcat7+redis cluster configuration, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.