{"id":291143,"date":"2024-04-28T05:16:31","date_gmt":"2024-04-27T21:16:31","guid":{"rendered":"https:\/\/lrxjmw.cn\/lxrhzqqdtzhg.html"},"modified":"2024-04-28T05:16:31","modified_gmt":"2024-04-27T21:16:31","slug":"lxrhzqqdtzhg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxrhzqqdtzhg.html","title":{"rendered":"Linux\u4e0b\u5982\u4f55\u6b63\u786e\u542f\u52a8\u3001\u505c\u6b62\u548c\u7ba1\u7406Tomcat\u670d\u52a1\u5668\uff1a\u5168\u9762\u89e3\u6790\u4e0e\u4f18\u5316\u6307\u5357"},"content":{"rendered":"
\u5728Linux<\/a>\u64cd\u4f5c\u7cfb\u7edf<\/a>\u4e2d\uff0c\u638c\u63e1Tomcat\u670d\u52a1\u5668\u7684\u6b63\u786e\u542f\u52a8\u3001\u505c\u6b62\u548c\u7ba1\u7406\u6280\u5de7\u5bf9\u4e8e\u5f00\u53d1\u8005\u548c\u7cfb\u7edf\u7ba1\u7406\u8005\u6765\u8bf4\u5177\u6709\u5173\u952e\u610f\u4e49\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u6df1\u5165\u63a2\u8ba8\u5982\u4f55\u8fd0\u7528Linux\u547d\u4ee4<\/a>\u5b8c\u6210Tomcat\u670d\u52a1\u7684\u7cbe\u786e\u542f\u52a8\uff0c\u540c\u65f6\u89e3\u6790\u914d\u7f6e\u8c03\u6574\u3001\u6027\u80fd\u4f18\u5316\u4ee5\u53ca\u6545\u969c\u6392\u9664\u7b49\u5173\u952e\u6b65\u9aa4\uff0c\u81f4\u529b\u4e8e\u4e3a\u60a8\u63d0\u4f9b\u66f4\u9ad8\u6548\u4f18\u79c0\u7684Tomcat\u542f\u505c\u4e0e\u7ba1\u7406\u7b56\u7565\u3002<\/p>\n 1.\u51c6\u5907\u5de5\u4f5c<\/b><\/p>\n \u4e3a\u4e86\u9ad8\u6548\u7ba1\u7406\u548c\u90e8\u7f72ApacheTomcat\u670d\u52a1\u5668\uff0c\u9996\u5148\u5fc5\u987b\u4fdd\u8bc1\u80fd\u591f\u6210\u529f\u5730\u5b89\u88c5\u53ca\u914d\u7f6eJava\u8fd0\u884c\u73af\u5883\u3002\u968f\u540e\uff0c\u4ece\u53ef\u4fe1\u6e20\u9053\u83b7\u53d6\u5e76\u5c06ApacheTomcat\u8f6f\u4ef6\u89e3\u538b\u7f29\u5230\u5408\u9002\u7684\u4f4d\u7f6e\u3002\u5728\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u4e4b\u540e\uff0c\u4fbf\u53ef\u5f00\u59cb\u5bf9Tomcat\u8fdb\u884c\u8be6\u7ec6\u7684\u914d\u7f6e\uff0c\u6700\u540e\u542f\u52a8\u670d\u52a1\u5668\u4ee5\u5b9e\u73b0\u5176\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n \u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cJava\u5e94\u7528\u7a0b\u5e8f\u5b9c\u5b58\u4e8e\u6807\u51c6\u7cfb\u7edf\u8def\u5f84\u5982'\/usr\/lib\/jvm\/'\u4e2d\u3002\u81f3\u4e8eTomcat\uff0c\u63a8\u8350\u4f7f\u7528\u7279\u6b8a\u8def\u5f84\u5982'\/opt\/'\u4f5c\u4e3a\u5b89\u88c5\u8def\u5f84\u3002\u5b8c\u6210\u57fa\u7840\u8bbe\u7f6e\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fdb\u5165Tomcat\u7684\u6839\u76ee\u5f55\uff0c\u5e76\u8fdb\u884c\u5404\u9879\u5fc5\u8981\u7684\u914d\u7f6e\u53ca\u73af\u5883\u53d8\u91cf\u5b9a\u5236\u3002<\/p>\n 2.\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/b><\/p>\n <\/p>\n \u4e3a\u4f7fTomcat\u5f97\u5230\u6709\u6548\u4e14\u4fbf\u5229\u7684\u7ba1\u63a7\u548c\u7ef4\u4fdd\uff0c\u5efa\u8bae\u8bbe\u5b9a\u76f8\u5e94\u7684\u73af\u5883\u53d8\u91cf\u6765\u4f18\u5316\u5bf9\u6307\u4ee4\u53ca\u914d\u7f6e\u6587\u6863\u7684\u8bbf\u95ee\u3002\u6309\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a\u9996\u5148\uff0c\u5728\u7528\u6237\u4e2a\u4eba\u7684`~\/.bashrc`\u6587\u4ef6\u6216\u662f\u7cfb\u7edf\u7ea7\u522b\u7684`\/etc\/profile`\u7a0b\u5e8f\u5185\u5199\u5165\u76f8\u5173\u8bbe\u5b9a\u4ee3\u7801\u3002<\/p>\n \n \u6b64\u4e3e\u53ef\u76f4\u63a5\u4e8e\u547d\u4ee4\u884c\u4e2d\u64cd\u4f5c\uff0c\u5305\u62ec\u6267\u884c\u542f\u52a8\u74f6\u9888\u811a\u672c`startup.sh`\u53ca\u5173\u95edTomcat\u7684`shutdown.sh`\u6307\u4ee4\uff0c\u4ece\u800c\u514d\u9664\u4e86\u539f\u672c\u590d\u6742\u7684\u6587\u4ef6\u8def\u5f84\u8f6c\u6362\u4e0e\u5b9a\u4f4d\u6b65\u9aa4\u3002<\/p>\n <\/p>\n 3.\u542f\u52a8Tomcat<\/b><\/p>\n \u900f\u8fc7Tomcat\u5185\u7f6e\u7684\u542f\u52a8\u811a\u672c\u6587\u4ef6\uff08`.\/startup.sh`\uff09\uff0c\u7528\u6237\u80fd\u4fbf\u6377\u5730\u542f\u52a8Tomcat\u670d\u52a1\u5668\u3002\u4ec5\u9700\u5728\u64cd\u4f5c\u7cfb\u7edf\u7684\u7ec8\u7aef\u4e2d\u8f93\u5165\u76f8\u5e94\u6307\u4ee4linux \u542f\u52a8tomcat<\/strong>\uff0c\u5373\u53ef\u987a\u5229\u5b9e\u73b0\u6b64\u76ee\u7684\u3002<\/p>\n startup.sh<\/p>\n <\/p>\n \u5f53\u670d\u52a1\u5668\u5b8c\u6210\u542f\u52a8\u540e\uff0c\u8bf7\u5728\u7f51\u9875\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u5730\u5740`:8080`\u4ee5\u9a8c\u8bc1Tomcat\u7684\u6b63\u5e38\u8fd0\u4f5c\u3002\u5982\u65e0\u5f02\u5e38linux\u67e5\u770b\u786c\u4ef6\u4fe1\u606f\uff0c\u60a8\u5e94\u80fd\u8bbf\u95ee\u5230Tomcat\u7684\u5f15\u5bfc\u754c\u9762\u3002<\/p>\n 4.Tomcat\u914d\u7f6e<\/b><\/p>\n \u4f4d\u4e8e$CATALINA_HOME\/conf\/\u5b50\u8def\u5f84\u4e2d\u7684\u91cd\u8981\u8bbe\u7f6e\u6587\u4ef6server.xml\u548cweb.xml\uff0c\u662f\u7cbe\u786e\u8c03\u63a7\u5e76\u4f18\u5316Tomcat\u8fd0\u884c\u6027\u80fd\u7684\u5173\u952e\u6240\u5728\u3002<\/p>\n \u5bf9\u4e8eTomcat\u670d\u52a1\u5668\u7684\u91cd\u8981\u914d\u7f6e\uff0c\u5982\u76d1\u542c\u7aef\u53e3\u3001\u865a\u62df\u4e3b\u673a\u3001\u7ebf\u7a0b\u6c60\u7b49\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539`server.xml`\u8fdb\u884c\u8c03\u6574\uff1b\u800c\u5bf9Web\u7684\u6df1\u5ea6\u8bbe\u7f6e\uff0c\u5305\u62ec\u5404\u7c7b\u914d\u7f6e\u53c2\u6570\u3001\u8fc7\u6ee4\u5668\u8bbe\u7f6e\u548c\u76d1\u542c\u5668\u914d\u7f6e\uff0c\u90fd\u5e94\u5728`web.xml`\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u52a0\u4ee5\u660e\u786e\u3002\u901a\u8fc7\u7cbe\u7ec6\u5316\u8fd9\u4e9b\u914d\u7f6e\uff0c\u80fd\u6709\u6548\u63d0\u9ad8Tomcat\u7684\u8fd0\u884c\u6548\u7387\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n 5.\u6545\u969c\u6392\u9664<\/b><\/p>\n \u5728\u8fd0\u7528Tomcat\u4f5c\u4e3a\u670d\u52a1\u5e73\u53f0\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5e38\u89c1\u7684\u95ee\u9898\u5305\u62ec\u670d\u52a1\u5668\u542f\u52a8\u5931\u8d25\u3001\u7f51\u7edc\u8fde\u63a5\u4e2d\u65ad\u4ee5\u53ca\u8fd0\u884c\u6548\u7387\u964d\u4f4e\u7b49\uff0c\u8fd9\u4e9b\u90fd\u9700\u8981\u8fdb\u884c\u7cbe\u51c6\u6709\u6548\u7684\u89e3\u51b3\u3002<\/p>\n <\/p>\n \u5e38\u89c4\u68c0\u6d4b\u624b\u6bb5\u5305\u62ec\u5256\u6790Tomcat\u8fd0\u884c\u671f\u95f4\u4ea7\u751f\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u89c2\u5bdf\u7cfb\u7edf\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u53ca\u53d1\u73b0\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u7b49\u3002\u6df1\u5165\u6316\u6398\u65e5\u5fd7\u6570\u636e\u53ef\u8fc5\u901f\u51c6\u786e\u5730\u5b9a\u4f4d\u5e76\u89e3\u51b3Tomcat\u53ef\u80fd\u5b58\u5728\u7684\u95ee\u9898\uff0c\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n 6.\u6027\u80fd\u4f18\u5316<\/b><\/p>\n \u4e3a\u63d0\u9ad8Tomcat\u7684\u6027\u80fd\u548c\u541e\u5410\u91cflinux\u67e5\u770b\u786c\u4ef6\u4fe1\u606f\uff0c\u6709\u5fc5\u8981\u5b9e\u65bd\u591a\u79cd\u4f18\u5316\u7b56\u7565\u3002\u8fd9\u5176\u4e2d\u5305\u62ec\u7cbe\u786e\u8c03\u6574JVM\u53c2\u6570\uff0c\u4e25\u8c28\u8c03\u4f18\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u4ee5\u53ca\u91c7\u7528\u5e94\u7528CDN\u52a0\u901f\u670d\u52a1\u3002\u901a\u8fc7\u7cbe\u786e\u7684\u914d\u7f6e\u53ca\u8c03\u8bd5\uff0c\u53ef\u4ee5\u5728\u9ad8\u538b\u529b\u73af\u5883\u4e0b\u786e\u4fddTomcat\u7684\u7a33\u5b9a\u6027\uff0c\u5e76\u5145\u5206\u53d1\u6325\u5176\u6f5c\u5728\u80fd\u529b\u3002<\/p>\n 7.\u5b89\u5168\u52a0\u56fa<\/b><\/p>\n \u5728\u6d41\u7a0b\u6539\u8fdb\u9636\u6bb5\uff0c\u6211\u4eec\u9700\u8981\u6267\u884c\u91cd\u8981\u4efb\u52a1linux \u542f\u52a8tomcat<\/strong>\uff0c\u5305\u62ecTomcat\u7684\u5347\u7ea7\u4ee5\u53ca\u4e0e\u9632\u706b\u5899\u7684\u7d27\u5bc6\u914d\u5408\uff0c\u4ece\u800c\u786e\u4fdd\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u5f97\u5230\u5145\u5206\u4fdd\u969c\u3002\u7279\u522b\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5fc5\u987b\u505c\u6b62\u6240\u6709\u65e0\u9700\u7684\u670d\u52a1\uff0c\u4ee5\u6b64\u6700\u5c0f\u5316\u8bef\u4f24\u98ce\u9669\uff0c\u4f7f\u670d\u52a1\u5668\u6301\u7eed\u4fdd\u6301\u5e73\u7a33\u8fd0\u884c\uff0c\u8fdb\u800c\u4f7f\u5f97\u5ba2\u6237\u7aef\u5e94\u7528\u5f97\u4ee5\u5b89\u7136\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u638c\u63e1Tomcat\u670d\u52a1\u5668\u7684\u6b63\u786e\u542f\u52a8\u3001\u505c\u6b62\u548c\u7ba1\u7406\u6280\u5de7\u5bf9\u4e8e\u5f00\u53d1\u8005\u548c\u7cfb\u7edf\u7ba1\u7406\u8005\u6765\u8bf4\u5177\u6709\u5173\u952e\u610f\u4e49\u3002\u5728\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u4e4b\u540e\uff0c\u4fbf\u53ef\u5f00\u59cb\u5bf9Tomcat\u8fdb\u884c\u8be6\u7ec6\u7684\u914d\u7f6e\uff0c\u6700\u540e\u542f\u52a8\u670d\u52a1\u5668\u4ee5\u5b9e\u73b0\u5176\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n","protected":false},"author":1,"featured_media":291144,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-291143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=291143"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291143\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/291144"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=291143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=291143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=291143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}bash\n\u5c06CATALINA_HOME\u8bbe\u7f6e\u4e3a\u7edd\u5bf9\u8def\u5f84\uff0c\u5373\/opt\/tomcat\u3002\n\u5c06\u7cfb\u7edf\u53d8\u91cf%PATH%\u4e2d\u7684\u5185\u5bb9\u8ffd\u52a0\u4e3a%CATALINA_HOME%bin\u3002\n<\/pre>\n<\/p>\n