{"id":57075,"date":"2025-08-15T07:29:54","date_gmt":"2025-08-14T23:29:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/57075.html"},"modified":"2025-08-15T07:29:54","modified_gmt":"2025-08-14T23:29:54","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-6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/57075.html","title":{"rendered":"\u4f01\u4e1a\u7ea7WEB\u5e94\u7528\u670d\u52a1\u5668TOMCAT"},"content":{"rendered":"<h2>\u90e8\u7f72\u5b9e\u9a8c<\/h2>\n<p>\u5f00\u542f\u4e09\u53f0\u865a\u62df\u673a&#xff0c;\u4e00\u53f0\u5145\u5f53nginx&#xff0c;\u4e24\u53f0tomcat<\/p>\n<h3>\u5b89\u88c5TOMCAT&#xff08;\u5728\u4e24\u5957&#xff09;<\/h3>\n<h4>\u5b89\u88c5Java\u73af\u5883<\/h4>\n<p>[root&#064;localhost ~]# dnf install java-1.8.0-openjdk.x86_64 -y<br \/>\n[root&#064;localhost ~]# 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)<\/p>\n<p>#\u67e5\u770bJava\u7684\u73af\u5883\u76ee\u5f55<br \/>\n[root&#064;localhost ~]# which java<br \/>\n\/usr\/bin\/java<br \/>\n[root&#064;localhost ~]# ll \/usr\/bin\/java<br \/>\nlrwxrwxrwx 1 root root 22 Aug 11 18:48 \/usr\/bin\/java -&gt; \/etc\/alternatives\/java<\/p>\n<p>#Java\u7684\u8fd0\u884c\u73af\u5883<br \/>\n[root&#064;localhost ~]# cd \/etc\/alternatives\/jre<br \/>\n[root&#064;localhost jre]# ls<br \/>\nASSEMBLY_EXCEPTION  bin  lib  LICENSE  THIRD_PARTY_README <\/p>\n<h4>\u5b89\u88c5tomcat<\/h4>\n<p>#\u89e3\u538b\u5e76\u91cd\u547d\u540d<br \/>\n[root&#064;localhost ~]# tar zxf apache-tomcat-9.0.107.tar.gz -C \/usr\/local\/<br \/>\n[root&#064;localhost local]# mv apache-tomcat-9.0.107 tomcat<br \/>\n[root&#064;localhost local]# ls<br \/>\nbin  etc  games  include  lib  lib64  libexec  sbin  share  src  tomcat<\/p>\n<p>#\u542f\u52a8tomcat<br \/>\n[root&#064;localhost tomcat]# cd bin\/<br \/>\n[root&#064;localhost bin]# ls<br \/>\nbootstrap.jar                 configtest.sh     shutdown.sh<br \/>\ncatalina.bat                  daemon.sh         startup.bat<br \/>\ncatalina.sh                   digest.bat        startup.sh<br \/>\ncatalina-tasks.xml            digest.sh         tomcat-juli.jar<br \/>\nciphers.bat                   makebase.bat      tomcat-native.tar.gz<br \/>\nciphers.sh                    makebase.sh       tool-wrapper.bat<br \/>\ncommons-daemon.jar            setclasspath.bat  tool-wrapper.sh<br \/>\ncommons-daemon-native.tar.gz  setclasspath.sh   version.bat<br \/>\nconfigtest.bat                shutdown.bat      version.sh<br \/>\n[root&#064;localhost 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\/tomcat-juli.jar<br \/>\nUsing CATALINA_OPTS:<br \/>\nTomcat started.<\/p>\n<p>#\u67e5\u770b\u7aef\u53e3<br \/>\n[root&#064;localhost bin]# netstat -antlupe | grep java<br \/>\ntcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      0          69644      36240\/java<br \/>\ntcp6       0      0 :::8080                 :::*                    LISTEN      0          69635      36240\/java <\/p>\n<p>\u8bbf\u95ee\u6210\u529f<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232951-689e716f5d007.png\" \/><\/p>\n<h3>tomcat\u7684\u6587\u4ef6\u7ed3\u6784\u7ec4\u6210<\/h3>\n<h4>\u76ee\u5f55\u7ed3\u6784<\/h4>\n<p>\u76ee\u5f55\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8bf4\u660e &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- bin\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u670d\u52a1\u542f\u52a8\u3001\u505c\u6b62\u7b49\u76f8\u5173\u7a0b\u5e8f\u548c\u6587\u4ef6 conf\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u914d\u7f6e\u6587\u4ef6 lib\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5e93\u76ee\u5f55 logs\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u65e5\u5fd7\u76ee\u5f55 webapps\u00a0 \u00a0 \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u5e94\u7528\u90e8\u7f72\u76ee\u5f55&#xff0c;\u76f8\u5f53\u4e8enginx\u7684\u9ed8\u8ba4\u53d1\u5e03\u76ee\u5f55 work jsp\u00a0 \u00a0 \u00a0\u7f16\u8bd1\u540e\u7684\u7ed3\u679c\u6587\u4ef6&#xff0c;\u5efa\u8bae\u63d0\u524d\u9884\u70ed\u8bbf\u95ee<\/p>\n<h3>\u751f\u6210tomcat\u7684\u542f\u52a8\u6587\u4ef6&#xff08;\u5728\u4e24\u4e2atomcat\u4e3b\u673a\u4e0b&#xff09;<\/h3>\n<p>1\u3001\u751f\u6210\u4e3b\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>[root&#064;localhost ~]# vim \/usr\/local\/tomcat\/conf\/tomcat.conf<br \/>\nJAVA_HOME&#061;\/etc\/alternatives\/jre <\/p>\n<p>2\u3001\u751f\u6210\u542f\u52a8\u6587\u4ef6<\/p>\n<p>[root&#064;localhost ~]# vim \/lib\/systemd\/system\/tomcat.service <\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232951-689e716fa596a.png\" \/><\/p>\n<p>3\u3001\u751f\u6210\u7528\u6237\u5e76\u8bbe\u5b9a\u8f6f\u4ef6\u5b89\u88c5\u76ee\u5f55\u6743\u9650<\/p>\n<p>[root&#064;localhost ~]# useradd -s \/sbin\/nologin -M tomcat<br \/>\n[root&#064;localhost ~]# chown tomcat.tomcat \/usr\/local\/tomcat\/ -R <\/p>\n<p>4\u3001\u7528\u542f\u52a8\u811a\u672c\u5f00\u542f\u670d\u52a1<\/p>\n<p>[root&#064;localhost ~]# systemctl start tomcat<br \/>\n[root&#064;localhost ~]# netstat -antlupe | grep java<br \/>\ntcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      1000       76297      40054\/java <\/p>\n<h2>nginx\u7ed3\u5408\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0tomcat\u96c6\u7fa4<\/h2>\n<h3>\u5e38\u89c1\u90e8\u7f72\u65b9\u5f0f\u4ecb\u7ecd<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232951-689e716fd4ef7.png\" \/><\/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 \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\u00a0\u00a0\u00a0\u00a0LNMT&#xff1a;Linux &#043; Nginx &#043; MySQL &#043; Tomcat<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0LAMT&#xff1a;Linux &#043; Apache&#xff08;Httpd&#xff09;&#043; MySQL &#043; Tomcat \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 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0LNMT&#xff1a;Linux &#043; Nginx &#043; MySQL &#043; Tomcat \u591a\u7ea7\u4ee3\u7406 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0LNNMT&#xff1a;Linux &#043; Nginx &#043; Nginx &#043; MySQL &#043; Tomcat<\/p>\n<h4>\u53cd\u5411\u4ee3\u7406\u5355\u673a<\/h4>\n<p>\u5c06\u6d4b\u8bd5\u6587\u4ef6\u653e\u5230\u9ed8\u8ba4\u53d1\u5e03\u76ee\u5f55\u91cc\u9762&#xff08;\u4e24\u53f0tomcat\u4e3b\u673a\u4e0a&#xff09;<\/p>\n<p>[root&#064;localhost ~]#  cp test.jsp \/usr\/local\/tomcat\/webapps\/ROOT\/<\/p>\n<p>\u5728nginx\u4e3b\u673a\u4e0a&#xff1a;<\/p>\n<p>[root&#064;localhost ~]# dnf install nginx -y<br \/>\n[root&#064;localhost ~]# vi \/etc\/nginx\/nginx.conf <\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e71700143d.png\" \/><\/p>\n<p>[root&#064;localhost ~]# cd \/etc\/nginx\/conf.d\/<br \/>\n[root&#064;localhost conf.d]# vim vhosts.conf<br \/>\nserver{<br \/>\n    listen  80;<br \/>\n    server_name www.suyawen.org;<br \/>\n    location ~ \\\\.jsp$ {<br \/>\n        proxy_pass http:\/\/172.25.254.101:8080;<br \/>\n    }<br \/>\n}<br \/>\n[root&#064;localhost conf.d]# systemctl start nginx <\/p>\n<p>\u5728C:\\\\Windows\\\\System32\\\\drivers\\\\etc\\\\hosts\u6587\u4ef6\u4e2d\u4fee\u6539<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e71701be36.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e717031962.png\" \/><\/p>\n<p>\u5355\u673a\u60c5\u51b5\u4e0btomcat\u6302\u673a&#xff0c;\u6574\u4f53\u5c31\u7528\u4e0d\u4e86\u4e86&#xff1b;\u5c31\u7528\u591a\u673a&#xff0c;\u65e2\u80fd\u8d1f\u8f7d\u5747\u8861\u4e5f\u80fd\u9ad8\u53ef\u7528<\/p>\n<h4>\u53cd\u5411\u4ee3\u7406\u591a\u673a&#xff08;\u4e24\u4e2atomcat\u8d1f\u8f7d\u5747\u8861&#xff09;<\/h4>\n<p>\u5728vhosts.conf\u6587\u4ef6\u4e2d<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e717049cb7.png\" \/><\/p>\n<p>\u56e0\u4e3a\u8d1f\u8f7d\u5747\u8861\u6240\u4ee5\u5728\u4e24\u4e2atomcat\u4e3b\u673a\u4e0a\u6765\u56de\u8f6e\u8be2&#xff0c;\u5bfc\u81f4\u586b\u5199\u4fe1\u606f\u4e0d\u4f1a\u6c38\u4e45\u4fdd\u5b58&#xff08;\u521a\u521a\u5199\u5165\u53ef\u80fd\u8f6e\u8be2\u4e0b\u4e00\u4e2a\u5199\u5165\u4fe1\u606f\u5c31\u6ca1\u6709\u4e86&#xff09;&#xff1b;\u56e0\u6b64\u8981\u8fdb\u884c\u4f1a\u8bdd\u7ed1\u5b9a\u3002<\/p>\n<p>\u4f1a\u8bdd\u7ed1\u5b9a<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e717061493.png\" \/><\/p>\n<p>\u4e0d\u8fc7\u8fd9\u6837\u7684\u8bdd\u540c\u4e00\u4e2a\u8def\u7531\u5668\u8fc7\u6765\u7684\u8def\u7531\u90fd\u4f1a\u8dd1\u5411\u4e00\u4e2a\u8def\u7531\u5668\u4e0a\u4e86&#xff0c;\u5c31\u5f97\u7528cookie\u54c8\u5e0c<\/p>\n<p>cookie\u5ba2\u6237\u7aef\u751f\u6210\u7684\u4f1a\u8bdd&#xff0c;session\u670d\u52a1\u5668\u751f\u6210\u7684\u4f1a\u8bdd\u3002\u4f1a\u8bdd&#xff1a;\u4ee5\u7528\u6237\u7684\u8eab\u4efd\u4e0e\u670d\u52a1\u5668\u5bf9\u8bdd<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e71707ac59.png\" \/><\/p>\n<p>\u5728\u7528\u6237\u63d0\u4ea4\u6570\u636e\u65f6&#xff0c;\u521a\u597d\u6240\u63d0\u4ea4\u7684tomcat\u6302\u673a\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u5982\u4f55\u89e3\u51b3\u5462&#xff1f;<\/p>\n<p>\u65b9\u6cd5&#xff1a;\u5728tomcat\u540e\u7aef\u6302\u7740Memcached&#xff01;<\/p>\n<h2>Memcached<\/h2>\n<h3>\u7b80\u4ecb<\/h3>\n<p>Memcached \u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u4e0d\u652f\u6301\u6301\u4e45\u5316&#xff0c;\u57fa\u4e8eKey-Value\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edfmemcached\u00a0\u867d\u7136\u6ca1\u6709\u50cfredis\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd&#xff0c;\u6bd4\u5982RDB\u548cAOF\u90fd\u6ca1\u6709&#xff0c;\u4f46\u662f\u53ef\u4ee5\u901a\u8fc7\u505a\u96c6\u7fa4\u540c\u6b65\u7684\u65b9\u5f0f&#xff0c;\u8ba9\u5404memcached\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\u5404memcached\u7684\u6570\u636e\u662f\u4e00\u6837\u7684&#xff0c;\u5373\u4f7f\u6709\u4efb\u4f55\u4e00\u53f0 memcached \u53d1\u751f\u6545\u969c&#xff0c;\u53ea\u8981\u96c6\u7fa4\u4e2d\u6709\u4e00\u53f0 memcached \u53ef\u7528\u5c31\u4e0d\u4f1a\u51fa\u73b0\u6570\u636e\u4e22\u5931&#xff0c;\u5f53\u5176\u4ed6memcached \u91cd\u65b0\u52a0\u5165\u5230\u96c6\u7fa4\u7684\u65f6\u5019,\u53ef\u4ee5\u81ea\u52a8\u4ece\u6709\u6570\u636e\u7684memcached \u5f53\u4e2d\u81ea\u52a8\u83b7\u53d6\u6570\u636e\u5e76\u63d0\u4f9b\u670d\u52a1\u3002<\/p>\n<\/p>\n<p>Memcached \u501f\u52a9\u4e86\u64cd\u4f5c\u7cfb\u7edf\u7684 libevent \u5de5\u5177\u505a\u9ad8\u6548\u7684\u8bfb\u5199\u3002libevent\u662f\u4e2a\u7a0b\u5e8f\u5e93&#xff0c;\u5b83\u5c06Linux\u7684epoll\u3001BSD\u7c7b\u64cd\u4f5c\u7cfb\u7edf\u7684kqueue\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\u6027\u80fd\u3002memcached\u4f7f\u7528\u8fd9\u4e2alibevent\u5e93&#xff0c;\u56e0\u6b64\u80fd\u5728Linux\u3001BSD\u3001Solaris\u7b49\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u53d1\u6325\u5176\u9ad8\u6027\u80fd<\/p>\n<\/p>\n<p>Memcached \u652f\u6301\u6700\u5927\u7684\u5185\u5b58\u5b58\u50a8\u5bf9\u8c61\u4e3a1M&#xff0c;\u8d85\u8fc71M\u7684\u6570\u636e\u53ef\u4ee5\u4f7f\u7528\u5ba2\u6237\u7aef\u538b\u7f29\u6216\u62c6\u5206\u62a5\u5305\u653e\u5230\u591a\u4e2akey\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;memcached \u6700\u9002\u5408\u4fdd\u5b58\u7528\u6237\u7684session\u5b9e\u73b0session\u5171\u4eab Memcached\u5b58\u50a8\u6570\u636e\u65f6, Memcached\u4f1a\u53bb\u7533\u8bf71MB\u7684\u5185\u5b58, \u628a\u8be5\u5757\u5185\u5b58\u79f0\u4e3a\u4e00\u4e2aslab, \u4e5f\u79f0\u4e3a\u4e00\u4e2apage Memcached \u652f\u6301\u591a\u79cd\u5f00\u53d1\u8bed\u8a00&#xff0c;\u5305\u62ec&#xff1a;JAVA,C,Python,PHP,C#,Ruby,Perl\u7b49<\/p>\n<p>\u5b98\u7f51&#xff1a;http:\/\/memcached.org\/<\/p>\n<h3>memcached\u7684\u5b89\u88c5\u4e0e\u542f\u7528&#xff08;\u4e24\u53f0tomcat\u4e0b&#xff09;<\/h3>\n<p>[root&#064;localhost ~]# dnf install memcached -y<\/p>\n<p>#\u56e0\u4e3a\u5b83\u662f\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93&#xff0c;\u65e0\u5ba2\u6237\u7aef\u56e0\u6b64\u53ef\u4e0b\u8f7dtelnet\u8fdb\u884c\u8bbf\u95ee<br \/>\n[root&#064;localhost ~]# dnf install telnet -y<br \/>\n[root&#064;localhost ~]# systemctl start memcached<\/p>\n<p>#\u67e5\u770b\u9ed8\u8ba4\u7aef\u53e3<br \/>\n[root&#064;localhost ~]# netstat -antlupe | grep memcached<br \/>\ntcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      983        98583      47560\/memcached<br \/>\ntcp6       0      0 ::1:11211               :::*                    LISTEN      983        98584      47560\/memcached<\/p>\n<p>#\u6539\u4e3a\u76d1\u542c\u652f\u6301ip\u7684\u6240\u6709\u7aef\u53e3<br \/>\n[root&#064;localhost ~]# 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;   #\u5c06\u539f\u6765\u7684127.0.0.1\u6539\u4e3a0.0.0.0<\/p>\n<p>[root&#064;localhost ~]# systemctl restart memcached<\/p>\n<p>[root&#064;localhost ~]# telnet 172.25.254.101 11211<br \/>\nTrying 172.25.254.101&#8230;<br \/>\nConnected to 172.25.254.101.<br \/>\nEscape character is &#039;^]&#039;. <\/p>\n<h3>memcached \u64cd\u4f5c\u547d\u4ee4<\/h3>\n<p>\u4e94\u79cd\u57fa\u672c memcached \u547d\u4ee4\u6267\u884c\u6700\u7b80\u5355\u7684\u64cd\u4f5c\u3002\u8fd9\u4e9b\u547d\u4ee4\u548c\u64cd\u4f5c\u5305\u62ec&#xff1a; set add replace get delete<\/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;<\/p>\n<p>#\u53c2\u6570\u8bf4\u660e\u5982\u4e0b&#xff1a;<br \/>\ncommand set\/add\/replace<br \/>\nkey \u00a0 \u00a0     key \u7528\u4e8e\u67e5\u627e\u7f13\u5b58\u503c<br \/>\nflags \u00a0 \u00a0   \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 \u00a0 \u00a0 \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 \u00a0 \u00a0     \u5728\u7f13\u5b58\u4e2d\u5b58\u50a8\u7684\u5b57\u8282\u6570<br \/>\nvalue \u00a0 \u00a0     \u5b58\u50a8\u7684\u503c&#xff08;\u59cb\u7ec8\u4f4d\u4e8e\u7b2c\u4e8c\u884c&#xff09;<\/p>\n<p>#\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 \u00a0<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p>[root&#064;localhost ~]# telnet 172.25.254.101 11211<br \/>\nTrying 172.25.254.101&#8230;<br \/>\nConnected to 172.25.254.101.<br \/>\nEscape character is &#039;^]&#039;.<br \/>\nadd les 0 60 2        #0 \u662f\u5426\u538b\u7f29 60 \u8fc7\u671f\u65f6\u95f4 4 \u5b57\u957f<br \/>\na1<br \/>\nSTORED<\/p>\n<p>add leekey1 0 60 3<br \/>\nles<br \/>\nSTORED<\/p>\n<p>#\u67e5\u770b<br \/>\nget les<br \/>\nVALUE les 0 2<br \/>\na1<br \/>\nEND<\/p>\n<p>#\u6539<br \/>\nset les 0 60 5<br \/>\nhello<br \/>\nSTORED<br \/>\nget les<br \/>\nVALUE leekey 0 5<br \/>\nhello<br \/>\nEND<br \/>\nadd leekey1 0 60 4<br \/>\ntest<\/p>\n<p>#\u5220\u9664<br \/>\ndelete les<br \/>\nDELETED<br \/>\nget les<br \/>\nEND<br \/>\nget leekey1<br \/>\ntest<\/p>\n<p>#\u6e05\u7a7a<br \/>\nflush_all<br \/>\nOK<br \/>\nget leekey1<br \/>\nEND <\/p>\n<p>\u4e24\u4e2a\u90fd\u641e\u597d\u540e&#xff0c;\u4f7f\u7528\u63d2\u4ef6\u8ba9tomcat\u5728memcached\u91cc\u5b58\u4e1c\u897f&#xff08;\u9ed8\u8ba4\u60c5\u51b5\u4e0btomcat\u4e0d\u652f\u6301memcached&#xff09;<\/p>\n<h2>session \u5171\u4eab\u670d\u52a1\u5668<\/h2>\n<h3>msm \u4ecb\u7ecd<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e7170912d8.png\" \/><\/p>\n<p>msm&#xff08;memcached session manager&#xff09;\u63d0\u4f9b\u5c06Tomcat\u7684session\u4fdd\u6301\u5230memcached\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u53ef\u7528\u3002 \u9879\u76ee\u65e9\u671f\u6258\u7ba1\u5728google code,\u76ee\u524d\u5728Github<\/p>\n<p>github\u7f51\u7ad9\u94fe\u63a5&#xff1a;https:\/\/github.com\/magro\/memcached-session-manager<\/p>\n<p>\u652f\u6301Tomcat\u7684 6.x\u30017.x\u30018.x\u30019.x \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Tomcat\u7684Session\u7ba1\u7406\u7c7b&#xff0c;Tomcat\u7248\u672c\u4e0d\u540c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0memcached-session-manager-2.3.2.jar \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0memcached-session-manager-tc9-2.3.2.jar \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Session\u6570\u636e\u7684\u5e8f\u5217\u5316\u3001\u53cd\u5e8f\u5217\u5316\u7c7b \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b98\u65b9\u63a8\u8350kyro \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5728webapp\u4e2dWEB-INF\/lib\/\u4e0b \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9a71\u52a8\u7c7b \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0memcached(spymemcached.jar) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Redis(jedis.jar)<\/p>\n<h3>\u5b89\u88c5<\/h3>\n<p>\u67e5\u770b\u672c\u673amemcached \u7248\u672c&#xff0c;\u53ef\u5728\u7f51\u7ad9\u67e5\u8be2\u5339\u914d\u63d2\u4ef6\u7248\u672c<\/p>\n<p>\u53c2\u8003\u94fe\u63a5&#xff1a;https:\/\/github.com\/magro\/memcached-session-manager\/wiki\/SetupAndConfiguration<\/p>\n<p>[root&#064;localhost ~]# rpm -qa | grep memcached<br \/>\nmemcached-selinux-1.6.9-7.el9.x86_64<br \/>\nmemcached-1.6.9-7.el9.x86_64 <\/p>\n<p>\u5c06spymemcached.jar\u3001memcached-session-manage\u3001kyro\u76f8\u5173\u7684jar\u6587\u4ef6\u90fd\u653e\u5230Tomcat\u7684lib\u76ee\u5f55 \u4e2d&#xff0c;\u8fd9\u4e2a\u76ee\u5f55\u662f $CATALINA_HOME\/lib\/ &#xff0c;\u5bf9\u5e94\u672c\u6b21\u5b89\u88c5\u5c31\u662f\/usr\/local\/tomcat\/lib\u3002<\/p>\n<p>[root&#064;localhost lib]# ls<br \/>\nannotations-api.jar                      servlet-api.jar<br \/>\nasm-5.2.jar                              spymemcached-2.12.3.jar<br \/>\ncatalina-ant.jar                         tomcat-api.jar<br \/>\ncatalina-ha.jar                          tomcat-coyote-ffm.jar<br \/>\ncatalina.jar                             tomcat-coyote.jar<br \/>\ncatalina-ssi.jar                         tomcat-dbcp.jar<br \/>\ncatalina-storeconfig.jar                 tomcat-i18n-cs.jar<br \/>\ncatalina-tribes.jar                      tomcat-i18n-de.jar<br \/>\necj-4.20.jar                             tomcat-i18n-es.jar<br \/>\nel-api.jar                               tomcat-i18n-fr.jar<br \/>\njasper-el.jar                            tomcat-i18n-ja.jar<br \/>\njasper.jar                               tomcat-i18n-ko.jar<br \/>\njaspic-api.jar                           tomcat-i18n-pt-BR.jar<br \/>\njsp-api.jar                              tomcat-i18n-ru.jar<br \/>\nkryo-3.0.3.jar                           tomcat-i18n-zh-CN.jar<br \/>\nkryo-serializers-0.45.jar                tomcat-jdbc.jar<br \/>\nmemcached-session-manager-2.3.2.jar      tomcat-jni.jar<br \/>\nmemcached-session-manager-tc9-2.3.2.jar  tomcat-util.jar<br \/>\nminlog-1.3.1.jar                         tomcat-util-scan.jar<br \/>\nmsm-kryo-serializer-2.3.2.jar            tomcat-websocket.jar<br \/>\nobjenesis-2.6.jar                        websocket-api.jar<br \/>\nreflectasm-1.11.9.jar<br \/>\n[root&#064;localhost ~]# systemctl restart tomcat.service <\/p>\n<p>\u6ce8&#xff1a;<\/p>\n<p>t1\u548cm1\u90e8\u7f72\u53ef\u4ee5\u5728\u4e00\u53f0\u4e3b\u673a\u4e0a&#xff0c;t2\u548cm2\u90e8\u7f72\u4e5f\u53ef\u4ee5\u5728\u540c\u4e00\u53f0\u3002<\/p>\n<\/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<\/p>\n<\/p>\n<p>\u5982\u679cTomcat1\u53d1\u73b0memcached2 \u5931\u8d25,\u65e0\u6cd5\u5907\u4efdSession\u5230memcached2,\u5219\u5c06Sessoin\u5907\u4efd\u5b58\u653e\u5728memcached1\u4e2d<\/p>\n<h3>\u914d\u7f6e<\/h3>\n<h4>\u4fee\u6539tomcat\u914d\u7f6e<\/h4>\n<p>[root&#064;localhost ~]# vim \/usr\/local\/tomcat\/conf\/context.xml <\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e7170b063e.png\" \/><\/p>\n<p>[root&#064;localhost ~]# systemctl restart tomcat.service <\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" class=\"left\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232952-689e7170e7e0c.png\" \/><\/p>\n<p>\u8fd9\u4e0b\u5728\u6302\u673a\u540e\u6570\u636e\u4e5f\u4e0d\u4f1a\u4e22\u5931<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb806\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf7\u6b21\u3002standalone\u6a21\u5f0f\uff0cTomcat\u5355\u72ec\u8fd0\u884c\uff0c\u76f4\u63a5\u63a5\u53d7\u7528\u6237\u7684\u8bf7\u6c42\uff0c\u4e0d\u63a8\u8350\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u5355\u673a\u8fd0\u884c\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2aNginx\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\uff0c\u53ef\u4ee5\u505a\u5230\u9759\u6001\u7531nginx\u63d0\u4f9b\u54cd\u5e94\uff0c\u52a8\u6001jsp\u4ee3\u7406\u7ed9Tomcat\u524d\u7f6e\u4e00\u53f0Nginx\uff0c\u7ed9\u591a\u53f0Tomcat\u5b9e\u4f8b\u505a\u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\uff0cTomcat\u4e0a\u90e8\u7f72\u7684\u7eaf\u52a8\u6001\u9875\u9762\u66f4\u9002\u5408\u591a\u7ea7\u4ee3\u7406Memcached\u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b\uff0c\u4e0d\u652f\u6301\u6301\u4e45\u5316\uff0c\u57fa\u4e8eKey-Value\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edfmemcached \u867d\u7136\u6ca1\u6709\u50cfredis\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd\uff0c\u6bd4\u5982RDB\u548cAOF\u90fd\u6ca1\u6709\uff0c\u4f46\u662f\u3002<\/p>\n","protected":false},"author":2,"featured_media":57063,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,223,87],"topic":[],"class_list":["post-57075","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-tomcat","tag-87"],"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\/57075.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\u8bfb806\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf7\u6b21\u3002standalone\u6a21\u5f0f\uff0cTomcat\u5355\u72ec\u8fd0\u884c\uff0c\u76f4\u63a5\u63a5\u53d7\u7528\u6237\u7684\u8bf7\u6c42\uff0c\u4e0d\u63a8\u8350\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u5355\u673a\u8fd0\u884c\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2aNginx\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\uff0c\u53ef\u4ee5\u505a\u5230\u9759\u6001\u7531nginx\u63d0\u4f9b\u54cd\u5e94\uff0c\u52a8\u6001jsp\u4ee3\u7406\u7ed9Tomcat\u524d\u7f6e\u4e00\u53f0Nginx\uff0c\u7ed9\u591a\u53f0Tomcat\u5b9e\u4f8b\u505a\u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\uff0cTomcat\u4e0a\u90e8\u7f72\u7684\u7eaf\u52a8\u6001\u9875\u9762\u66f4\u9002\u5408\u591a\u7ea7\u4ee3\u7406Memcached\u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b\uff0c\u4e0d\u652f\u6301\u6301\u4e45\u5316\uff0c\u57fa\u4e8eKey-Value\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edfmemcached \u867d\u7136\u6ca1\u6709\u50cfredis\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd\uff0c\u6bd4\u5982RDB\u548cAOF\u90fd\u6ca1\u6709\uff0c\u4f46\u662f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/57075.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-14T23:29:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232951-689e716f5d007.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\/57075.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/57075.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-14T23:29:54+00:00\",\"dateModified\":\"2025-08-14T23:29:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/57075.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/57075.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57075.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\/57075.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\u8bfb806\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf7\u6b21\u3002standalone\u6a21\u5f0f\uff0cTomcat\u5355\u72ec\u8fd0\u884c\uff0c\u76f4\u63a5\u63a5\u53d7\u7528\u6237\u7684\u8bf7\u6c42\uff0c\u4e0d\u63a8\u8350\u3002\u53cd\u5411\u4ee3\u7406\uff0c\u5355\u673a\u8fd0\u884c\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2aNginx\u4f5c\u4e3a\u53cd\u5411\u4ee3\u7406\uff0c\u53ef\u4ee5\u505a\u5230\u9759\u6001\u7531nginx\u63d0\u4f9b\u54cd\u5e94\uff0c\u52a8\u6001jsp\u4ee3\u7406\u7ed9Tomcat\u524d\u7f6e\u4e00\u53f0Nginx\uff0c\u7ed9\u591a\u53f0Tomcat\u5b9e\u4f8b\u505a\u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u8c03\u5ea6\uff0cTomcat\u4e0a\u90e8\u7f72\u7684\u7eaf\u52a8\u6001\u9875\u9762\u66f4\u9002\u5408\u591a\u7ea7\u4ee3\u7406Memcached\u53ea\u652f\u6301\u80fd\u5e8f\u5217\u5316\u7684\u6570\u636e\u7c7b\u578b\uff0c\u4e0d\u652f\u6301\u6301\u4e45\u5316\uff0c\u57fa\u4e8eKey-Value\u7684\u5185\u5b58\u7f13\u5b58\u7cfb\u7edfmemcached \u867d\u7136\u6ca1\u6709\u50cfredis\u6240\u5177\u5907\u7684\u6570\u636e\u6301\u4e45\u5316\u529f\u80fd\uff0c\u6bd4\u5982RDB\u548cAOF\u90fd\u6ca1\u6709\uff0c\u4f46\u662f\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/57075.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T23:29:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814232951-689e716f5d007.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\/57075.html","url":"https:\/\/www.wsisp.com\/helps\/57075.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-14T23:29:54+00:00","dateModified":"2025-08-14T23:29:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/57075.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/57075.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/57075.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\/57075","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=57075"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57075\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/57063"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=57075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=57075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=57075"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=57075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}