{"id":55824,"date":"2025-08-14T08:44:49","date_gmt":"2025-08-14T00:44:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55824.html"},"modified":"2025-08-14T08:44:49","modified_gmt":"2025-08-14T00:44:49","slug":"%e4%bc%81%e4%b8%9a%e7%ba%a7web%e5%ba%94%e7%94%a8%e6%9c%8d%e5%8a%a1%e5%99%a8tomcat-3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55824.html","title":{"rendered":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT"},"content":{"rendered":"<p>                    <span style=\"color:#333333\">\u4e00<\/span><span style=\"color:#333333\"> WEB<\/span><span style=\"color:#333333\">\u6280\u672f<\/span><\/p>\n<p><span style=\"color:#333333\">\u4e8c<\/span><span style=\"color:#333333\"> WEB<\/span><span style=\"color:#333333\">\u6846\u67b6<\/span><\/p>\n<p><span style=\"color:#333333\">web<\/span><span style=\"color:#333333\">\u8d44\u6e90\u548c\u8bbf\u95ee<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"432\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004444-689d317ccaa1f.png\" width=\"702\" \/><\/p>\n<p><span style=\"color:#333333\">\u4ece\u9759\u6001\u670d\u52a1\u5668\u8bf7\u6c42<\/span><span style=\"color:#333333\">HTML<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">CSS<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">JS<\/span><span style=\"color:#333333\">\u7b49\u6587\u4ef6\u53d1\u9001\u5230\u6d4f\u89c8\u5668\u7aef&#xff0c;\u6d4f\u89c8\u5668\u7aef\u63a5\u6536\u540e\u6e32\u67d3\u5728\u6d4f\u89c8\u5668\u4e0a\u4ece\u56fe\u7247\u670d\u52a1 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5668\u8bf7\u6c42\u56fe\u7247\u8d44\u6e90\u663e\u793a <\/span><\/p>\n<p><span style=\"color:#333333\">\u4ece\u4e1a\u52a1\u670d\u52a1\u5668\u8bbf\u95ee\u52a8\u6001\u5185\u5bb9&#xff0c;\u52a8\u6001\u5185\u5bb9\u662f\u8bf7\u6c42\u540e\u6709\u540e\u53f0\u670d\u52a1\u8bbf\u95ee\u6570\u636e\u5e93\u540e\u5f97\u5230\u7684&#xff0c;\u6700\u7ec8\u8fd4\u56de\u5230\u6d4f\u89c8\u5668\u7aef <\/span><\/p>\n<p><span style=\"color:#333333\">\u624b\u673a<\/span><span style=\"color:#333333\"> App <\/span><span style=\"color:#333333\">\u8bbf\u95ee <\/span><\/p>\n<p><span style=\"color:#333333\">\u5185\u7f6e\u4e86<\/span><span style=\"color:#333333\">HTML<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">JS<\/span><span style=\"color:#333333\">\u6587\u4ef6&#xff0c;\u4e0d\u9700\u8981\u4ece\u9759\u6001<\/span><span style=\"color:#333333\">WEB<\/span><span style=\"color:#333333\">\u670d\u52a1\u5668\u4e0b\u8f7d<\/span><span style=\"color:#333333\"> JS <\/span><span style=\"color:#333333\">\u6216<\/span><span style=\"color:#333333\"> HTML<\/span><span style=\"color:#333333\">\u3002\u4e3a\u7684\u5c31\u662f\u51cf\u5c11\u6587\u4ef6\u7684\u53d1\u9001&#xff0c;\u73b0\u4ee3\u524d <\/span><\/p>\n<p><span style=\"color:#333333\">\u7aef\u5f00\u53d1\u4f7f\u7528\u7684<\/span><span style=\"color:#333333\">JS<\/span><span style=\"color:#333333\">\u6587\u4ef6\u592a\u591a\u6216\u592a\u5927\u4e86 <\/span><\/p>\n<p><span style=\"color:#333333\">\u6709\u5fc5\u8981\u5c31\u4ece\u56fe\u7247\u670d\u52a1\u5668\u8bf7\u6c42\u56fe\u7247&#xff0c;\u4ece\u4e1a\u52a1\u670d\u52a1\u5668\u8bf7\u6c42\u52a8\u6001\u6570\u636e <\/span><\/p>\n<p><span style=\"color:#333333\">\u5ba2\u6237\u9700\u6c42\u591a\u6837&#xff0c;\u66f4\u591a\u7684\u5185\u5bb9\u8fd8\u662f\u9700\u8981\u7531\u4e1a\u52a1\u670d\u52a1\u5668\u63d0\u4f9b&#xff0c;\u4e1a\u52a1\u670d\u52a1\u5668\u5f80\u5f80\u90fd\u662f\u7531\u4e00\u7ec4\u670d\u52a1\u5668\u7ec4\u6210\u3002<\/span><\/p>\n<p><span style=\"color:#333333\">\u7ed3\u5408\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u90e8\u7f72 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5e38\u89c1\u90e8\u7f72\u65b9\u5f0f\u4ecb\u7ecd<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"411\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004444-689d317ce6ff9.png\" width=\"686\" \/><\/p>\n<p><span style=\"color:#333333\">\u5b89\u88c5<\/span><span style=\"color:#333333\"> Tomcat&#xff1a;<\/span><\/p>\n<p>#\u5b89\u88c5java\u73af\u5883<br \/>\n[root&#064;tomcat ~]# yum install java-1.8.0-openjdk.x86_64 -y<br \/>\n#\u67e5\u770bjava\u7248\u672c<br \/>\n[root&#064;tomcatA ~]# java -version<br \/>\nopenjdk version &#034;1.8.0_402&#034;<br \/>\nOpenJDK Runtime Environment (build 1.8.0_402-b06)<br \/>\nOpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)<br \/>\n#\u67e5\u770bjava\u7684\u73af\u5883\u76ee\u5f55<br \/>\n[root&#064;tomcatA ~]# which java<br \/>\n\/usr\/bin\/java<br \/>\n[root&#064;tomcatA ~]# ll \/usr\/bin\/java<br \/>\nlrwxrwxrwx 1 root root 22 Jul 30 10:41 \/usr\/bin\/java -&gt; \/etc\/alternatives\/java<br \/>\n#java\u7684\u8fd0\u884c\u73af\u5883<br \/>\n[root&#064;tomcatA ~]# cd \/etc\/alternatives\/jre<br \/>\n[root&#064;tomcatA jre]# ls<br \/>\nASSEMBLY_EXCEPTION bin lib LICENSE THIRD_PARTY_README<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"195\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004445-689d317d09fe3.png\" width=\"661\" \/><\/p>\n<p><span style=\"color:#333333\">\u5b89\u88c5\u5e76\u542f\u52a8<\/span><span style=\"color:#333333\">tomcat&#xff1a;<\/span><\/p>\n<p>#\u89e3\u538b\u5e76\u751f\u6210tomcat\u7684\u7a0b\u5e8f\u76ee\u5f55<br \/>\n[root&#064;tomcatA ~]# tar zxf apache-tomcat-9.0.107.tar.gz -C \/usr\/local\/<br \/>\n[root&#064;tomcatA ~]# cd \/usr\/local\/<br \/>\n[root&#064;tomcatA local]# ls<br \/>\napache-tomcat-9.0.107 bin etc games include lib lib64 libexec sbin share<br \/>\nsrc<br \/>\n[root&#064;tomcatA local]# mv apache-tomcat-9.0.107\/ tomcat<br \/>\n[root&#064;tomcatA local]# ls<br \/>\n3.\u67e5\u770b\u7aef\u53e3<br \/>\n4.\u8bbf\u95eetomcat<br \/>\nbin etc games include lib lib64 libexec sbin share src tomcat<br \/>\n#\u542f\u52a8tomcat<br \/>\n[root&#064;tomcatA local]# cd tomcat\/<br \/>\n[root&#064;tomcatA tomcat]# cd bin\/<br \/>\n[root&#064;tomcatA bin]# ls<br \/>\nbootstrap.jar commons-daemon-native.tar.gz makebase.sh tomcatjuli.jar<br \/>\ncatalina.bat configtest.bat setclasspath.bat tomcatnative.tar.gz<br \/>\ncatalina.sh configtest.sh setclasspath.sh toolwrapper.bat<br \/>\ncatalina-tasks.xml daemon.sh shutdown.bat toolwrapper.sh<br \/>\nciphers.bat digest.bat shutdown.sh version.bat<br \/>\nciphers.sh digest.sh startup.bat version.sh<br \/>\ncommons-daemon.jar makebase.bat startup.sh<br \/>\n[root&#064;tomcatA bin]# .\/startup.sh<br \/>\nUsing CATALINA_BASE: \/usr\/local\/tomcat<br \/>\nUsing CATALINA_HOME: \/usr\/local\/tomcat<br \/>\nUsing CATALINA_TMPDIR: \/usr\/local\/tomcat\/temp<br \/>\nUsing JRE_HOME: \/usr<br \/>\nUsing CLASSPATH:<br \/>\n\/usr\/local\/tomcat\/bin\/bootstrap.jar:\/usr\/local\/tomcat\/bin\/tomcat-juli.jar<br \/>\nUsing CATALINA_OPTS:<br \/>\nTomcat started.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"429\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004445-689d317d1eb77.png\" width=\"935\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"730\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004445-689d317d4dfb8.png\" width=\"1545\" \/><\/p>\n<p><span style=\"color:#333333\">\u751f\u6210<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u7684\u542f\u52a8\u6587\u4ef6&#xff1a;<\/span><\/p>\n<p><span style=\"color:#333333\">\u751f\u6210<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/span><\/p>\n<p>[root&#064;tomcat ~]# vim \/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nJAVA_HOME&#061;\/etc\/alternatives\/jre<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"51\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004445-689d317defdcf.png\" width=\"595\" \/><\/p>\n<p><span style=\"color:#333333\">\u751f\u6210\u542f\u52a8\u6587\u4ef6<\/span><\/p>\n<p>[root&#064;tomcat ~]# vim \/lib\/systemd\/system\/tomcat.service<br \/>\n[Unit]<br \/>\nDescription&#061;Tomcat<br \/>\n#After&#061;syslog.target network.target remote-fs.target nss-lookup.target<br \/>\nAfter&#061;syslog.target network.target<br \/>\n[Service]<br \/>\nType&#061;forking<br \/>\nEnvironmentFile&#061;\/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nExecStart&#061;\/usr\/local\/tomcat\/bin\/startup.sh<br \/>\nExecStop&#061;\/usr\/local\/tomcat\/bin\/shutdown.sh<br \/>\nPrivateTmp&#061;true<br \/>\nUser&#061;tomcat<br \/>\nGroup&#061;tomcat<br \/>\n[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"400\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e095ea.png\" width=\"736\" \/><\/p>\n<p><span style=\"color:#333333\">\u751f\u6210<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u7528\u6237\u5e76\u8bbe\u5b9a\u8f6f\u4ef6\u5b89\u88c5\u76ee\u5f55\u6743\u9650<\/span><\/p>\n<p>useradd -s \/sbin\/nologin -M tomcat<br \/>\nchown tomcat.tomcat \/usr\/local\/tomcat\/ -R<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"41\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e238de.png\" width=\"655\" \/><\/p>\n<p><span style=\"color:#333333\">\u7528\u542f\u52a8\u811a\u672c\u5f00\u542f\u670d\u52a1&#xff1a;<\/span><\/p>\n<p>systemctl enable &#8211;now tomcat<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"62\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e314ae.png\" width=\"924\" \/><\/p>\n<p>\u96c6\u7fa4\u90e8\u7f72\u53ca\u7ed8\u753b\u7ed1\u5b9a:<\/p>\n<p><span style=\"color:#333333\">\u5229\u7528<\/span><span style=\"color:#333333\"> nginx <\/span><span style=\"color:#333333\">\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"255\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e42d85.png\" width=\"684\" \/><\/p>\n<p><span style=\"color:#333333\">\u5229\u7528<\/span><span style=\"color:#333333\">nginx<\/span><span style=\"color:#333333\">\u53cd\u5411\u4ee3\u7406\u529f\u80fd&#xff0c;\u5b9e\u73b0\u56fe\u4e2d\u7684\u4ee3\u7406\u529f\u80fd&#xff0c;\u5c06\u7528\u6237\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u81f3\u6307\u5b9a\u7684\u540c\u4e00\u4e2a<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u4e3b\u673a <\/span><\/p>\n<p><span style=\"color:#333333\">\u5229\u7528<\/span><span style=\"color:#333333\">nginx<\/span><span style=\"color:#333333\">\u6307\u4ee4<\/span><span style=\"color:#333333\">proxy_pass <\/span><span style=\"color:#333333\">\u53ef\u4ee5\u5411\u540e\u7aef\u670d\u52a1\u5668\u8f6c\u53d1\u8bf7\u6c42\u62a5\u6587<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u5e76\u4e14\u5728\u8f6c\u53d1\u65f6\u4f1a\u4fdd\u7559\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u62a5\u6587\u4e2d\u7684 host\u9996\u90e8<\/span><\/p>\n<p>\u5b89\u88c5nginx&#xff1a;<\/p>\n<p>dnf install nginx -y<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"45\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e57f2a.png\" width=\"387\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317e65f73.png\" width=\"959\" \/><\/p>\n<p>vim vhosts.conf<\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name www.timinglee.org;<\/p>\n<p>    location ~ \\\\.jsp$ {<br \/>\n        proxy_pass http:\/\/172.25.254.10:8080;<br \/>\n    }<br \/>\n}<br \/>\n~ <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"192\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317eab33d.png\" width=\"695\" \/><\/p>\n<p>vim \/etc\/hosts<\/p>\n<p>\u91cd\u542fA,B\u7684tomcat&#xff1a;<\/p>\n<p>systemctl restart tomcat.service <\/p>\n<p>\u91cd\u542fnginx&#xff1a;<\/p>\n<p>systemctl start nginx<\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p>curl -I 172.25.254.10:8080\/test.jsp<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"530\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004446-689d317ebe538.png\" width=\"796\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"730\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004447-689d317f07b77.png\" width=\"1545\" \/><\/p>\n<p><span style=\"color:#333333\">\u5b9e\u73b0<\/span><span style=\"color:#333333\">tomcat<\/span><span style=\"color:#333333\">\u4e2d\u7684\u8d1f\u8f7d\u5747\u8861 <\/span><\/p>\n<p><span style=\"color:#333333\">\u52a8\u6001\u670d\u52a1\u5668\u7684\u95ee\u9898&#xff0c;\u5f80\u5f80\u5c31\u662f\u5e76\u53d1\u80fd\u529b\u592a\u5f31&#xff0c;\u5f80\u5f80\u9700\u8981\u591a\u53f0\u52a8\u6001\u670d\u52a1\u5668\u4e00\u8d77\u63d0\u4f9b\u670d\u52a1\u3002\u5982\u4f55\u628a\u5e76\u53d1\u7684\u538b <\/span><\/p>\n<p><span style=\"color:#333333\">\u529b\u5206\u644a&#xff0c;\u8fd9\u5c31\u9700\u8981\u8c03\u5ea6&#xff0c;\u91c7\u7528\u4e00\u5b9a\u7684\u8c03\u5ea6\u7b56\u7565&#xff0c;\u5c06\u8bf7\u6c42\u5206\u53d1\u7ed9\u4e0d\u540c\u7684\u670d\u52a1\u5668&#xff0c;\u8fd9\u5c31\u662f<\/span><span style=\"color:#333333\">Load Balance<\/span><span style=\"color:#333333\">\u8d1f\u8f7d <\/span><\/p>\n<p><span style=\"color:#333333\">\u5747\u8861\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5f53\u5355\u673a<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">&#xff0c;\u6f14\u5316\u51fa\u591a\u673a\u591a\u7ea7\u90e8\u7f72\u7684\u65f6\u5019&#xff0c;\u4e00\u4e2a\u95ee\u9898\u4fbf\u51f8\u663e\u51fa\u6765&#xff0c;\u8fd9\u5c31\u662f<\/span><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u3002\u800c\u8fd9\u4e2a\u95ee\u9898\u7684\u7531 <\/span><\/p>\n<p><span style=\"color:#333333\">\u6765&#xff0c;\u90fd\u662f\u7531\u4e8e<\/span><span style=\"color:#333333\">HTTP<\/span><span style=\"color:#333333\">\u534f\u8bae\u5728\u8bbe\u8ba1\u4e4b\u521d\u6ca1\u6709\u60f3\u5230\u672a\u6765\u7684\u53d1\u5c55\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u00a0HTTP<\/span><span style=\"color:#333333\">\u7684\u65e0\u72b6\u6001&#xff0c;\u6709\u8fde\u63a5\u548c\u77ed\u8fde\u63a5 <\/span><\/p>\n<p><span style=\"color:#333333\">\u65e0\u72b6\u6001&#xff1a;\u6307\u7684\u662f\u670d\u52a1\u5668\u7aef\u65e0\u6cd5\u77e5\u9053<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">\u6b21\u8bf7\u6c42\u4e4b\u95f4\u7684\u8054\u7cfb&#xff0c;\u5373\u4f7f\u662f\u524d\u540e<\/span><span style=\"color:#333333\">2<\/span><span style=\"color:#333333\">\u6b21\u8bf7\u6c42\u6765\u81ea\u540c\u4e00\u4e2a\u6d4f\u89c8\u5668&#xff0c;\u4e5f <\/span><\/p>\n<p><span style=\"color:#333333\">\u6ca1\u6709\u4efb\u4f55\u6570\u636e\u80fd\u591f\u5224\u65ad\u51fa\u662f\u540c\u4e00\u4e2a\u6d4f\u89c8\u5668\u7684\u8bf7\u6c42\u3002\u540e\u6765\u53ef\u4ee5\u901a\u8fc7<\/span><span style=\"color:#333333\">cookie<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u673a\u5236\u6765\u5224\u65ad\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u6d4f\u89c8\u5668\u7aef\u7b2c\u4e00\u6b21<\/span><span style=\"color:#333333\">HTTP<\/span><span style=\"color:#333333\">\u8bf7\u6c42\u670d\u52a1\u5668\u7aef\u65f6&#xff0c;\u5728\u670d\u52a1\u5668\u7aef\u4f7f\u7528<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u8fd9\u79cd\u6280\u672f&#xff0c;\u5c31\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u7aef <\/span><\/p>\n<p><span style=\"color:#333333\">\u4ea7\u751f\u4e00\u4e2a\u968f\u673a\u503c\u5373<\/span><span style=\"color:#333333\">SessionID<\/span><span style=\"color:#333333\">\u53d1\u7ed9\u6d4f\u89c8\u5668\u7aef&#xff0c;\u6d4f\u89c8\u5668\u7aef\u6536\u5230\u540e\u4f1a\u4fdd\u6301\u8fd9\u4e2a<\/span><span style=\"color:#333333\">SessionID<\/span><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">Cookie<\/span><span style=\"color:#333333\">\u5f53 <\/span><\/p>\n<p><span style=\"color:#333333\">\u4e2d&#xff0c;\u8fd9\u4e2a<\/span><span style=\"color:#333333\">Cookie<\/span><span style=\"color:#333333\">\u503c\u4e00\u822c\u4e0d\u80fd\u6301\u4e45\u5b58\u50a8&#xff0c;\u6d4f\u89c8\u5668\u5173\u95ed\u5c31\u6d88\u5931\u3002\u6d4f\u89c8\u5668\u5728\u6bcf\u4e00\u6b21\u63d0\u4ea4<\/span><span style=\"color:#333333\">HTTP<\/span><span style=\"color:#333333\">\u8bf7\u6c42\u7684 <\/span><\/p>\n<p><span style=\"color:#333333\">\u65f6\u5019\u4f1a\u628a\u8fd9\u4e2a<\/span><span style=\"color:#333333\">SessionID<\/span><span style=\"color:#333333\">\u4f20\u7ed9\u670d\u52a1\u5668\u7aef&#xff0c;\u670d\u52a1\u5668\u7aef\u5c31\u53ef\u4ee5\u901a\u8fc7\u6bd4\u5bf9\u77e5\u9053\u662f\u8c01\u4e86 <\/span><\/p>\n<p><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u901a\u5e38\u4f1a\u4fdd\u5b58\u5728\u670d\u52a1\u5668\u7aef\u5185\u5b58\u4e2d&#xff0c;\u5982\u679c\u6ca1\u6709\u6301\u4e45\u5316&#xff0c;\u5219\u6613\u4e22\u5931 <\/span><\/p>\n<p><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u4f1a\u5b9a\u65f6\u8fc7\u671f\u3002\u8fc7\u671f\u540e\u6d4f\u89c8\u5668\u5982\u679c\u518d\u8bbf\u95ee&#xff0c;\u670d\u52a1\u7aef\u53d1\u73b0\u6ca1\u6709\u6b64<\/span><span style=\"color:#333333\">ID<\/span><span style=\"color:#333333\">&#xff0c;\u5c06\u7ed9\u6d4f\u89c8\u5668\u7aef\u91cd\u65b0\u53d1 <\/span><\/p>\n<p><span style=\"color:#333333\">\u65b0\u7684<\/span><span style=\"color:#333333\">SessionID <\/span><\/p>\n<p><span style=\"color:#333333\">[root&#064;Nginx ~]# vim \/usr\/local\/nginx\/conf.d\/vhosts.conf <\/span><\/p>\n<p><span style=\"color:#333333\">location ~ \\\\.jsp$ { <\/span><\/p>\n<p><span style=\"color:#333333\">proxy_pass http:\/\/172.25.254.10:8080; <\/span><\/p>\n<p><span style=\"color:#333333\">} <\/span><\/p>\n<p><span style=\"color:#333333\">lee.timinglee.org\/test.jsp<\/span><span style=\"color:#333333\">\u66f4\u6362\u6d4f\u89c8\u5668\u4e5f\u5c06\u91cd\u65b0\u83b7\u5f97\u65b0\u7684<\/span><span style=\"color:#333333\">SessionID <\/span><\/p>\n<p><span style=\"color:#333333\">\u6709\u8fde\u63a5&#xff1a;\u662f\u56e0\u4e3a\u5b83\u57fa\u4e8e<\/span><span style=\"color:#333333\">TCP<\/span><span style=\"color:#333333\">\u534f\u8bae&#xff0c;\u662f\u9762\u5411\u8fde\u63a5\u7684&#xff0c;\u9700\u8981<\/span><span style=\"color:#333333\">3<\/span><span style=\"color:#333333\">\u6b21\u63e1\u624b\u3001<\/span><span style=\"color:#333333\">4<\/span><span style=\"color:#333333\">\u6b21\u65ad\u5f00\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u77ed\u8fde\u63a5&#xff1a;<\/span><span style=\"color:#333333\">Http 1.1<\/span><span style=\"color:#333333\">\u4e4b\u524d&#xff0c;\u90fd\u662f\u4e00\u4e2a\u8bf7\u6c42\u4e00\u4e2a\u8fde\u63a5&#xff0c;\u800c<\/span><span style=\"color:#333333\">Tcp<\/span><span style=\"color:#333333\">\u7684\u8fde\u63a5\u521b\u5efa\u9500\u6bc1\u6210\u672c\u9ad8&#xff0c;\u5bf9\u670d\u52a1\u5668\u6709\u5f88\u5927\u7684 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5f71\u54cd\u3002\u6240\u4ee5&#xff0c;\u81ea<\/span><span style=\"color:#333333\">Http 1.1<\/span><span style=\"color:#333333\">\u5f00\u59cb&#xff0c;\u652f\u6301<\/span><span style=\"color:#333333\">keep-alive<\/span><span style=\"color:#333333\">&#xff0c;\u9ed8\u8ba4\u4e5f\u5f00\u542f&#xff0c;\u4e00\u4e2a\u8fde\u63a5\u6253\u5f00\u540e&#xff0c;\u4f1a\u4fdd\u6301\u4e00\u6bb5\u65f6\u95f4 <\/span><\/p>\n<p><span style=\"color:#333333\">&#xff08;\u53ef\u8bbe\u7f6e&#xff09;&#xff0c;\u6d4f\u89c8\u5668\u518d\u8bbf\u95ee\u8be5\u670d\u52a1\u5668\u5c31\u4f7f\u7528\u8fd9\u4e2a<\/span><span style=\"color:#333333\">Tcp<\/span><span style=\"color:#333333\">\u8fde\u63a5&#xff0c;\u51cf\u8f7b\u4e86\u670d\u52a1\u5668\u538b\u529b&#xff0c;\u63d0\u9ad8\u4e86\u6548\u7387\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u670d\u52a1\u5668\u7aef\u5982\u679c\u6545\u969c&#xff0c;\u5373\u4f7f<\/span><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u88ab\u6301\u4e45\u5316\u4e86&#xff0c;\u4f46\u662f\u670d\u52a1\u6ca1\u6709\u6062\u590d\u524d\u90fd\u4e0d\u80fd\u4f7f\u7528\u8fd9\u4e9b<\/span><span style=\"color:#333333\">SessionID<\/span><span style=\"color:#333333\">\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5982\u679c\u4f7f\u7528<\/span><span style=\"color:#333333\">HAProxy<\/span><span style=\"color:#333333\">\u6216\u8005<\/span><span style=\"color:#333333\">Nginx<\/span><span style=\"color:#333333\">\u7b49\u505a\u8d1f\u8f7d\u5747\u8861\u5668&#xff0c;\u8c03\u5ea6\u5230\u4e86\u4e0d\u540c\u7684<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u4e0a&#xff0c;\u90a3\u4e48\u4e5f\u4f1a\u51fa\u73b0\u627e\u4e0d\u5230 <\/span><\/p>\n<p><span style=\"color:#333333\">SessionID<\/span><span style=\"color:#333333\">\u7684\u60c5\u51b5\u3002<\/span><\/p>\n<p>upstream tomcat {<br \/>\n    #ip_bash;<br \/>\n    #hash $cookie_JSESSIONID;<br \/>\n    server 172.25.254.10:8080;<br \/>\n    server 172.25.254.20:8080;<br \/>\n}<\/p>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name www.timinglee.org;<br \/>\n    root \/webdataw\/nginx\/timinglee.org\/lee;<br \/>\n    access_log \/var\/log\/nginx\/access.log;<br \/>\n    error_log \/var\/log\/nginx\/error.log;<br \/>\n    try_files $uri $uri.html $uri\/index.html \/error\/default.html;<\/p>\n<p>    location ~ \\\\.jsp$ {<br \/>\n        proxy_pass http:\/\/tomcat;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p>http:\/\/www.timinglee.org:8080\/test.jsp<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"730\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004447-689d317fb8f39.png\" width=\"1545\" \/><\/p>\n<p><span style=\"color:#333333\">Memcached&#xff1a;<\/span><\/p>\n<p><span style=\"color:#333333\">Memcached<\/span><span style=\"color:#333333\">\u7b80\u4ecb&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"120\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004448-689d318068aef.png\" width=\"661\" \/><\/p>\n<p><span style=\"color:#333333\">Memcached <\/span><span style=\"color:#333333\">\u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u4e0d\u652f\u6301\u6301\u4e45\u5316&#xff0c;\u57fa\u4e8e<\/span><span style=\"color:#333333\">Key-Value<\/span><span style=\"color:#333333\">\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edf<\/span><span style=\"color:#333333\">memcached <\/span><\/p>\n<p><span style=\"color:#333333\">\u867d\u7136\u6ca1\u6709\u50cf<\/span><span style=\"color:#333333\">redis<\/span><span style=\"color:#333333\">\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd&#xff0c;\u6bd4\u5982<\/span><span style=\"color:#333333\">RDB<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">AOF<\/span><span style=\"color:#333333\">\u90fd\u6ca1\u6709&#xff0c;\u4f46\u662f\u53ef\u4ee5\u901a\u8fc7\u505a\u96c6\u7fa4\u540c\u6b65\u7684\u65b9\u5f0f&#xff0c; <\/span><\/p>\n<p><span style=\"color:#333333\">\u8ba9\u5404<\/span><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u670d\u52a1\u5668\u7684\u6570\u636e\u8fdb\u884c\u540c\u6b65&#xff0c;\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u4e00\u81f4\u6027&#xff0c;\u5373\u4fdd\u8bc1\u5404<\/span><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u7684\u6570\u636e\u662f\u4e00\u6837 <\/span><\/p>\n<p><span style=\"color:#333333\">\u7684&#xff0c;\u5373\u4f7f\u6709\u4efb\u4f55\u4e00\u53f0<\/span><span style=\"color:#333333\"> memcached <\/span><span style=\"color:#333333\">\u53d1\u751f\u6545\u969c&#xff0c;\u53ea\u8981\u96c6\u7fa4\u4e2d\u6709\u4e00\u53f0<\/span><span style=\"color:#333333\"> memcached <\/span><span style=\"color:#333333\">\u53ef\u7528\u5c31\u4e0d\u4f1a\u51fa\u73b0\u6570\u636e\u4e22 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5931&#xff0c;\u5f53\u5176\u4ed6<\/span><span style=\"color:#333333\">memcached <\/span><span style=\"color:#333333\">\u91cd\u65b0\u52a0\u5165\u5230\u96c6\u7fa4\u7684\u65f6\u5019<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u53ef\u4ee5\u81ea\u52a8\u4ece\u6709\u6570\u636e\u7684<\/span><span style=\"color:#333333\">memcached <\/span><span style=\"color:#333333\">\u5f53\u4e2d\u81ea\u52a8\u83b7\u53d6\u6570\u636e\u5e76 <\/span><\/p>\n<p><span style=\"color:#333333\">\u63d0\u4f9b\u670d\u52a1\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">Memcached <\/span><span style=\"color:#333333\">\u501f\u52a9\u4e86\u64cd\u4f5c\u7cfb\u7edf\u7684<\/span><span style=\"color:#333333\"> libevent <\/span><span style=\"color:#333333\">\u5de5\u5177\u505a\u9ad8\u6548\u7684\u8bfb\u5199\u3002<\/span><span style=\"color:#333333\">libevent<\/span><span style=\"color:#333333\">\u662f\u4e2a\u7a0b\u5e8f\u5e93&#xff0c;\u5b83\u5c06<\/span><span style=\"color:#333333\">Linux<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">epoll<\/span><span style=\"color:#333333\">\u3001 <\/span><\/p>\n<p><span style=\"color:#333333\">BSD<\/span><span style=\"color:#333333\">\u7c7b\u64cd\u4f5c\u7cfb\u7edf\u7684<\/span><span style=\"color:#333333\">kqueue<\/span><span style=\"color:#333333\">\u7b49\u4e8b\u4ef6\u5904\u7406\u529f\u80fd\u5c01\u88c5\u6210\u7edf\u4e00\u7684\u63a5\u53e3\u3002\u5373\u4f7f\u5bf9\u670d\u52a1\u5668\u7684\u8fde\u63a5\u6570\u589e\u52a0&#xff0c;\u4e5f\u80fd\u53d1\u6325\u9ad8 <\/span><\/p>\n<p><span style=\"color:#333333\">\u6027\u80fd\u3002<\/span><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u4f7f\u7528\u8fd9\u4e2a<\/span><span style=\"color:#333333\">libevent<\/span><span style=\"color:#333333\">\u5e93&#xff0c;\u56e0\u6b64\u80fd\u5728<\/span><span style=\"color:#333333\">Linux<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">BSD<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">Solaris<\/span><span style=\"color:#333333\">\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u53d1\u6325\u5176\u9ad8\u6027\u80fd <\/span><\/p>\n<p><span style=\"color:#333333\">Memcached <\/span><span style=\"color:#333333\">\u652f\u6301\u6700\u5927\u7684\u5185\u5b58\u5b58\u50a8\u5bf9\u8c61\u4e3a<\/span><span style=\"color:#333333\">1M<\/span><span style=\"color:#333333\">&#xff0c;\u8d85\u8fc7<\/span><span style=\"color:#333333\">1M<\/span><span style=\"color:#333333\">\u7684\u6570\u636e\u53ef\u4ee5\u4f7f\u7528\u5ba2\u6237\u7aef\u538b\u7f29\u6216\u62c6\u5206\u62a5\u5305\u653e\u5230\u591a\u4e2a <\/span><\/p>\n<p><span style=\"color:#333333\">key<\/span><span style=\"color:#333333\">\u4e2d&#xff0c;\u6bd4\u8f83\u5927\u7684\u6570\u636e\u5728\u8fdb\u884c\u8bfb\u53d6\u7684\u65f6\u5019\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u6bd4\u8f83\u957f&#xff0c;<\/span><span style=\"color:#333333\">memcached <\/span><span style=\"color:#333333\">\u6700\u9002\u5408\u4fdd\u5b58\u7528\u6237\u7684 <\/span><\/p>\n<p><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u5b9e\u73b0<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u5171\u4eab <\/span><\/p>\n<p><span style=\"color:#333333\">Memcached<\/span><span style=\"color:#333333\">\u5b58\u50a8\u6570\u636e\u65f6<\/span><span style=\"color:#333333\">, Memcached<\/span><span style=\"color:#333333\">\u4f1a\u53bb\u7533\u8bf7<\/span><span style=\"color:#333333\">1MB<\/span><span style=\"color:#333333\">\u7684\u5185\u5b58<\/span><span style=\"color:#333333\">, <\/span><span style=\"color:#333333\">\u628a\u8be5\u5757\u5185\u5b58\u79f0\u4e3a\u4e00\u4e2a<\/span><span style=\"color:#333333\">slab, <\/span><span style=\"color:#333333\">\u4e5f\u79f0\u4e3a\u4e00\u4e2a<\/span><span style=\"color:#333333\">page <\/span><\/p>\n<p><span style=\"color:#333333\">Memcached <\/span><span style=\"color:#333333\">\u652f\u6301\u591a\u79cd\u5f00\u53d1\u8bed\u8a00&#xff0c;\u5305\u62ec&#xff1a;<\/span><span style=\"color:#333333\">JAVA,C,Python,PHP,C#,Ruby,Perl<\/span><span style=\"color:#333333\">\u7b49 <\/span><\/p>\n<p><span style=\"color:#333333\">Memcached <\/span><span style=\"color:#333333\">\u5b98\u7f51&#xff1a;<\/span><span style=\"color:#4183c4\">http:\/\/memcached.org\/<\/span><\/p>\n<p><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u7684\u5b89\u88c5\u4e0e\u542f\u52a8<\/span><\/p>\n<p>yum install memcached -y<\/p>\n<p>vim \/etc\/sysconfig\/memcached<br \/>\nPORT&#061;&#034;11211&#034;<br \/>\nUSER&#061;&#034;memcached&#034;<br \/>\nMAXCONN&#061;&#034;1024&#034;<br \/>\nCACHESIZE&#061;&#034;64&#034;<br \/>\nOPTIONS&#061;&#034;-l 0.0.0.0,::1&#034;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"127\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004448-689d31807dc1b.png\" width=\"507\" \/><\/p>\n<p>systemctl enable &#8211;now memcached<\/p>\n<p>netstat -antlupe | grep memcache<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"126\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004448-689d3180931f5.png\" width=\"956\" \/><\/p>\n<p><span style=\"color:#333333\">memcached <\/span><span style=\"color:#333333\">\u64cd\u4f5c\u547d\u4ee4<\/span><\/p>\n<p><span style=\"color:#333333\">\u4e94\u79cd\u57fa\u672c<\/span><span style=\"color:#333333\"> memcached <\/span><span style=\"color:#333333\">\u547d\u4ee4\u6267\u884c\u6700\u7b80\u5355\u7684\u64cd\u4f5c\u3002\u8fd9\u4e9b\u547d\u4ee4\u548c\u64cd\u4f5c\u5305\u62ec&#xff1a; <\/span><\/p>\n<p><span style=\"color:#333333\">set <\/span><\/p>\n<p><span style=\"color:#333333\">add <\/span><\/p>\n<p><span style=\"color:#333333\">replace <\/span><\/p>\n<p><span style=\"color:#333333\">get <\/span><\/p>\n<p><span style=\"color:#333333\">delete<\/span><\/p>\n<p>#\u524d\u4e09\u4e2a\u547d\u4ee4\u662f\u7528\u4e8e\u64cd\u4f5c\u5b58\u50a8\u5728 memcached \u4e2d\u7684\u952e\u503c\u5bf9\u7684\u6807\u51c6\u4fee\u6539\u547d\u4ee4,\u90fd\u4f7f\u7528\u5982\u4e0b\u6240\u793a\u7684\u8bed\u6cd5&#xff1a;<br \/>\ncommand &lt;key&gt; &lt;flags&gt; &lt;expiration time&gt; &lt;bytes&gt;<br \/>\n&lt;value&gt;<br \/>\n#\u53c2\u6570\u8bf4\u660e\u5982\u4e0b&#xff1a;<br \/>\ncommand set\/add\/replace<br \/>\nkey key \u7528\u4e8e\u67e5\u627e\u7f13\u5b58\u503c<br \/>\nflags \u53ef\u4ee5\u5305\u62ec\u952e\u503c\u5bf9\u7684\u6574\u578b\u53c2\u6570&#xff0c;\u5ba2\u6237\u673a\u4f7f\u7528\u5b83\u5b58\u50a8\u5173\u4e8e\u952e\u503c\u5bf9\u7684\u989d\u5916\u4fe1\u606f<br \/>\nexpiration time \u5728\u7f13\u5b58\u4e2d\u4fdd\u5b58\u952e\u503c\u5bf9\u7684\u65f6\u95f4\u957f\u5ea6&#xff08;\u4ee5\u79d2\u4e3a\u5355\u4f4d&#xff0c;0 \u8868\u793a\u6c38\u8fdc&#xff09;<br \/>\nbytes \u5728\u7f13\u5b58\u4e2d\u5b58\u50a8\u7684\u5b57\u8282\u6570<br \/>\nvalue \u5b58\u50a8\u7684\u503c&#xff08;\u59cb\u7ec8\u4f4d\u4e8e\u7b2c\u4e8c\u884c&#xff09;<br \/>\n#\u589e\u52a0key&#xff0c;\u8fc7\u671f\u65f6\u95f4\u4e3a\u79d2&#xff0c;bytes\u4e3a\u5b58\u50a8\u6570\u636e\u7684\u5b57\u8282\u6570<br \/>\nadd key flags exptime bytes<\/p>\n<p><span style=\"color:#333333\">\u793a\u4f8b&#xff1a;<\/span><\/p>\n<p><span style=\"color:#333333\">\u5b89\u88c5\u8f6f\u4ef6&#xff1a;<\/span><\/p>\n<p>yum install memcached -y<\/p>\n<p>telnet localhost 11211<\/p>\n<p>add leekey 0 60 4 #0 \u662f\u5426\u538b\u7f29 60 \u8fc7\u671f\u65f6\u95f4 4 \u5b57\u957f<br \/>\ntest<br \/>\nSTORED<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"156\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004448-689d3180c27d8.png\" width=\"561\" \/><\/p>\n<p><span style=\"color:#333333\">session <\/span><span style=\"color:#333333\">\u5171\u4eab\u670d\u52a1\u5668&#xff1a;<\/span><\/p>\n<p><span style=\"color:#333333\">msm <\/span><span style=\"color:#333333\">\u4ecb\u7ecd&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"247\" src=\"2025-08-14y1ai5ht2eui.png\" width=\"656\" \/><\/p>\n<p><span style=\"color:#333333\">msm<\/span><span style=\"color:#333333\">&#xff08;<\/span><span style=\"color:#333333\">memcached session manager<\/span><span style=\"color:#333333\">&#xff09;\u63d0\u4f9b\u5c06<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u4fdd\u6301\u5230<\/span><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u53ef\u7528\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u9879\u76ee\u65e9\u671f\u6258\u7ba1\u5728<\/span><span style=\"color:#333333\">google code,<\/span><span style=\"color:#333333\">\u76ee\u524d\u5728<\/span><span style=\"color:#333333\">Github <\/span><\/p>\n<p><span style=\"color:#333333\">github<\/span><span style=\"color:#333333\">\u7f51\u7ad9\u94fe\u63a5<\/span><span style=\"color:#333333\">: <\/span><span style=\"color:#4183c4\">https:\/\/github.com\/magro\/memcached-session-manager <\/span><\/p>\n<p><span style=\"color:#333333\">\u652f\u6301<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\"> 6.x<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">7.x<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">8.x<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">9.x <\/span><\/p>\n<p><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u7ba1\u7406\u7c7b&#xff0c;<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u7248\u672c\u4e0d\u540c <\/span><\/p>\n<p><span style=\"color:#333333\">memcached-session-manager-2.3.2.jar <\/span><\/p>\n<p><span style=\"color:#333333\">memcached-session-manager-tc9-2.3.2.jar <\/span><\/p>\n<p><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u6570\u636e\u7684\u5e8f\u5217\u5316\u3001\u53cd\u5e8f\u5217\u5316\u7c7b <\/span><\/p>\n<p><span style=\"color:#333333\">\u5b98\u65b9\u63a8\u8350<\/span><span style=\"color:#333333\">kyro <\/span><\/p>\n<p><span style=\"color:#333333\">\u5728<\/span><span style=\"color:#333333\">webapp<\/span><span style=\"color:#333333\">\u4e2d<\/span><span style=\"color:#333333\">WEB-INF\/lib\/<\/span><span style=\"color:#333333\">\u4e0b <\/span><\/p>\n<p><span style=\"color:#333333\">\u9a71\u52a8\u7c7b <\/span><\/p>\n<p><span style=\"color:#333333\">memcached(spymemcached.jar) <\/span><\/p>\n<p><span style=\"color:#333333\">Redis(jedis.jar)<\/span><\/p>\n<p>\u5b89\u88c5&#xff1a;<\/p>\n<p><span style=\"color:#333333\">\u53c2\u8003\u94fe\u63a5<\/span><span style=\"color:#333333\">: <\/span><span style=\"color:#4183c4\">https:\/\/github.com\/magro\/memcached-session-manager\/wiki\/SetupAndConfiguration <\/span><\/p>\n<p><span style=\"color:#333333\">\u5c06<\/span><span style=\"color:#333333\">spymemcached.jar<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">memcached-session-manage<\/span><span style=\"color:#333333\">\u3001<\/span><span style=\"color:#333333\">kyro<\/span><span style=\"color:#333333\">\u76f8\u5173\u7684<\/span><span style=\"color:#333333\">jar<\/span><span style=\"color:#333333\">\u6587\u4ef6\u90fd\u653e\u5230<\/span><span style=\"color:#333333\">Tomcat<\/span><span style=\"color:#333333\">\u7684<\/span><span style=\"color:#333333\">lib<\/span><span style=\"color:#333333\">\u76ee\u5f55 <\/span><\/p>\n<p><span style=\"color:#333333\">\u4e2d&#xff0c;\u8fd9\u4e2a\u76ee\u5f55\u662f<\/span><span style=\"color:#333333\"> $CATALINA_HOME\/lib\/ <\/span><span style=\"color:#333333\">&#xff0c;\u5bf9\u5e94\u672c\u6b21\u5b89\u88c5\u5c31\u662f<\/span><span style=\"color:#333333\">\/usr\/local\/tomcat\/lib<\/span><span style=\"color:#333333\">\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"412\" src=\"2025-08-1442bvonjijb0.png\" width=\"886\" \/><\/p>\n<p><span style=\"color:#333333\">t1<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">m1<\/span><span style=\"color:#333333\">\u90e8\u7f72\u53ef\u4ee5\u5728\u4e00\u53f0\u4e3b\u673a\u4e0a&#xff0c;<\/span><span style=\"color:#333333\">t2<\/span><span style=\"color:#333333\">\u548c<\/span><span style=\"color:#333333\">m2<\/span><span style=\"color:#333333\">\u90e8\u7f72\u4e5f\u53ef\u4ee5\u5728\u540c\u4e00\u53f0\u3002 <\/span><\/p>\n<p><span style=\"color:#333333\">\u5f53\u65b0\u7528\u6237\u53d1\u8bf7\u6c42\u5230<\/span><span style=\"color:#333333\">Tomcat1<\/span><span style=\"color:#333333\">\u65f6<\/span><span style=\"color:#333333\">, Tomcat1<\/span><span style=\"color:#333333\">\u751f\u6210<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">\u8fd4\u56de\u7ed9\u7528\u6237\u7684\u540c\u65f6<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u4e5f\u4f1a\u540c\u65f6\u53d1\u7ed9<\/span><span style=\"color:#333333\">memcached2<\/span><span style=\"color:#333333\">\u5907 <\/span><\/p>\n<p><span style=\"color:#333333\">\u4efd\u3002\u5373<\/span><span style=\"color:#333333\">Tomcat1 session<\/span><span style=\"color:#333333\">\u4e3a\u4e3b<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">&#xff0c;<\/span><span style=\"color:#333333\">memcached2 session<\/span><span style=\"color:#333333\">\u4e3a\u5907\u7528<\/span><span style=\"color:#333333\">session<\/span><span style=\"color:#333333\">&#xff0c;\u4f7f\u7528<\/span><span style=\"color:#333333\">memcached<\/span><span style=\"color:#333333\">\u76f8\u5f53\u4e8e <\/span><\/p>\n<p><span style=\"color:#333333\">\u5907\u4efd\u4e86\u4e00\u4efd<\/span><span style=\"color:#333333\">Session <\/span><\/p>\n<p><span style=\"color:#333333\">\u5982\u679c<\/span><span style=\"color:#333333\">Tomcat1<\/span><span style=\"color:#333333\">\u53d1\u73b0<\/span><span style=\"color:#333333\">memcached2 <\/span><span style=\"color:#333333\">\u5931\u8d25<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u65e0\u6cd5\u5907\u4efd<\/span><span style=\"color:#333333\">Session<\/span><span style=\"color:#333333\">\u5230<\/span><span style=\"color:#333333\">memcached2,<\/span><span style=\"color:#333333\">\u5219\u5c06<\/span><span style=\"color:#333333\">Sessoin<\/span><span style=\"color:#333333\">\u5907\u4efd\u5b58\u653e\u5728 <\/span><\/p>\n<p><span style=\"color:#333333\">memcached1<\/span><span style=\"color:#333333\">\u4e2d<\/span><\/p>\n<p><span style=\"color:#333333\">\u914d\u7f6e\u8fc7\u7a0b<\/span><\/p>\n<p><span style=\"color:#333333\">\u4e0b\u8f7d\u76f8\u5173<\/span><span style=\"color:#333333\">jar<\/span><span style=\"color:#333333\">\u5305<\/span><span style=\"color:#333333\">,<\/span><span style=\"color:#333333\">\u53c2\u8003\u4e0b\u9762\u5b98\u65b9\u8bf4\u660e\u7684\u4e0b\u8f7d\u94fe\u63a5 <\/span><\/p>\n<p><span style=\"color:#4183c4\">https:\/\/github.com\/magro\/memcached-session-manager\/wiki\/SetupAndConfiguration<\/span><\/p>\n<p><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">tomcat\u914d\u7f6e&#xff1a;<\/span><\/p>\n<p>vim \/usr\/local\/tomcat\/conf\/context.xml<\/p>\n<p>[root&#064;tomcat-1 ~]# vim \/usr\/local\/tomcat\/conf\/context.xml<br \/>\n&#064;&#064;&#064;&#064;\u5185\u5bb9\u7701\u7565&#064;&#064;&#064;&#064;<br \/>\n&lt;Manager className&#061;&#034;de.javakaffee.web.msm.MemcachedBackupSessionManager&#034;<br \/>\nmemcachedNodes&#061;&#034;n1:172.25.254.10:11211,n2:172.25.254.20:11211&#034;<br \/>\nfailoverNodes&#061;&#034;n1&#034;<br \/>\nrequestUriIgnorePattern&#061;&#034;.*\\\\.(ico|png|gif|jpg|css|js)$&#034;<br \/>\ntranscoderFactoryClass&#061;&#034;de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFacto<br \/>\nry&#034;<br \/>\n\/&gt;<br \/>\n[root&#064;tomcat-2 tomcat]# vim \/usr\/local\/tomcat\/conf\/context.xml<br \/>\n&#064;&#064;&#064;&#064;\u5185\u5bb9\u7701\u7565&#064;&#064;&#064;&#064;<br \/>\n&lt;Manager className&#061;&#034;de.javakaffee.web.msm.MemcachedBackupSessionManager&#034;<br \/>\nmemcachedNodes&#061;&#034;n1:172.25.254.10:11211,n2:172.25.254.20:11211&#034;<br \/>\nfailoverNodes&#061;&#034;n2&#034;<br \/>\nrequestUriIgnorePattern&#061;&#034;.*\\\\.(ico|png|gif|jpg|css|js)$&#034;<br \/>\ntranscoderFactoryClass&#061;&#034;de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFacto<br \/>\nry&#034;<br \/>\n\/&gt;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"574\" src=\"2025-08-14umlfissi4p0.png\" width=\"1456\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"574\" src=\"2025-08-14ttrw21qaghx.png\" width=\"1456\" \/><\/p>\n<p><span style=\"color:#333333\">\u4fee\u6539<\/span><span style=\"color:#333333\">nginx<\/span><span style=\"color:#333333\">\u914d\u7f6e&#xff1a;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"574\" src=\"2025-08-14rwzwn5j42ta.png\" width=\"1456\" \/><\/p>\n<p>upstream tomcat {<br \/>\nhash $cookie_JSESSIONID;<br \/>\nserver 172.25.254.10:8080;<br \/>\nserver 172.25.254.20:8080;<br \/>\n}<br \/>\nserver {<br \/>\nlisten 80;<br \/>\nserver_name lee.timinglee.org;<br \/>\nroot \/webdataw\/nginx\/timinglee.org\/lee;<br \/>\naccess_log \/var\/log\/nginx\/access.log;<br \/>\nerror_log \/var\/log\/nginx\/error.log;<br \/>\ntry_files $uri $uri.html $uri\/index.html \/error\/default.html;<br \/>\nlocation ~ \\\\.jsp$ {<br \/>\nproxy_pass http:\/\/tomcat;<br \/>\n}<br \/>\n}<\/p>\n<p>\u6d4b\u8bd5&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"730\" src=\"2025-08-14r30slw415tw.png\" width=\"1545\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb757\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf17\u6b21\u3002\u4ece\u4e1a\u52a1\u670d\u52a1\u5668\u8bbf\u95ee\u52a8\u6001\u5185\u5bb9\uff0c\u52a8\u6001\u5185\u5bb9\u662f\u8bf7\u6c42\u540e\u6709\u540e\u53f0\u670d\u52a1\u8bbf\u95ee\u6570\u636e\u5e93\u540e\u5f97\u5230\u7684\uff0c\u6700\u7ec8\u8fd4\u56de\u5230\u6d4f\u89c8\u5668\u7aef\u3002\u52a8\u6001\u670d\u52a1\u5668\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u5c31\u662f\u5e76\u53d1\u80fd\u529b\u592a\u5f31\uff0c\u5f80\u5f80\u9700\u8981\u591a\u53f0\u52a8\u6001\u670d\u52a1\u5668\u4e00\u8d77\u63d0\u4f9b\u670d\u52a1\u3002\u5ba2\u6237\u9700\u6c42\u591a\u6837\uff0c\u66f4\u591a\u7684\u5185\u5bb9\u8fd8\u662f\u9700\u8981\u7531\u4e1a\u52a1\u670d\u52a1\u5668\u63d0\u4f9b\uff0c\u4e1a\u52a1\u670d\u52a1\u5668\u5f80\u5f80\u90fd\u662f\u7531\u4e00\u7ec4\u670d\u52a1\u5668\u7ec4\u6210\u3002\u529b\u5206\u644a\uff0c\u8fd9\u5c31\u9700\u8981\u8c03\u5ea6\uff0c\u91c7\u7528\u4e00\u5b9a\u7684\u8c03\u5ea6\u7b56\u7565\uff0c\u5c06\u8bf7\u6c42\u5206\u53d1\u7ed9\u4e0d\u540c\u7684\u670d\u52a1\u5668\uff0c\u8fd9\u5c31\u662f\u3002\u53cd\u5411\u4ee3\u7406\u529f\u80fd\uff0c\u5b9e\u73b0\u56fe\u4e2d\u7684\u4ee3\u7406\u529f\u80fd\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u81f3\u6307\u5b9a\u7684\u540c\u4e00\u4e2a\u3002\u4e2d\uff0c\u6bd4\u8f83\u5927\u7684\u6570\u636e\u5728\u8fdb\u884c\u8bfb\u53d6\u7684\u65f6\u5019\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u6bd4\u8f83\u957f\uff0c\u670d\u52a1\u5668\u7684\u6570\u636e\u8fdb\u884c\u540c\u6b65\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u5373\u4fdd\u8bc1\u5404\u3002<\/p>\n","protected":false},"author":2,"featured_media":55804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,223,43],"topic":[],"class_list":["post-55824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-tomcat","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/55824.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb757\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf17\u6b21\u3002\u4ece\u4e1a\u52a1\u670d\u52a1\u5668\u8bbf\u95ee\u52a8\u6001\u5185\u5bb9\uff0c\u52a8\u6001\u5185\u5bb9\u662f\u8bf7\u6c42\u540e\u6709\u540e\u53f0\u670d\u52a1\u8bbf\u95ee\u6570\u636e\u5e93\u540e\u5f97\u5230\u7684\uff0c\u6700\u7ec8\u8fd4\u56de\u5230\u6d4f\u89c8\u5668\u7aef\u3002\u52a8\u6001\u670d\u52a1\u5668\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u5c31\u662f\u5e76\u53d1\u80fd\u529b\u592a\u5f31\uff0c\u5f80\u5f80\u9700\u8981\u591a\u53f0\u52a8\u6001\u670d\u52a1\u5668\u4e00\u8d77\u63d0\u4f9b\u670d\u52a1\u3002\u5ba2\u6237\u9700\u6c42\u591a\u6837\uff0c\u66f4\u591a\u7684\u5185\u5bb9\u8fd8\u662f\u9700\u8981\u7531\u4e1a\u52a1\u670d\u52a1\u5668\u63d0\u4f9b\uff0c\u4e1a\u52a1\u670d\u52a1\u5668\u5f80\u5f80\u90fd\u662f\u7531\u4e00\u7ec4\u670d\u52a1\u5668\u7ec4\u6210\u3002\u529b\u5206\u644a\uff0c\u8fd9\u5c31\u9700\u8981\u8c03\u5ea6\uff0c\u91c7\u7528\u4e00\u5b9a\u7684\u8c03\u5ea6\u7b56\u7565\uff0c\u5c06\u8bf7\u6c42\u5206\u53d1\u7ed9\u4e0d\u540c\u7684\u670d\u52a1\u5668\uff0c\u8fd9\u5c31\u662f\u3002\u53cd\u5411\u4ee3\u7406\u529f\u80fd\uff0c\u5b9e\u73b0\u56fe\u4e2d\u7684\u4ee3\u7406\u529f\u80fd\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u81f3\u6307\u5b9a\u7684\u540c\u4e00\u4e2a\u3002\u4e2d\uff0c\u6bd4\u8f83\u5927\u7684\u6570\u636e\u5728\u8fdb\u884c\u8bfb\u53d6\u7684\u65f6\u5019\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u6bd4\u8f83\u957f\uff0c\u670d\u52a1\u5668\u7684\u6570\u636e\u8fdb\u884c\u540c\u6b65\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u5373\u4fdd\u8bc1\u5404\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55824.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T00:44:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004444-689d317ccaa1f.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55824.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55824.html\",\"name\":\"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-14T00:44:49+00:00\",\"dateModified\":\"2025-08-14T00:44:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55824.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55824.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55824.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/55824.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb757\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf17\u6b21\u3002\u4ece\u4e1a\u52a1\u670d\u52a1\u5668\u8bbf\u95ee\u52a8\u6001\u5185\u5bb9\uff0c\u52a8\u6001\u5185\u5bb9\u662f\u8bf7\u6c42\u540e\u6709\u540e\u53f0\u670d\u52a1\u8bbf\u95ee\u6570\u636e\u5e93\u540e\u5f97\u5230\u7684\uff0c\u6700\u7ec8\u8fd4\u56de\u5230\u6d4f\u89c8\u5668\u7aef\u3002\u52a8\u6001\u670d\u52a1\u5668\u7684\u95ee\u9898\uff0c\u5f80\u5f80\u5c31\u662f\u5e76\u53d1\u80fd\u529b\u592a\u5f31\uff0c\u5f80\u5f80\u9700\u8981\u591a\u53f0\u52a8\u6001\u670d\u52a1\u5668\u4e00\u8d77\u63d0\u4f9b\u670d\u52a1\u3002\u5ba2\u6237\u9700\u6c42\u591a\u6837\uff0c\u66f4\u591a\u7684\u5185\u5bb9\u8fd8\u662f\u9700\u8981\u7531\u4e1a\u52a1\u670d\u52a1\u5668\u63d0\u4f9b\uff0c\u4e1a\u52a1\u670d\u52a1\u5668\u5f80\u5f80\u90fd\u662f\u7531\u4e00\u7ec4\u670d\u52a1\u5668\u7ec4\u6210\u3002\u529b\u5206\u644a\uff0c\u8fd9\u5c31\u9700\u8981\u8c03\u5ea6\uff0c\u91c7\u7528\u4e00\u5b9a\u7684\u8c03\u5ea6\u7b56\u7565\uff0c\u5c06\u8bf7\u6c42\u5206\u53d1\u7ed9\u4e0d\u540c\u7684\u670d\u52a1\u5668\uff0c\u8fd9\u5c31\u662f\u3002\u53cd\u5411\u4ee3\u7406\u529f\u80fd\uff0c\u5b9e\u73b0\u56fe\u4e2d\u7684\u4ee3\u7406\u529f\u80fd\uff0c\u5c06\u7528\u6237\u8bf7\u6c42\u5168\u90e8\u8f6c\u53d1\u81f3\u6307\u5b9a\u7684\u540c\u4e00\u4e2a\u3002\u4e2d\uff0c\u6bd4\u8f83\u5927\u7684\u6570\u636e\u5728\u8fdb\u884c\u8bfb\u53d6\u7684\u65f6\u5019\u9700\u8981\u6d88\u8017\u7684\u65f6\u95f4\u6bd4\u8f83\u957f\uff0c\u670d\u52a1\u5668\u7684\u6570\u636e\u8fdb\u884c\u540c\u6b65\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u4e00\u81f4\u6027\uff0c\u5373\u4fdd\u8bc1\u5404\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55824.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T00:44:49+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814004444-689d317ccaa1f.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/55824.html","url":"https:\/\/www.wsisp.com\/helps\/55824.html","name":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-14T00:44:49+00:00","dateModified":"2025-08-14T00:44:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55824.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55824.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55824.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=55824"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55824\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/55804"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55824"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}