{"id":32016,"date":"2025-04-22T18:31:15","date_gmt":"2025-04-22T10:31:15","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/32016.html"},"modified":"2025-04-22T18:31:15","modified_gmt":"2025-04-22T10:31:15","slug":"springboot%e9%a1%b9%e7%9b%ae%e9%83%a8%e7%bd%b2%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84tomcat-linux%e4%b8%8b%e5%ae%89%e8%a3%85jdk%e3%80%81%e5%ae%89%e8%a3%85tomcat%e3%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/32016.html","title":{"rendered":"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>1.\u8d2d\u4e70\u670d\u52a1\u5668<\/li>\n<li>2.\u914d\u7f6eXShell\u548cXftp<\/li>\n<li>3.\u5b89\u88c5jdk<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>3.1 \u53bb\u4e0b\u8f7djdk\u7684\u5305<\/li>\n<li>3.2 \u901a\u8fc7xftp\u4e0a\u4f20jdk\u538b\u7f29\u5305<\/li>\n<li>3.3 \u6253\u5f00\u5b58\u653ejdk\u538b\u7f29\u5305\u7684\u6587\u4ef6\u5939<\/li>\n<li>3.4 \u89e3\u538b\u6587\u4ef6<\/li>\n<li>3.5 \u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/li>\n<li>3.6 \u4f7f\u914d\u7f6e\u6587\u4ef6\u751f\u6548<\/li>\n<li>3.7 \u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>4.\u5b89\u88c5Tomcat<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>4.1 \u4e0b\u8f7d\u540e\u653e\u5230\u76f8\u5e94\u76ee\u5f55<\/li>\n<li>4.2 \u89e3\u538b<\/li>\n<li>4.3 \u7ed9\u9632\u706b\u5899\u6dfb\u52a0\u8bbf\u95ee\u7aef\u53e3&#xff08;\u9ed8\u8ba48080&#xff0c;\u5728\u5b83\u7684\/conf\/server.xml\u6587\u4ef6\u91cc\u9762\u67e5\u770b&#xff09;<\/li>\n<li>4.4 \u7136\u540e\u5207\u6362\u5230bin\u76ee\u5f55\u4e0b&#xff0c;\u542f\u52a8&#xff08;\u6210\u529f\u6548\u679c\u5982\u56fe&#xff09;<\/li>\n<li>4.5 \u8bbf\u95ee<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>5.\u9879\u76ee\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668Tomcat<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>5.1 \u6253\u5305\u9879\u76ee<\/li>\n<li>\n<ul>\n<li>5.1.1 pom.xml \u4fee\u6539\u6253\u5305\u65b9\u5f0f<\/li>\n<li>5.1.2 \u52a0\u5165SpringBoot\u6253\u5305\u63d2\u4ef6(pom.xml)<\/li>\n<li>5.1.3 \u5728\u6253\u5305\u63d2\u4ef6\u4e2d\u52a0\u5165\u914d\u7f6eSpringBoot\u7684\u5165\u53e3\u7c7b\u7684\u6807\u7b7e\u540d<\/li>\n<li>5.1.4 \u6392\u9664\u5185\u7f6etomcat\u5bb9\u5668&#xff0c;\u5bfc\u51fa\u6210war\u5305\u53ef\u4ee5\u8ba9\u5916\u90e8\u5bb9\u5668\u8fd0\u884cspring-boot\u9879\u76ee<\/li>\n<li>5.1.5 \u8fdb\u884c\u6253\u5305<\/li>\n<\/ul>\n<\/li>\n<li>5.2 \u90e8\u7f72\u5230\u670d\u52a1\u5668Tomcat\u4e0a<\/li>\n<li>\n<ul>\n<li>5.2.1 \u5c06War\u5305\u4e0a\u4f20\u5230\u5230Tomcat\u7684webapps\u76ee\u5f55\u4e0b<\/li>\n<li>5.2.2 \u542f\u52a8tomcat<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>1.\u8d2d\u4e70\u670d\u52a1\u5668<\/h2>\n<p>\u6211\u4f7f\u7528\u7684\u662f\u963f\u91cc\u4e91\u670d\u52a1\u5668<\/p>\n<h2>2.\u914d\u7f6eXShell\u548cXftp<\/h2>\n<p>\u53c2\u8003\u535a\u5ba2&#xff1a;Xshell Xftp \u7684\u5b89\u88c5\u3001\u914d\u7f6e\u53ca\u4f7f\u7528 \u8fde\u63a5\u4e0d\u4e0a\u53ef\u80fd\u662f\u6ca1\u6709\u5f00\u542fssh&#xff1a;Windows \u4e0a\u7684 OpenSSH&#xff1a;\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u4f7f\u7528\u6307\u5357 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103110-68076feed40e5.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>3.\u5b89\u88c5jdk<\/h2>\n<p>\u53c2\u8003\u94fe\u63a5&#xff1a;\u5728linux\u670d\u52a1\u5668\u4e0a\u5b89\u88c5JDK\u73af\u5883&#xff08;\u4fdd\u59c6\u6559\u7a0b&#xff09;<\/p>\n<h4>3.1 \u53bb\u4e0b\u8f7djdk\u7684\u5305<\/h4>\n<p>\u8fd9\u91cc\u662f\u6211\u4e0b\u8f7d\u7684\u7248\u672c&#xff0c;\u53ef\u4ee5\u6309\u9700\u4e0b\u8f7d&#xff1a;\u767e\u5ea6\u7f51\u76d8\u94fe\u63a5 \u63d0\u53d6\u7801&#xff1a;2ic1<\/p>\n<h4>3.2 \u901a\u8fc7xftp\u4e0a\u4f20jdk\u538b\u7f29\u5305<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103111-68076fef24457.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>3.3 \u6253\u5f00\u5b58\u653ejdk\u538b\u7f29\u5305\u7684\u6587\u4ef6\u5939<\/h4>\n<p>cd instalpack<span class=\"token operator\">\/<\/span>jdk1<span class=\"token punctuation\">.<\/span><span class=\"token number\">8<\/span><span class=\"token operator\">\/<\/span><\/p>\n<h4>3.4 \u89e3\u538b\u6587\u4ef6<\/h4>\n<p>tar <span class=\"token operator\">&#8211;<\/span>zxvf jdk<span class=\"token operator\">&#8211;<\/span><span class=\"token number\">8<\/span>u191<span class=\"token operator\">&#8211;<\/span>linux<span class=\"token operator\">&#8211;<\/span>x64<span class=\"token punctuation\">.<\/span>tar<span class=\"token punctuation\">.<\/span>gz<\/p>\n<p>\u89e3\u538b\u540e\u5982\u4e0b <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103111-68076fef5229c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>3.5 \u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h4>\n<p>sudo vim <span class=\"token operator\">\/<\/span>etc<span class=\"token operator\">\/<\/span>profile<\/p>\n<p>\u8f93\u5165i\u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f \u914d\u7f6e\u4e0b\u8ff0\u5185\u5bb9&#xff1a;<\/p>\n<p>#JAVA_HOME<br \/>\nexport JAVA_HOME<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">\/<\/span>root<span class=\"token operator\">\/<\/span>instalpack<span class=\"token operator\">\/<\/span>jdk1<span class=\"token punctuation\">.<\/span><span class=\"token number\">8<\/span><span class=\"token operator\">\/<\/span>jdk1<span class=\"token punctuation\">.<\/span><span class=\"token number\">8.0_191<\/span><br \/>\nexport CLASSPATH<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">:<\/span>$<span class=\"token punctuation\">{<\/span>JAVA_HOME<span class=\"token punctuation\">}<\/span><span class=\"token operator\">\/<\/span>jre<span class=\"token operator\">\/<\/span>lib<span class=\"token operator\">\/<\/span>rt<span class=\"token punctuation\">.<\/span>jar<span class=\"token operator\">:<\/span>$<span class=\"token punctuation\">{<\/span>JAVA_HOME<span class=\"token punctuation\">}<\/span><br \/>\nexport PATH<span class=\"token operator\">&#061;<\/span>$PATH<span class=\"token operator\">:<\/span>$<span class=\"token punctuation\">{<\/span>JAVA_HOME<span class=\"token punctuation\">}<\/span><span class=\"token operator\">\/<\/span>bin<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103111-68076fef79c47.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u914d\u7f6e\u5b8c\u540e\u6309Esc\u9000\u51fa\u7f16\u8f91\u6a21\u5f0f \u8f93\u5165 :wq \u8fdb\u884c\u4fdd\u5b58<\/p>\n<h4>3.6 \u4f7f\u914d\u7f6e\u6587\u4ef6\u751f\u6548<\/h4>\n<p>source <span class=\"token operator\">\/<\/span>etc<span class=\"token operator\">\/<\/span>profile<\/p>\n<h4>3.7 \u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f<\/h4>\n<p> java <span class=\"token operator\">&#8211;<\/span>version<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103111-68076fefb6edb.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u663e\u793a\u51fa\u7248\u672c\u53f7\u5373\u5b89\u88c5\u6210\u529f<\/p>\n<h2>4.\u5b89\u88c5Tomcat<\/h2>\n<p>\u53c2\u8003\u94fe\u63a5&#xff1a;Tomcat\u670d\u52a1\u5668\u5b89\u88c5\u3001\u914d\u7f6e\u6559\u7a0b \u53bb\u5b98\u7f51\u4e0b\u8f7d&#xff1a;https:\/\/tomcat.apache.org\/ \u8fd9\u91cc\u662f\u6211\u4e0b\u8f7d\u7684\u7248\u672c&#xff0c;\u53ef\u4ee5\u6309\u9700\u4e0b\u8f7d&#xff1a;\u767e\u5ea6\u7f51\u76d8\u94fe\u63a5<\/p>\n<p>\u63d0\u53d6\u7801&#xff1a;30mt<\/p>\n<h4>4.1 \u4e0b\u8f7d\u540e\u653e\u5230\u76f8\u5e94\u76ee\u5f55<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103111-68076fefddd3c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>4.2 \u89e3\u538b<\/h4>\n<p>unzip apache<span class=\"token operator\">&#8211;<\/span>tomcat<span class=\"token operator\">&#8211;<\/span><span class=\"token number\">8.5<\/span><span class=\"token number\">.96<\/span><span class=\"token punctuation\">.<\/span>zip<\/p>\n<h4>4.3 \u7ed9\u9632\u706b\u5899\u6dfb\u52a0\u8bbf\u95ee\u7aef\u53e3&#xff08;\u9ed8\u8ba48080&#xff0c;\u5728\u5b83\u7684\/conf\/server.xml\u6587\u4ef6\u91cc\u9762\u67e5\u770b&#xff09;<\/h4>\n<p>\u6ce8\u610f\u5148\u5f00\u542f\u9632\u706b\u5899&#xff0c;\u4e0d\u7136\u5c31\u4f1a\u50cf\u6211\u4e00\u6837 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103112-68076ff011494.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u542f\u52a8\u9632\u706b\u5899\u670d\u52a1<\/p>\n<p>systemctl start firewalld<\/p>\n<p>\u67e5\u770b\u5f00\u542f\u72b6\u6001<\/p>\n<p>systemctl status firewalld<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103112-68076ff03b966.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u770b\u5230\u7c7b\u4f3c active (running) \u7684\u72b6\u6001\u4fe1\u606f&#xff0c;\u90a3\u5c31\u8bf4\u660e Firewalld \u5df2\u7ecf\u6210\u529f\u542f\u52a8\u4e86<\/p>\n<p>\u7ed9\u9632\u706b\u5899\u6dfb\u52a0\u8bbf\u95ee\u7aef\u53e3<\/p>\n<p>#\u6dfb\u52a0 <span class=\"token operator\">&#8212;<\/span>permanent\u6c38\u4e45\u751f\u6548&#xff0c;\u6ca1\u6709\u6b64\u53c2\u6570\u91cd\u542f\u540e\u5931\u6548<br \/>\nfirewall<span class=\"token operator\">&#8211;<\/span>cmd <span class=\"token operator\">&#8212;<\/span>zone<span class=\"token operator\">&#061;<\/span><span class=\"token keyword\">public<\/span> <span class=\"token operator\">&#8212;<\/span>add<span class=\"token operator\">&#8211;<\/span>port<span class=\"token operator\">&#061;<\/span><span class=\"token number\">8080<\/span><span class=\"token operator\">\/<\/span>tcp <span class=\"token operator\">&#8212;<\/span>permanent<br \/>\n#\u91cd\u65b0\u8f7d\u5165<br \/>\nfirewall<span class=\"token operator\">&#8211;<\/span>cmd <span class=\"token operator\">&#8212;<\/span>reload<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103112-68076ff07f80a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>4.4 \u7136\u540e\u5207\u6362\u5230bin\u76ee\u5f55\u4e0b&#xff0c;\u542f\u52a8&#xff08;\u6210\u529f\u6548\u679c\u5982\u56fe&#xff09;<\/h4>\n<p><span class=\"token punctuation\">.<\/span>\/startup<span class=\"token punctuation\">.<\/span>sh<span class=\"token comment\">\/\/ \u542f\u52a8<\/span><br \/>\n# \u8fd9\u4e2a\u6587\u4ef6\u505c\u6b62tomcat\u670d\u52a1&#xff0c;\u4e00\u822c\u4e0d\u7528&#xff0c;\u7528\u4e86\u5c31\u8bbf\u95ee\u4e0d\u4e86\u4e86<br \/>\n<span class=\"token punctuation\">.<\/span>\/shutdown<span class=\"token punctuation\">.<\/span>sh<span class=\"token comment\">\/\/ \u505c\u6b62<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103112-68076ff0a9404.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u6ce8\u610f&#xff0c;\u786e\u4fdd\u670d\u52a1\u5668\u914d\u7f6e\u4e868080\u7aef\u53e3\u76f8\u5173\u5185\u5bb9 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103112-68076ff0d7b70.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>4.5 \u8bbf\u95ee<\/h4>\n<p>http:\u4f60\u7684\u516c\u7f51IP:8080\/ \u6210\u529f\u9875\u9762\u5982\u4e0b <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103113-68076ff128142.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>5.\u9879\u76ee\u6253\u5305\u90e8\u7f72\u5230\u670d\u52a1\u5668Tomcat<\/h2>\n<p>\u53c2\u8003\u535a\u5ba2&#xff1a;SpringBoot\u6253war\u5305\u90e8\u7f72Tomcat(\u6700\u5168)<\/p>\n<h4>5.1 \u6253\u5305\u9879\u76ee<\/h4>\n<h5>5.1.1 pom.xml \u4fee\u6539\u6253\u5305\u65b9\u5f0f<\/h5>\n<p>    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>packaging<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>war<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>packaging<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<h5>5.1.2 \u52a0\u5165SpringBoot\u6253\u5305\u63d2\u4ef6(pom.xml)<\/h5>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>build<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>org.springframework.boot<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>spring-boot-maven-plugin<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>build<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<h5>5.1.3 \u5728\u6253\u5305\u63d2\u4ef6\u4e2d\u52a0\u5165\u914d\u7f6eSpringBoot\u7684\u5165\u53e3\u7c7b\u7684\u6807\u7b7e\u540d<\/h5>\n<p>\u5165\u53e3\u7c7b\u5373&#xff1a;\u5e26\u6709&#064;SpringBootApplication\u6ce8\u89e3\u7684\u7c7b\u3002<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>build<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>org.springframework.boot<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>spring-boot-maven-plugin<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>                <span class=\"token comment\">&lt;!&#8211;\u914d\u7f6espringboot\u5165\u53e3\u7c7b&#8211;&gt;<\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>configuration<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>fork<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>true<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>fork<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>jvmArguments<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>Dfile.encoding&#061;UTF-8<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>jvmArguments<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                    <span class=\"token comment\">&lt;!&#8211;\u914d\u7f6e\u5165\u53e3\u7c7b\u7684\u6807\u7b7e\u540d:\u6ce8\u610f\u4fee\u6539\u6210\u4f60\u81ea\u5df1\u7684&#8211;&gt;<\/span><br \/>\n                    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>mainClass<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>com.yolo.websocketdemo.WebsocketdemoApplication<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>mainClass<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n                <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>configuration<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugin<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plugins<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>build<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<h5>5.1.4 \u6392\u9664\u5185\u7f6etomcat\u5bb9\u5668&#xff0c;\u5bfc\u51fa\u6210war\u5305\u53ef\u4ee5\u8ba9\u5916\u90e8\u5bb9\u5668\u8fd0\u884cspring-boot\u9879\u76ee<\/h5>\n<p><span class=\"token comment\">&lt;!&#8211;\u6253\u5305\u4e0d\u53c2\u4e0e&#xff0c;\u4e5f\u5c31\u662f\u6253\u5305\u53bb\u6389tomcat&#8211;&gt;<\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>org.springframework.boot<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>spring-boot-starter-tomcat<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n            <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>scope<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>provided<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>scope<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<h5>5.1.5 \u8fdb\u884c\u6253\u5305<\/h5>\n<p>\u4e3a\u4ec0\u4e48\u6709\u64cd\u4f5c2. \u53c2\u8003There are test failures.\u3010\u975e\u5e38\u8be6\u7ec6&#xff0c;\u5df2\u89e3\u51b3\u3011 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103113-68076ff17f416.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u6253\u5305\u6210\u529f\u540e\u5982\u4e0b <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103113-68076ff1aa971.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>5.2 \u90e8\u7f72\u5230\u670d\u52a1\u5668Tomcat\u4e0a<\/h4>\n<h5>5.2.1 \u5c06War\u5305\u4e0a\u4f20\u5230\u5230Tomcat\u7684webapps\u76ee\u5f55\u4e0b<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103113-68076ff1ebb5f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h5>5.2.2 \u542f\u52a8tomcat<\/h5>\n<p>\u5207\u6362\u5230tomcat\u7684bin\u76ee\u5f55 \u8f93\u5165<\/p>\n<p><span class=\"token punctuation\">.<\/span>\/startup<span class=\"token punctuation\">.<\/span>sh<\/p>\n<p>\u542f\u52a8\u6210\u529f\u540e\u4f1a\u5728\u521a\u521a\u4e0a\u4f20\u7684war\u5305\u7684\u540c\u7ea7\u6587\u4ef6\u5939\u4e0b\u751f\u6210\u5b83\u53bb\u6389\u540e\u7f00\u7684\u6587\u4ef6&#xff0c;\u5982\u56fe <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103114-68076ff21de09.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u7136\u540e\u8bbf\u95ee<\/p>\n<p>http<span class=\"token operator\">:<\/span><span class=\"token operator\">\/<\/span><span class=\"token operator\">\/<\/span>\u4f60\u7684\u670d\u52a1\u5668ip<span class=\"token operator\">:<\/span><span class=\"token number\">8080<\/span><span class=\"token operator\">\/<\/span>\u4f60\u4e0a\u4f20\u7684war\u5305\u53bb\u6389<span class=\"token punctuation\">.<\/span>war\u540e\u7f00\u540e\u7684\u540d\u79f0<\/p>\n<p>\u80fd\u8bbf\u95ee\u5230\u5c31\u8bf4\u660e\u90e8\u7f72\u6210\u529f\u5566&#xff08;\u6ce8\u610f\u4fdd\u8bc1\u4f60\u6709\u4e00\u4e2a\u9ed8\u8ba4\u8bbf\u95ee\u9875\u9762&#xff09; \u6bd4\u5982\u6211\u7684\u662findex\u9875\u9762 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103114-68076ff242036.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf17\u6b21\u3002springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668_\u90e8\u7f72\u9879\u76ee\u5230tomcat<\/p>\n","protected":false},"author":2,"featured_media":31999,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,58,98,223,947,43,185],"topic":[],"class_list":["post-32016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-linux","tag-spring-boot","tag-tomcat","tag-websocket","tag-43","tag-185"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \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\/32016.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf17\u6b21\u3002springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668_\u90e8\u7f72\u9879\u76ee\u5230tomcat\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/32016.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-22T10:31:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103110-68076feed40e5.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32016.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/32016.html\",\"name\":\"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-22T10:31:15+00:00\",\"dateModified\":\"2025-04-22T10:31:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/32016.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/32016.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/32016.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668\"}]},{\"@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":"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \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\/32016.html","og_locale":"zh_CN","og_type":"article","og_title":"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.1k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf17\u6b21\u3002springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668_\u90e8\u7f72\u9879\u76ee\u5230tomcat","og_url":"https:\/\/www.wsisp.com\/helps\/32016.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-22T10:31:15+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250422103110-68076feed40e5.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/32016.html","url":"https:\/\/www.wsisp.com\/helps\/32016.html","name":"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-22T10:31:15+00:00","dateModified":"2025-04-22T10:31:15+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/32016.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/32016.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/32016.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"springboot\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u7684tomcat\u2014\u2014Linux\u4e0b\u5b89\u88c5jdk\u3001\u5b89\u88c5tomcat\u3001\u90e8\u7f72war\u5305\u5230\u670d\u52a1\u5668"}]},{"@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\/32016","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=32016"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/32016\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/31999"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=32016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=32016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=32016"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=32016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}