{"id":58117,"date":"2025-08-16T02:40:21","date_gmt":"2025-08-15T18:40:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58117.html"},"modified":"2025-08-16T02:40:21","modified_gmt":"2025-08-15T18:40:21","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-10","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58117.html","title":{"rendered":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT"},"content":{"rendered":"<h2>\u4e00\u3001Tomcat \u6982\u8ff0<\/h2>\n<h3>1.1 \u4ec0\u4e48\u662f Tomcat<\/h3>\n<p>Tomcat \u662f\u4e00\u6b3e\u5f00\u6e90\u7684 Java Servlet \u5bb9\u5668&#xff0c;\u540c\u65f6\u652f\u6301 JavaServer Pages&#xff08;JSP&#xff09;\u3001WebSocket \u7b49 Java EE \u6280\u672f\u89c4\u8303&#xff0c;\u662f\u8fd0\u884c Java Web \u5e94\u7528\u7684\u6838\u5fc3\u670d\u52a1\u5668\u3002\u5b83\u7531 Apache \u8f6f\u4ef6\u57fa\u91d1\u4f1a\u5f00\u53d1\u7ef4\u62a4&#xff0c;\u517c\u5177\u8f7b\u91cf\u6027\u548c\u7a33\u5b9a\u6027&#xff0c;\u662f Java Web \u5f00\u53d1\u548c\u90e8\u7f72\u7684\u9996\u9009\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n<h3>1.2 Tomcat \u7684\u53d1\u5c55\u5386\u53f2\u4e0e\u73b0\u72b6<\/h3>\n<ul>\n<li>\u8bde\u751f\u80cc\u666f&#xff1a;\u8d77\u6e90\u4e8e 1999 \u5e74\u7684 Jakarta \u9879\u76ee&#xff0c;\u6700\u521d\u540d\u4e3a Catalina&#xff0c;2001 \u5e74\u66f4\u540d\u4e3a Tomcat&#xff0c;\u65e8\u5728\u63d0\u4f9b\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684 Servlet \u5bb9\u5668\u3002<\/li>\n<li>\u7248\u672c\u8fed\u4ee3&#xff1a;2004 \u5e74\u53d1\u5e03\u652f\u6301 Servlet 2.4\/JSP 2.0 \u7684 Tomcat 5&#xff0c;2010 \u5e74\u53d1\u5e03\u652f\u6301 Servlet 3.0 \u7684 Tomcat 7&#xff0c;2022 \u5e74\u53d1\u5e03\u652f\u6301 Jakarta EE 9 \u7684 Tomcat 10&#xff08;\u5305\u540d\u4ece\u00a0javax\u00a0\u8fc1\u79fb\u5230\u00a0jakarta&#xff09;\u3002<\/li>\n<li>\u884c\u4e1a\u5730\u4f4d&#xff1a;\u5168\u7403\u8d85\u8fc7 60% \u7684 Java Web \u5e94\u7528\u90e8\u7f72\u5728 Tomcat \u4e0a&#xff0c;\u5e7f\u6cdb\u5e94\u7528\u4e8e\u4f01\u4e1a\u7ea7\u7cfb\u7edf\u3001\u7535\u5546\u5e73\u53f0\u3001\u653f\u52a1\u7cfb\u7edf\u7b49\u573a\u666f\u3002<\/li>\n<\/ul>\n<h3>1.3\u00a0Tomcat \u4e0e\u5176\u4ed6 Java \u5bb9\u5668\u7684\u5bf9\u6bd4<\/h3>\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:500px\">\n<tbody>\n<tr>\u7279\u6027TomcatJettyJBoss\/WildFlyWebLogic<\/tr>\n<tr>\n<td>\u5b9a\u4f4d<\/td>\n<td>\u8f7b\u91cf\u7ea7 Servlet \u5bb9\u5668<\/td>\n<td>\u8f7b\u91cf\u7ea7\u5d4c\u5165\u5f0f\u5bb9\u5668<\/td>\n<td>\u5168\u529f\u80fd Java EE \u5e94\u7528\u670d\u52a1\u5668<\/td>\n<td>\u5546\u4e1a\u7ea7 Java EE \u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u4f53\u79ef<\/td>\n<td>\u5c0f&#xff08;\u7ea6 100MB&#xff09;<\/td>\n<td>\u6781\u5c0f&#xff08;\u7ea6 20MB&#xff09;<\/td>\n<td>\u5927&#xff08;\u7ea6 1GB&#xff09;<\/td>\n<td>\u5927&#xff08;\u7ea6 2GB&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u542f\u52a8\u901f\u5ea6<\/td>\n<td>\u8f83\u5feb<\/td>\n<td>\u6781\u5feb<\/td>\n<td>\u8f83\u6162<\/td>\n<td>\u6162<\/td>\n<\/tr>\n<tr>\n<td>\u529f\u80fd<\/td>\n<td>\u652f\u6301 Servlet\/JSP \u6838\u5fc3\u529f\u80fd<\/td>\n<td>\u652f\u6301\u6838\u5fc3\u529f\u80fd&#xff0c;\u66f4\u7075\u6d3b<\/td>\n<td>\u652f\u6301\u5b8c\u6574 Java EE \u89c4\u8303<\/td>\n<td>\u652f\u6301\u5b8c\u6574 Java EE \u89c4\u8303&#xff0c;\u5e26\u5546\u4e1a\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u4e2d\u5c0f\u578b Java Web \u5e94\u7528<\/td>\n<td>\u5d4c\u5165\u5f0f\u5e94\u7528\u3001\u5fae\u670d\u52a1<\/td>\n<td>\u590d\u6742\u4f01\u4e1a\u7ea7\u5e94\u7528<\/td>\n<td>\u5927\u578b\u5546\u4e1a\u7cfb\u7edf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u9002\u7528\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>Tomcat&#xff1a;\u4e2d\u5c0f\u578b Java Web \u5e94\u7528\u3001\u5f00\u53d1\u73af\u5883\u3001\u9700\u8981\u8f7b\u91cf\u90e8\u7f72\u7684\u573a\u666f<\/li>\n<li>Jetty&#xff1a;\u5d4c\u5165\u5f0f\u5e94\u7528&#xff08;\u5982 Spring Boot \u5185\u7f6e\u5bb9\u5668&#xff09;\u3001\u5bf9\u542f\u52a8\u901f\u5ea6\u654f\u611f\u7684\u573a\u666f<\/li>\n<li>JBoss\/WildFly&#xff1a;\u9700\u8981\u5b8c\u6574 Java EE \u529f\u80fd\u7684\u4f01\u4e1a\u7ea7\u5e94\u7528<\/li>\n<li>WebLogic&#xff1a;\u5bf9\u7a33\u5b9a\u6027\u548c\u5546\u4e1a\u652f\u6301\u6709\u9ad8\u8981\u6c42\u7684\u5927\u578b\u7cfb\u7edf<\/li>\n<\/ul>\n<h3>1.4\u00a0tomcat\u7684\u529f\u80fd\u4ecb\u7ecd<\/h3>\n<p>Tomcat \u662f\u4e00\u6b3e\u5f00\u6e90\u7684 Java Web \u670d\u52a1\u5668&#xff0c;\u4e3b\u8981\u7528\u4e8e\u8fd0\u884c Java \u5f00\u53d1\u7684 Web \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u662f Java \u751f\u6001\u4e2d\u6700\u5e38\u7528\u7684\u670d\u52a1\u5668\u4e4b\u4e00\u3002<\/p>\n<p>1\u3001\u8fd0\u884c Java Web \u5e94\u7528<br \/>\n\u80fd\u89e3\u6790\u548c\u6267\u884c\u57fa\u4e8e Servlet\u3001JSP \u6280\u672f\u5f00\u53d1\u7684\u7a0b\u5e8f&#xff0c;\u6bd4\u5982\u4f01\u4e1a\u7f51\u7ad9\u540e\u53f0\u3001\u7ba1\u7406\u7cfb\u7edf\u3001API \u670d\u52a1\u7b49\u3002\u5f00\u53d1\u8005\u7f16\u5199\u7684 Java Web \u4ee3\u7801&#xff08;\u5982 Spring Boot \u5e94\u7528&#xff09;&#xff0c;\u6700\u7ec8\u9700\u8981\u90e8\u7f72\u5230 Tomcat \u4e0a\u624d\u80fd\u901a\u8fc7\u7f51\u7edc\u8bbf\u95ee\u3002<\/p>\n<p>2\u3001\u5904\u7406 HTTP \u8bf7\u6c42<br \/>\n\u5185\u7f6e\u4e86\u8f7b\u91cf\u7ea7\u7684 HTTP \u670d\u52a1\u5668&#xff0c;\u53ef\u76f4\u63a5\u63a5\u6536\u6d4f\u89c8\u5668\u7b49\u5ba2\u6237\u7aef\u53d1\u9001\u7684 HTTP \u8bf7\u6c42&#xff0c;\u5c06\u8bf7\u6c42\u4f20\u9012\u7ed9\u5bf9\u5e94\u7684 Java \u7a0b\u5e8f\u5904\u7406&#xff0c;\u518d\u628a\u5904\u7406\u7ed3\u679c&#xff08;\u5982\u7f51\u9875\u3001\u6570\u636e&#xff09;\u4ee5 HTTP \u54cd\u5e94\u7684\u5f62\u5f0f\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n<p>3\u3001\u7ba1\u7406\u7a0b\u5e8f\u751f\u547d\u5468\u671f<br \/>\n\u4f5c\u4e3a Servlet \u5bb9\u5668&#xff0c;\u8d1f\u8d23\u7ba1\u7406 Java Web \u7ec4\u4ef6&#xff08;\u5982 Servlet&#xff09;\u7684\u521b\u5efa\u3001\u8fd0\u884c\u548c\u9500\u6bc1&#xff0c;\u63d0\u4f9b\u8fd9\u4e9b\u7ec4\u4ef6\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883&#xff08;\u5982\u5185\u5b58\u3001\u7f51\u7edc\u8fde\u63a5\u7b49&#xff09;\u3002<\/p>\n<p>4\u3001\u652f\u6301\u591a\u79cd\u90e8\u7f72\u65b9\u5f0f<br \/>\n\u53ef\u4ee5\u76f4\u63a5\u628a Web \u5e94\u7528\u6253\u5305\u6210 WAR \u6587\u4ef6&#xff0c;\u653e\u5230 Tomcat \u7684\u6307\u5b9a\u76ee\u5f55\u4e0b&#xff0c;\u5b83\u4f1a\u81ea\u52a8\u89e3\u538b\u5e76\u8fd0\u884c&#xff0c;\u4e5f\u652f\u6301\u901a\u8fc7\u7ba1\u7406\u754c\u9762\u624b\u52a8\u90e8\u7f72\u5e94\u7528\u3002<\/p>\n<h2>\u4e8c\u3001Tomcat \u6838\u5fc3\u4f18\u52bf<\/h2>\n<h4>1. \u8f7b\u91cf\u6613\u7528<\/h4>\n<ul>\n<li>\u4f53\u79ef\u5c0f\u5de7&#xff1a;\u5b89\u88c5\u5305\u4ec5 100MB \u5de6\u53f3&#xff0c;\u5360\u7528\u7cfb\u7edf\u8d44\u6e90\u5c11&#xff0c;\u9002\u5408\u4e2d\u5c0f\u578b\u5e94\u7528\u90e8\u7f72\u3002<\/li>\n<li>\u90e8\u7f72\u7b80\u5355&#xff1a;\u65e0\u9700\u590d\u6742\u914d\u7f6e&#xff0c;\u89e3\u538b\u540e\u5373\u53ef\u8fd0\u884c&#xff0c;\u652f\u6301 Windows\u3001Linux\u3001macOS \u7b49\u591a\u5e73\u53f0\u3002<\/li>\n<\/ul>\n<h4>2. \u89c4\u8303\u517c\u5bb9<\/h4>\n<ul>\n<li>\u4e25\u683c\u9075\u5faa Java EE \u89c4\u8303&#xff1a;\u652f\u6301 Servlet\u3001JSP\u3001EL \u8868\u8fbe\u5f0f\u3001WebSocket \u7b49\u6838\u5fc3\u6280\u672f\u89c4\u8303&#xff0c;\u786e\u4fdd Java Web \u5e94\u7528\u7684\u517c\u5bb9\u6027\u548c\u53ef\u79fb\u690d\u6027\u3002<\/li>\n<li>\u7248\u672c\u540c\u6b65\u66f4\u65b0&#xff1a;\u53ca\u65f6\u8ddf\u8fdb Java EE \u89c4\u8303\u5347\u7ea7&#xff0c;\u5982 Tomcat 10 \u652f\u6301 Jakarta EE 9&#xff0c;\u9002\u914d\u6700\u65b0\u7684 API \u6807\u51c6\u3002<\/li>\n<\/ul>\n<h4>3. \u7075\u6d3b\u53ef\u6269\u5c55<\/h4>\n<ul>\n<li>\u6a21\u5757\u5316\u8bbe\u8ba1&#xff1a;\u6838\u5fc3\u7ec4\u4ef6&#xff08;Catalina\u3001Coyote\u3001Jasper \u7b49&#xff09;\u89e3\u8026&#xff0c;\u53ef\u6309\u9700\u542f\u7528\u6216\u6269\u5c55\u3002<\/li>\n<li>\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e&#xff1a;\u901a\u8fc7 XML \u914d\u7f6e\u6587\u4ef6\u6216\u6ce8\u89e3\u65b9\u5f0f&#xff0c;\u7075\u6d3b\u8c03\u6574\u5bb9\u5668\u884c\u4e3a\u3001\u7ebf\u7a0b\u6c60\u3001\u8fde\u63a5\u5668\u7b49\u53c2\u6570\u3002<\/li>\n<\/ul>\n<h4>4. \u5f00\u53d1\u53cb\u597d<\/h4>\n<ul>\n<li>\u5185\u7f6e\u7ba1\u7406\u5de5\u5177&#xff1a;\u63d0\u4f9b Web \u7ba1\u7406\u754c\u9762&#xff08;Manager App&#xff09;\u548c\u8fdc\u7a0b\u90e8\u7f72\u529f\u80fd&#xff0c;\u65b9\u4fbf\u5e94\u7528\u7ba1\u7406\u3002<\/li>\n<li>\u8c03\u8bd5\u4fbf\u6377&#xff1a;\u4e0e\u4e3b\u6d41 IDE&#xff08;Eclipse\u3001IntelliJ IDEA&#xff09;\u65e0\u7f1d\u96c6\u6210&#xff0c;\u652f\u6301\u70ed\u90e8\u7f72\u548c\u65ad\u70b9\u8c03\u8bd5\u3002<\/li>\n<\/ul>\n<h4>5. \u7a33\u5b9a\u53ef\u9760<\/h4>\n<ul>\n<li>\u6210\u719f\u7684\u793e\u533a\u652f\u6301&#xff1a;Apache \u57fa\u91d1\u4f1a\u7ef4\u62a4&#xff0c;\u5168\u7403\u5f00\u53d1\u8005\u8d21\u732e\u4ee3\u7801&#xff0c;Bug \u4fee\u590d\u53ca\u65f6\u3002<\/li>\n<li>\u5bb9\u9519\u673a\u5236\u5b8c\u5584&#xff1a;\u652f\u6301\u7ebf\u7a0b\u6c60\u9694\u79bb\u3001\u8bf7\u6c42\u8d85\u65f6\u63a7\u5236\u3001\u5f02\u5e38\u9875\u9762\u914d\u7f6e\u7b49&#xff0c;\u63d0\u5347\u7cfb\u7edf\u7a33\u5b9a\u6027\u3002<\/li>\n<\/ul>\n<h2>\u4e09\u3001Tomcat \u5b89\u88c5\u4ee5\u53ca\u76f8\u5173\u5b9e\u9a8c<\/h2>\n<h3>3.1tomcat\u7684\u5b89\u88c5<\/h3>\n<h4>3.1.1 \u73af\u5883\u51c6\u5907<\/h4>\n<p>192.168.134.100&#xff1a;nginx<\/p>\n<p>192.168.134.10&#xff1a;tomcatA<\/p>\n<p>192.168.134.20&#xff1a;tomcatb<\/p>\n<h4>3.1.2\u5b89\u88c5Java\u73af\u5883<\/h4>\n<p>#\u5b89\u88c5iava\u73af\u5883<br \/>\n[root&#064;tomcatB ~]#  dnf install java-1.8.0-openjdk.x86_64 -y<\/p>\n<p>#\u67e5\u770bjava\u7248\u672c<br \/>\n[root&#064;tomcatB ~]# java -version<br \/>\nopenjdk version &#034;1.8.0_382&#034;<br \/>\nOpenJDK Runtime Environment (build 1.8.0_382-b05)<br \/>\nOpenJDK 64-Bit Server VM (build 25.382-b05, mixed mode)<\/p>\n<p>#\u67e5\u770bjava\u7684\u73af\u5883\u76ee\u5f55<br \/>\n[root&#064;tomcatB ~]# which java<br \/>\n\/usr\/bin\/java<br \/>\n[root&#064;tomcatB ~]# ll \/usr\/bin\/java<br \/>\nlrwxrwxrwx 1 root root 22 Jul 30 10:54 \/usr\/bin\/java -&gt; \/etc\/alternatives\/java<\/p>\n<p>#java\u7684\u8fd0\u884c\u73af\u5883<br \/>\n[root&#064;tomcatB ~]# cd \/etc\/alternatives\/jre<br \/>\n[root&#064;tomcatB jre]# ls<br \/>\nASSEMBLY_EXCEPTION  bin  lib  LICENSE  THIRD_PARTY_README<\/p>\n<h4>3.1.3 \u5b89\u88c5\u5e76\u542f\u52a8tomcat<\/h4>\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  shar<br \/>\n[root&#064;tomcatA local]# mv apache-tomcat-9.0.107\/ tomcat<br \/>\n[root&#064;tomcatA local]# ls<br \/>\nbin  etc  games  include  lib  lib64  libexec  sbin  share  src  tomcat<\/p>\n<p>#\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       tomcat-juli.<br \/>\ncatalina.bat        configtest.bat                setclasspath.bat  tomcat-nativ<br \/>\ncatalina.sh         configtest.sh                 setclasspath.sh   tool-wrapper<br \/>\ncatalina-tasks.xml  daemon.sh                     shutdown.bat      tool-wrapper<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:       \/usr\/local\/tomcat\/bin\/bootstrap.jar:\/usr\/local\/tomcat\/bin<br \/>\nUsing CATALINA_OPTS:<br \/>\nTomcat started.<\/p>\n<h4>3.1.4\u00a0\u67e5\u770b\u7aef\u53e3<\/h4>\n<p>[root&#064;tomcatA ~]# netstat -antlupe grep java<br \/>\ntcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      087\/java<\/p>\n<p>\u3010\u6ce8\u610f&#xff1a;\u8bbf\u95ee\u524d\u8981\u5173\u95ed\u9632\u706b\u5899\u3011<br \/>\n[root&#064;tomcatA ~]# systemctl disable &#8211;now  firewalld<br \/>\nRemoved &#034;\/etc\/systemd\/system\/multi-user.target.wants\/firewalld.service&#034;.<br \/>\nRemoved &#034;\/etc\/systemd\/system\/dbus-org.fedoraproject.FirewallD1.service&#034;.<\/p>\n<h4>3.1.5 \u8bbf\u95eetomcat<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815183956-689f7efc4f52b.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815183958-689f7efe6d10b.png\" \/><\/p>\n<h3>3.2 \u751f\u6210Tomcat\u542f\u52a8\u6587\u4ef6<\/h3>\n<p>tomcat\u7684\u76ee\u5f55\u7ed3\u6784<\/p>\n<p>\u76ee\u5f55 \u00a0 \u00a0 \u00a0 \u00a0 \u8bf4\u660e<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>bin \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u670d\u52a1\u542f\u52a8\u3001\u505c\u6b62\u7b49\u76f8\u5173\u7a0b\u5e8f\u548c\u6587\u4ef6<\/p>\n<p>conf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u914d\u7f6e\u6587\u4ef6<\/p>\n<p>lib \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5e93\u76ee\u5f55<\/p>\n<p>logs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u65e5\u5fd7\u76ee\u5f55<\/p>\n<p>webapps \u00a0 \u00a0 \u00a0 \u00a0 \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u5e94\u7528\u90e8\u7f72\u76ee\u5f55&#xff0c;\u76f8\u5f53\u4e8enginx\u7684\u9ed8\u8ba4\u53d1\u5e03\u76ee\u5f55<\/p>\n<p>work jsp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7f16\u8bd1\u540e\u7684\u7ed3\u679c\u6587\u4ef6&#xff0c;\u5efa\u8bae\u63d0\u524d\u9884\u70ed\u8bbf\u95ee<\/p>\n<h4>3.2.1 \u751f\u6210tomcat\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>[root&#064;tomcatA ~]# vim \/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nJAVA_HOME&#061;\/etc\/alternatives\/jre<\/p>\n<h4>3.2.2\u00a0\u751f\u6210\u542f\u52a8\u6587\u4ef6<\/h4>\n<p>[root&#064;tomcatA conf]# 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<\/p>\n<p>[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<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<h4>3.2.3\u00a0\u751f\u6210tomcat\u7528\u6237\u5e76\u8bbe\u5b9a\u8f6f\u4ef6\u5b89\u88c5\u76ee\u5f55\u6743\u9650<\/h4>\n<p>[root&#064;tomcatA conf]# useradd -s \/sbin\/nologin -M tomcat<br \/>\n[root&#064;tomcatA conf]# chown tomcat.tomcat \/usr\/local\/tomcat\/ -R<\/p>\n<h4>3.2.4\u00a0\u7528\u542f\u52a8\u811a\u672c\u5f00\u542f\u670d\u52a1<\/h4>\n<p>[root&#064;tomcatA conf]#  systemctl enable &#8211;now tomcat<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/tomcat.service \u2192 \/usr\/lib\/systemd\/system\/tomcat.service.<\/p>\n<h4>3.2.5 \u67e5\u770b\u670d\u52a1\u662f\u5426\u5f00\u542f<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184001-689f7f01ed8ac.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184003-689f7f0351aed.png\" \/><\/p>\n<h3 style=\"background-color:transparent\">3.3 nginx&#043;tomcat\u591a\u7aef\u8d1f\u8f7d\u5747\u8861<\/h3>\n<p>\u7ed3\u5408\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0tomcat\u90e8\u7f72<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"652\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184004-689f7f04aa6cb.png\" width=\"1056\" \/><\/p>\n<p>standalone\u6a21\u5f0f&#xff0c;Tomcat\u5355\u72ec\u8fd0\u884c&#xff0c;\u76f4\u63a5\u63a5\u53d7\u7528\u6237\u7684\u8bf7\u6c42&#xff0c;\u4e0d\u63a8\u8350\u3002<\/p>\n<p>\u53cd\u5411\u4ee3\u7406&#xff0c;\u5355\u673a\u8fd0\u884c&#xff0c;\u63d0\u4f9b\u4e86\u4e00\u4e2aNginx\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406&#xff0c;\u53ef\u4ee5\u505a\u5230\u9759\u6001\u7531nginx\u63d0\u4f9b\u54cd\u5e94&#xff0c;\u52a8\u6001jsp\u4ee3 \u7406\u7ed9Tomcat<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 LNMT&#xff1a;Linux &#043; Nginx &#043; MySQL &#043; Tomcat<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 LAMT&#xff1a;Linux &#043; Apache&#xff08;Httpd&#xff09;&#043; MySQL &#043; Tomcat<\/p>\n<p>\u524d\u7f6e\u4e00\u53f0Nginx&#xff0c;\u7ed9\u591a\u53f0Tomcat\u5b9e\u4f8b\u505a\u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6&#xff0c;Tomcat\u4e0a\u90e8\u7f72\u7684\u7eaf\u52a8\u6001\u9875\u9762\u66f4 \u9002\u5408<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 LNMT&#xff1a;Linux &#043; Nginx &#043; MySQL &#043; Tomcat<\/p>\n<p>\u591a\u7ea7\u4ee3\u7406<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 LNNMT&#xff1a;Linux &#043; Nginx &#043; Nginx &#043; MySQL &#043; Tomcat<\/p>\n<h4>3.3.1\u00a0\u5b89\u88c5nginx\u670d\u52a1<\/h4>\n<p>[root&#064;nginx ~]# dnf install -y nginx<\/p>\n<h4>3.3.2\u00a0\u914d\u7f6e\u5b50\u6587\u4ef6<\/h4>\n<p>[root&#064;nginx local]# vim \/etc\/nginx\/conf.d\/vhosts.conf<br \/>\nupstream tomcat {<br \/>\n        hash $cookie_JSESSIONID;<br \/>\n        server 192.168.134.10:8080;<br \/>\n        server 192.168.134.20:8080;<br \/>\n}<br \/>\nserver {<br \/>\n        listen 80;<br \/>\n        server_name www.zx.org;<br \/>\n        location ~ \\\\.jsp$ {<br \/>\n                #proxy_pass http:\/\/192.168.134.10:8080;&#xff08;\u5355\u673a\u53cd\u5411&#xff09;<br \/>\n                proxy_pass http:\/\/tomcat;&#xff08;\u591a\u673a\u53cd\u5411&#xff09;<br \/>\n         }<br \/>\n}<\/p>\n<h4>3.3.3\u00a0\u00a0\u5f00\u542f\u670d\u52a1<\/h4>\n<p>#\u5173\u95ed\u9632\u706b\u5899<br \/>\n[root&#064;nginx ~]# systemctl disable &#8211;now firewalld<br \/>\nRemoved &#034;\/etc\/systemd\/system\/multi-user.target.wants\/firewalld.service&#034;.<br \/>\nRemoved &#034;\/etc\/systemd\/system\/dbus-org.fedoraproject.FirewallD1.service&#034;.<\/p>\n<p>#\u5f00\u542f\u670d\u52a1<br \/>\n[root&#064;nginx ~]# systemctl enable &#8211;now nginx<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/nginx.service \u2192 \/usr\/lib\/systemd\/system\/nginx.service.<br \/>\n[root&#064;nginx ~]# netstat -antlupe | grep nginx<br \/>\ntcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          98707      30362\/nginx: master<br \/>\ntcp6       0      0 :::80                   :::*                    LISTEN      0          98708      30362\/nginx: master<\/p>\n<h4>3.3.4 \u7ed9tomcat\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u6d4b\u8bd5\u6587\u4ef6<\/h4>\n<p>[root&#064;tomcatA ~]# cp test.jsp \/usr\/local\/tomcat\/webapps\/ROOT\/<br \/>\n[root&#064;tomcatA ~]# systemctl restart tomcat<\/p>\n<h4>3.3.5 \u6d4b\u8bd5<\/h4>\n<h5>\u5355\u673a\u53cd\u5411\u4ee3\u7406<\/h5>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184007-689f7f07971a2.png\" \/><\/p>\n<h5>\u53cd\u5411\u4ee3\u7406\u591a\u673a<\/h5>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184009-689f7f099dee5.png\" \/><\/p>\n<h3>3.4 Memcached<\/h3>\n<p>Memcached \u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u9ad8\u6027\u80fd\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u7cfb\u7edf&#xff0c;\u4e3b\u8981\u7528\u4e8e\u51cf\u8f7b\u6570\u636e\u5e93\u8d1f\u8f7d\u3001\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u54cd\u5e94\u901f\u5ea6\u3002\u5b83\u901a\u8fc7\u5c06\u9891\u7e41\u8bbf\u95ee\u7684\u6570\u636e\u5b58\u50a8\u5728\u5185\u5b58\u4e2d&#xff0c;\u51cf\u5c11\u5bf9\u6570\u636e\u5e93\u7684\u76f4\u63a5\u67e5\u8be2&#xff0c;\u4ece\u800c\u63d0\u5347\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<p>\u6838\u5fc3\u7279\u6027<br \/>\n1\u3001\u5185\u5b58\u5b58\u50a8<br \/>\n\u6570\u636e\u5b8c\u5168\u5b58\u50a8\u5728\u5185\u5b58\u4e2d&#xff0c;\u8bfb\u5199\u901f\u5ea6\u6781\u5feb&#xff08;\u5fae\u79d2\u7ea7\u54cd\u5e94&#xff09;&#xff0c;\u9002\u5408\u5b58\u50a8\u9891\u7e41\u8bbf\u95ee\u7684\u70ed\u70b9\u6570\u636e&#xff08;\u5982\u7528\u6237\u4f1a\u8bdd\u3001\u5546\u54c1\u4fe1\u606f\u3001\u8ba1\u6570\u5668\u7b49&#xff09;\u3002<\/p>\n<p>2\u3001\u5206\u5e03\u5f0f\u67b6\u6784<br \/>\n\u652f\u6301\u591a\u670d\u52a1\u5668\u96c6\u7fa4\u90e8\u7f72&#xff0c;\u53ef\u901a\u8fc7\u54c8\u5e0c\u7b97\u6cd5\u5c06\u6570\u636e\u5206\u6563\u5230\u4e0d\u540c\u8282\u70b9&#xff0c;\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u548c\u6a2a\u5411\u6269\u5c55&#xff0c;\u5355\u8282\u70b9\u53ef\u5904\u7406\u6bcf\u79d2\u6570\u5341\u4e07\u6b21\u8bf7\u6c42\u3002<\/p>\n<p>3\u3001\u7b80\u5355\u952e\u503c\u5b58\u50a8<br \/>\n\u91c7\u7528\u952e\u503c&#xff08;Key-Value&#xff09;\u7ed3\u6784\u5b58\u50a8\u6570\u636e&#xff0c;\u952e\u662f\u5b57\u7b26\u4e32&#xff08;\u6700\u5927 250 \u5b57\u8282&#xff09;&#xff0c;\u503c\u53ef\u4ee5\u662f\u4efb\u610f\u6570\u636e&#xff08;\u6700\u5927 1MB&#xff09;&#xff0c;\u4e0d\u652f\u6301\u590d\u6742\u67e5\u8be2&#xff08;\u5982 SQL&#xff09;\u3002<\/p>\n<p>4\u3001\u8fc7\u671f\u7b56\u7565<br \/>\n\u6bcf\u4e2a\u952e\u503c\u5bf9\u53ef\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4&#xff08;TTL&#xff09;&#xff0c;\u8fc7\u671f\u540e\u81ea\u52a8\u5220\u9664&#xff0c;\u4e5f\u652f\u6301 LRU&#xff08;\u6700\u8fd1\u6700\u5c11\u4f7f\u7528&#xff09;\u6dd8\u6c70\u673a\u5236&#xff0c;\u5f53\u5185\u5b58\u4e0d\u8db3\u65f6\u81ea\u52a8\u6e05\u7406\u4e0d\u5e38\u7528\u6570\u636e\u3002<\/p>\n<p>5\u3001\u65e0\u6301\u4e45\u5316<br \/>\n\u6570\u636e\u4ec5\u5b58\u4e8e\u5185\u5b58&#xff0c;\u4e0d\u5199\u5165\u78c1\u76d8&#xff0c;\u670d\u52a1\u5668\u91cd\u542f\u540e\u6570\u636e\u4f1a\u4e22\u5931&#xff0c;\u56e0\u6b64\u901a\u5e38\u4f5c\u4e3a \u201c\u7f13\u5b58\u201d \u800c\u975e \u201c\u6570\u636e\u5e93\u201d \u4f7f\u7528&#xff0c;\u9700\u914d\u5408\u540e\u7aef\u6570\u636e\u5e93\u6301\u4e45\u5316\u6570\u636e\u3002<\/p>\n<p>6\u3001\u8f7b\u91cf\u7ea7\u534f\u8bae<br \/>\n\u4f7f\u7528\u7b80\u5355\u7684\u6587\u672c\u534f\u8bae\u6216\u4e8c\u8fdb\u5236\u534f\u8bae\u901a\u4fe1&#xff0c;\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00&#xff08;Java\u3001Python\u3001PHP \u7b49&#xff09;\u7684\u5ba2\u6237\u7aef\u5e93\u3002<\/p>\n<h3 style=\"background-color:transparent\">3.5\u00a0session\u5171\u4eab\u670d\u52a1\u5668<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"372\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184014-689f7f0ec411d.png\" width=\"1054\" \/><\/p>\n<p>\u5f53\u65b0\u7528\u6237\u53d1\u8bf7\u6c42\u5230Tomcat1\u65f6, Tomcat1\u751f\u6210session\u8fd4\u56de\u7ed9\u7528\u6237\u7684\u540c\u65f6,\u4e5f\u4f1a\u540c\u65f6\u53d1\u7ed9memcached2\u5907 \u4efd\u3002\u5373Tomcat1 session\u4e3a\u4e3bsession&#xff0c;memcached2 session\u4e3a\u5907\u7528session&#xff0c;\u4f7f\u7528memcached\u76f8\u5f53\u4e8e \u5907\u4efd\u4e86\u4e00\u4efdSession \u5982\u679cTomcat1\u53d1\u73b0memcached2 \u5931\u8d25,\u65e0\u6cd5\u5907\u4efdSession\u5230memcached2,\u5219\u5c06Sessoin\u5907\u4efd\u5b58\u653e\u5728 memcached1\u4e2d<\/p>\n<h4>3.5.1\u00a0\u5b89\u88c5\u63d2\u4ef6<\/h4>\n<p>#\u5b89\u88c5telnet<br \/>\n[root&#064;tomcatA ~]# dnf install -y telnet<\/p>\n<p>#\u5b89\u88c5memcache<br \/>\n[root&#064;tomcatA ~]# dnf install -y memcached.x86_64<br \/>\n[root&#064;tomcatA ~]# 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;<br \/>\n[root&#064;tomcatA ~]# systemctl enable &#8211;now memcached<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/memcached.service \u2192    \/usr\/lib\/systemd\/system\/memcached.service.<br \/>\n[root&#064;tomcatA ~]# netstat -antlupe | grep memcache<br \/>\ntcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN         981        78015      31797\/memcached<br \/>\ntcp6       0      0 ::1:11211               :::*                    LISTEN         981        78016      31797\/memcached<\/p>\n<p>#\u5b89\u88c5telnet<br \/>\n[root&#064;tomcatA ~]# dnf install -y telnet<\/p>\n<p>#\u5b89\u88c5memcache<br \/>\n[root&#064;tomcatA ~]# dnf install -y memcached.x86_64<br \/>\n[root&#064;tomcatA ~]# 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;<br \/>\n[root&#064;tomcatA ~]# systemctl enable &#8211;now memcached<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/memcached.service \u2192    \/usr\/lib\/systemd\/system\/memcached.service.<br \/>\n[root&#064;tomcatA ~]# netstat -antlupe | grep memcache<br \/>\ntcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN         981        78015      31797\/memcached<br \/>\ntcp6       0      0 ::1:11211               :::*                    LISTEN         981        78016      31797\/memcached<\/p>\n<h4>3.5.2\u00a0\u4fee\u6539tomcat\u914d\u7f6e<\/h4>\n<p>[root&#064;tomcatA ~]# vim \/usr\/local\/tomcat\/conf\/context.xml<br \/>\n\u5728context\u6807\u7b7e\u4e2d\u7684\u6700\u540e<br \/>\n &lt;Manager className&#061;&#034;de.javakaffee.web.msm.MemcachedBackupSessionManager&#034;<br \/>\n        memcachedNodes&#061;&#034;n1:192.168.134.10:11211,n2:192.168.134.20:11211&#034;<br \/>\n        failoverNodes&#061;&#034;n1&#034;<br \/>\n        requestUriIgnorePattern&#061;&#034;.*\\\\.(ico|png|gif|jpg|css|js)$&#034;<br \/>\n        transcoderFactoryClass&#061;&#034;de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory&#034;<br \/>\n    \/&gt;<\/p>\n<p>[root&#064;tomcatB ~]# vim \/usr\/local\/tomcat\/conf\/context.xml<br \/>\n&lt;Manager className&#061;&#034;de.javakaffee.web.msm.MemcachedBackupSessionManager&#034;<br \/>\n        memcachedNodes&#061;&#034;n1:192.168.134.10:11211,n2:192.168.134.20:11211&#034;<br \/>\n        failoverNodes&#061;&#034;n2&#034;<br \/>\n        requestUriIgnorePattern&#061;&#034;.*\\\\.(ico|png|gif|jpg|css|js)$&#034;<br \/>\n        transcoderFactoryClass&#061;&#034;de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory&#034;<br \/>\n\/&gt;<\/p>\n<h4>3.5.3\u00a0\u6d4b\u8bd5<\/h4>\n<p>1.\u5728\u4e24\u53f0tomcat\u90fd\u5f00\u542f\u7684\u60c5\u51b5\u4e0b&#xff1a;<br \/>\nhttp:\/\/www.zx.org\/test.jsp<br \/>\n2.\u5728n1\u88ab\u505c\u6b62\u540e\u7ee7\u7eed\u63d0\u4ea4\u4fe1\u606f\u770b\u662f\u5426\u53ef\u4ee5\u8bfb\u53d6\u5230\u4e4b\u524d\u7684\u4f1a\u8bdd\u4fe1\u606f<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184016-689f7f109d75a.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815184019-689f7f135ae8b.png\" \/><\/p>\n<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb984\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Tomcat\u7684\u6838\u5fc3\u6982\u5ff5\u3001\u5b89\u88c5\u90e8\u7f72\u53ca\u9ad8\u53ef\u7528\u914d\u7f6e\u65b9\u6848\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1. Tomcat\u6982\u8ff0\uff1a\u5f00\u6e90Java Servlet\u5bb9\u5668\uff0c\u652f\u6301JavaEE\u89c4\u8303\uff0c\u5177\u6709\u8f7b\u91cf\u6613\u7528\u3001\u89c4\u8303\u517c\u5bb9\u7b49\u4f18\u52bf\uff1b2. \u5b89\u88c5\u90e8\u7f72\uff1a\u8be6\u7ec6\u8bf4\u660e\u4e86Java\u73af\u5883\u51c6\u5907\u3001Tomcat\u5b89\u88c5\u542f\u52a8\u53ca\u7cfb\u7edf\u670d\u52a1\u914d\u7f6e\u8fc7\u7a0b\uff1b3. \u9ad8\u53ef\u7528\u65b9\u6848\uff1a\u901a\u8fc7Nginx\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\uff0c\u7ed3\u5408Memcached\u5b9e\u73b0Session\u5171\u4eab\uff0c\u786e\u4fdd\u591a\u8282\u70b9\u4f1a\u8bdd\u4e00\u81f4\u6027\uff1b4. \u6027\u80fd\u4f18\u5316\uff1a\u7ed9\u51fa\u4e86\u5185\u5b58\u914d\u7f6e\u3001\u7ebf\u7a0b\u6c60\u8c03\u4f18\u7b49\u5efa\u8bae\u3002\u6587\u7ae0\u8fd8\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u5b9e\u9a8c\u6b65\u9aa4\u548c\u914d\u7f6e\u6837\u4f8b\uff0c\u9002\u5408\u8fd0\u7ef4\u4eba\u5458\u548c\u5f00\u53d1\u8005\u53c2\u8003\u5b9e\u65bd\u3002<\/p>\n","protected":false},"author":2,"featured_media":58107,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,58,223,87,43,44],"topic":[],"class_list":["post-58117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-linux","tag-tomcat","tag-87","tag-43","tag-44"],"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\/58117.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\u8bfb984\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Tomcat\u7684\u6838\u5fc3\u6982\u5ff5\u3001\u5b89\u88c5\u90e8\u7f72\u53ca\u9ad8\u53ef\u7528\u914d\u7f6e\u65b9\u6848\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1. Tomcat\u6982\u8ff0\uff1a\u5f00\u6e90Java Servlet\u5bb9\u5668\uff0c\u652f\u6301JavaEE\u89c4\u8303\uff0c\u5177\u6709\u8f7b\u91cf\u6613\u7528\u3001\u89c4\u8303\u517c\u5bb9\u7b49\u4f18\u52bf\uff1b2. \u5b89\u88c5\u90e8\u7f72\uff1a\u8be6\u7ec6\u8bf4\u660e\u4e86Java\u73af\u5883\u51c6\u5907\u3001Tomcat\u5b89\u88c5\u542f\u52a8\u53ca\u7cfb\u7edf\u670d\u52a1\u914d\u7f6e\u8fc7\u7a0b\uff1b3. \u9ad8\u53ef\u7528\u65b9\u6848\uff1a\u901a\u8fc7Nginx\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\uff0c\u7ed3\u5408Memcached\u5b9e\u73b0Session\u5171\u4eab\uff0c\u786e\u4fdd\u591a\u8282\u70b9\u4f1a\u8bdd\u4e00\u81f4\u6027\uff1b4. \u6027\u80fd\u4f18\u5316\uff1a\u7ed9\u51fa\u4e86\u5185\u5b58\u914d\u7f6e\u3001\u7ebf\u7a0b\u6c60\u8c03\u4f18\u7b49\u5efa\u8bae\u3002\u6587\u7ae0\u8fd8\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u5b9e\u9a8c\u6b65\u9aa4\u548c\u914d\u7f6e\u6837\u4f8b\uff0c\u9002\u5408\u8fd0\u7ef4\u4eba\u5458\u548c\u5f00\u53d1\u8005\u53c2\u8003\u5b9e\u65bd\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58117.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-15T18:40:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815183956-689f7efc4f52b.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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58117.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58117.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-15T18:40:21+00:00\",\"dateModified\":\"2025-08-15T18:40:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58117.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58117.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58117.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\/58117.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\u8bfb984\u6b21\uff0c\u70b9\u8d5e8\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Tomcat\u7684\u6838\u5fc3\u6982\u5ff5\u3001\u5b89\u88c5\u90e8\u7f72\u53ca\u9ad8\u53ef\u7528\u914d\u7f6e\u65b9\u6848\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1. Tomcat\u6982\u8ff0\uff1a\u5f00\u6e90Java Servlet\u5bb9\u5668\uff0c\u652f\u6301JavaEE\u89c4\u8303\uff0c\u5177\u6709\u8f7b\u91cf\u6613\u7528\u3001\u89c4\u8303\u517c\u5bb9\u7b49\u4f18\u52bf\uff1b2. \u5b89\u88c5\u90e8\u7f72\uff1a\u8be6\u7ec6\u8bf4\u660e\u4e86Java\u73af\u5883\u51c6\u5907\u3001Tomcat\u5b89\u88c5\u542f\u52a8\u53ca\u7cfb\u7edf\u670d\u52a1\u914d\u7f6e\u8fc7\u7a0b\uff1b3. \u9ad8\u53ef\u7528\u65b9\u6848\uff1a\u901a\u8fc7Nginx\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\uff0c\u7ed3\u5408Memcached\u5b9e\u73b0Session\u5171\u4eab\uff0c\u786e\u4fdd\u591a\u8282\u70b9\u4f1a\u8bdd\u4e00\u81f4\u6027\uff1b4. \u6027\u80fd\u4f18\u5316\uff1a\u7ed9\u51fa\u4e86\u5185\u5b58\u914d\u7f6e\u3001\u7ebf\u7a0b\u6c60\u8c03\u4f18\u7b49\u5efa\u8bae\u3002\u6587\u7ae0\u8fd8\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u5b9e\u9a8c\u6b65\u9aa4\u548c\u914d\u7f6e\u6837\u4f8b\uff0c\u9002\u5408\u8fd0\u7ef4\u4eba\u5458\u548c\u5f00\u53d1\u8005\u53c2\u8003\u5b9e\u65bd\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/58117.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T18:40:21+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815183956-689f7efc4f52b.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58117.html","url":"https:\/\/www.wsisp.com\/helps\/58117.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-15T18:40:21+00:00","dateModified":"2025-08-15T18:40:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58117.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58117.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58117.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\/58117","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=58117"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58117\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/58107"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58117"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}