{"id":110532,"date":"2024-11-25T07:15:08","date_gmt":"2024-11-24T23:15:08","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=110532"},"modified":"2024-11-25T07:15:08","modified_gmt":"2024-11-24T23:15:08","slug":"linux-install-tomcat9","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-install-tomcat9.html","title":{"rendered":"\u4e00\u8d77\u6765\u642d\u5efaCentOS-Tomcat9\u73af\u5883"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nTomcat\u662fApache \u8f6f\u4ef6\u57fa\u91d1\u4f1a\uff08Apache Software Foundation\uff09\u7684Jakarta \u9879\u76ee\u4e2d\u7684\u4e00\u4e2a\u6838\u5fc3\u9879\u76ee\uff0c\u7531Apache\u3001Sun \u548c\u5176\u4ed6\u4e00\u4e9b\u516c\u53f8\u53ca\u4e2a\u4eba\u5171\u540c\u5f00\u53d1\u800c\u6210\u3002\u7531\u4e8e\u6709\u4e86Sun \u7684\u53c2\u4e0e\u548c\u652f\u6301\uff0c\u6700\u65b0\u7684Servlet \u548cJSP \u89c4\u8303\u603b\u662f\u80fd\u5728Tomcat \u4e2d\u5f97\u5230\u4f53\u73b0\uff0cTomcat 5\u652f\u6301\u6700\u65b0\u7684Servlet 2.4 \u548cJSP 2.0 \u89c4\u8303\u3002\u56e0\u4e3aTomcat \u6280\u672f\u5148\u8fdb\u3001\u6027\u80fd\u7a33\u5b9a\uff0c\u800c\u4e14\u514d\u8d39\uff0c\u56e0\u800c\u6df1\u53d7Java \u7231\u597d\u8005\u7684\u559c\u7231\u5e76\u5f97\u5230\u4e86\u90e8\u5206\u8f6f\u4ef6\u5f00\u53d1\u5546\u7684\u8ba4\u53ef\uff0c\u6210\u4e3a\u76ee\u524d\u6bd4\u8f83\u6d41\u884c\u7684Web \u5e94\u7528\u670d\u52a1\u5668\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u672c\u6587\u8bb2\u89e3\u5728Linux CentOS\u4e0b\u5b89\u88c5Tomcat9,\u4ee5\u53caWeb\u9879\u76ee\u7684\u90e8\u7f72\u53d1\u5e03\u3002<\/p>\n

\u73af\u5883\uff1a\u963f\u91cc\u4e91ECS \u4e91\u670d\u52a1\u5668Linux CentOS<\/p>\n

\u4f7f\u7528XShell\u5ba2\u6237\u7aef\u8fde\u63a5\u670d\u52a1\u5668\uff0c\u8fdb\u884c\u64cd\u4f5c\u5b9e\u8df5\u3002<\/p>\n

1\u3001\u4e0b\u8f7dTomcat<\/strong><\/div>\n

\u90e8\u7f72\u5230 \/usr\/local\/tomcat\uff0c\u521b\u5efa\u597d\u6587\u4ef6\u5939\u3001\u76ee\u5f55\u3002<\/p>\n

\u4f7f\u7528wget\u6307\u4ee4\uff1a<\/p>\n

wget http:\/\/mirrors.shu.edu.cn\/apache\/tomcat\/tomcat-9\/v9.0.10\/bin\/apache-tomcat-9.0.10.tar.gz<\/pre>\n

\u7ed3\u679c\u5982\u4e0b\uff0c\u6210\u529f\u4e0b\u8f7d\u4e86apache-tomcat-9.0.10.tar.gz<\/p>\n

\"\"<\/p>\n

2\u3001\u89e3\u538b\u7f29
\n<\/strong><\/div>\n
tar -zxvf apache-tomcat-9.0.10.tar.gz\r\n<\/pre>\n

\u81ea\u52a8\u89e3\u538b
\n\"\"<\/p>\n

3\u3001\u542f\u52a8tomcat<\/strong><\/div>\n

\u8fdb\u5165tomcat\u4e0b\u7684bin\u76ee\u5f55<\/p>\n

[root@izuf6famz0x92jd98na1kiz bin]# .\/catalina.sh start\r\n<\/pre>\n

\"\"<\/p>\n

\u53d1\u73b0 tomcat started<\/p>\n

4\u3001\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee<\/strong><\/div>\n

\u7ecf\u641c\u7d22\u67e5\u8be2\uff0c\u53ef\u80fd\u662f \u963f\u91cc\u4e91\u670d\u52a1\u5668\uff0c\u5bf9\u5b89\u5168\u6027\u7684\u8981\u6c42\uff0c\u4f7f\u5f97\uff0c\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee\uff1a<\/p>\n

\"\"<\/p>\n

\u89e3\u51b3\u65b9\u5f0f\uff1a<\/p>\n

(1)\u8fdb\u5165\u963f\u91cc\u4e91\u4e3b\u673a\u63a7\u5236\u53f0\uff0c\u5b89\u5168\u7ec4\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u70b9\u51fb\u914d\u7f6e\u89c4\u5219<\/p>\n

\"\"<\/p>\n

\"\"<\/p>\n

(2)\u914d\u7f6e\u89c4\u5219\uff0c\u6dfb\u52a0\u89c4\u5219\u5141\u8bb8\u4efb\u4f55IP\u8bbf\u95ee8080<\/p>\n

\"\"<\/p>\n

\"\"<\/p>\n

(3)\u518d\u6b21\u8bbf\u95ee\uff0c\u5c31\u6210\u529f\u4e86
\n\"\"<\/p>\n

\u6210\u529f\u5b8c\u6210 tomcat \u670d\u52a1\u5668\u7684\u4e0b\u8f7d\u548c\u5b89\u88c5!<\/p>\n

[\u8fd9\u6837\uff0c\u76f4\u63a5\u8fdb\u5165 apache-tomcat \u6587\u4ef6\u5939\u4e0b\u7684 bin \u76ee\u5f55\u4e2d\uff0c\u8fd0\u884c\u8d77\u6765tomcat\uff0c\u4f1a\u6709\u4e00\u4e2a\u95ee\u9898\uff1a\u4e00\u65e6\u91cd\u65b0\u542f\u52a8 reboot \u670d\u52a1\u5668\uff0ctomcat\u4e5f\u5173\u95ed\u4e86\u3002]<\/p>\n

5\u3001Tomcat\u914d\u7f6e\u670d\u52a1\u548c\u81ea\u542f\u52a8(\u53ef\u9009\uff0c\u53ef\u4ee5\u4e0d\u8bbe\u7f6e)<\/strong><\/div>\n

\u628atomcat\u52a0\u5165\u670d\u52a1\u5f53\u4e2d\uff0c\u5230tomcat\u7684bin\u76ee\u5f55\u4e2d\u628acatalina.sh\u590d\u5236\u5230\/etc\/init.d\u91cc\u5e76\u547d\u540d\u4e3atomcat<\/p>\n

[root@izuf6famz0x92jd98na1kiz \/]# cp \/usr\/local\/tomcat\/apache-tomcat-9.0.10\/bin\/catalina.sh \/etc\/init.d\/tomcat\r\n\r\nshell~#cp \/usr\/local\/apache-tomcat\/bin\/catalina.sh \/etc\/init.d\/tomcat\r\n\r\n\u7f16\u8f91\u6b64\u6587\u4ef6\r\n\r\n[root@izuf6famz0x92jd98na1kiz \/]# cd \/etc\/init.d\r\n[root@izuf6famz0x92jd98na1kiz init.d]# ls\r\naegis  agentwatch  functions  netconsole  network  README  tomcat\r\n[root@izuf6famz0x92jd98na1kiz init.d]# vi tomcat\r\n\r\nshell~#vi tomcat\r\n\r\n\u5728#!\/bin\/sh\u4e0b\u52a0\u5165\r\n\r\n### BEGIN INIT INFO\r\n# Provides: tomcat\r\n# Required-Start: $remote_fs $network\r\n# Required-Stop: $remote_fs $network\r\n# Default-Start: 2 3 4 5\r\n# Default-Stop: 0 1 6\r\n# Short-Description: The tomcat Java Application Server\r\n### END INIT INFO\r\n\r\n\u5728\u5206\u5272\u7ebf\u4e0b\u52a0\u5165\u73af\u5883\u53d8\u91cf\r\n\r\nJAVA_HOME=\/usr\/java\/jdk1.7.0_07\r\nexport JAVA_HOME\r\nPATH=$JAVA_HOME\/bin:$PATH\r\nexport PATH\r\nCATALINA_HOME=\/usr\/local\/apache-tomcat\r\n\r\n\u7ed9\u8fd9\u4e2a\u811a\u672c\u4e0e\u6743\u9650\r\n\r\nshell\uff5e#chmod 755 tomcat\r\n\r\n\u6dfb\u52a0tomcat\u670d\u52a1\u8fd9\u91cc\u7528chkconfig\r\n\r\nshell\uff5e#chkconfig --add tomcat\r\n\r\n\u5982\u679c\u8fd9\u91cc\u51fa\u73b0\u63d0\u793a\r\n\r\ninsserv: warning: script 'tomcat' missing LSB tags and overrides\r\ninsserv: There is a loop between service nginx and tomcat if stopped\r\ninsserv: loop involving service tomcat at depth 2\r\ninsserv: loop involving service nginx at depth 1\r\ninsserv: Stopping tomcat depends on nginx and therefore on system facility `$all' which can not be true!\r\ninsserv: exiting now without changing boot order!\r\n\r\n\u5219\u9700\u8981\u5b89\u88c5chkconfig\u5b89\u88c5\u65b9\u6cd5\r\n\r\nshell\uff5e#apt-get install chkconfig\r\n\r\n\u5c31\u53ef\u4ee5\u5982\u51fa\u73b0\u4ee5\u4e0b\u8868\u793a\u6210\u529f\r\n\r\ntomcat                    0:off  1:off  2:on   3:on   4:on   5:on   6:off\r\n\r\n\u4e5f\u53ef\u4ee5\u5728\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u4e00\u4e0b\r\n\r\nshell\uff5e#chkconfig --list tomcat\r\n\r\ntomcat                    0:off  1:off  2:on   3:on   4:on   5:on   6:off\r\n\r\n\u5982\u679c345 \u4e3a\u5173\u95ed\u72b6\u6001\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u8bbe\u7f6etomcat\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\u3002\r\n\r\n shell\uff5e# chkconfig tomcat on \r\n\r\n\u542f\u52a8\u4e00\u4e0b\u770b\u770b\r\n\r\nshell\uff5e# service tomcat start\r\nUsing CATALINA_BASE: \/usr\/local\/apache-tomcat\r\nUsing CATALINA_HOME: \/usr\/local\/apache-tomcat\r\nUsing CATALINA_TMPDIR: \/usr\/local\/apache-tomcat\/temp\r\nUsing JRE_HOME: \/usr\/java\/jdk1.7.0_07\r\nUsing CLASSPATH: \/usr\/local\/apache-tomcat\/bin\/bootstrap.jar:\/usr\/local\/apache-tomcat\/bin\/tomcat-juli.jar\r\n\r\n\u542f\u52a8\uff0c\u505c\u6b62\uff0c\u91cd\u542f\r\n\r\nshell\uff5e# service tomcat start\r\n\r\nshell\uff5e# service tomcat stop\r\n\r\nshell\uff5e# service tomcat restart\r\n<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.cnblogs.com\/moonsoft\/p\/9264883.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/linux-install-tomcat9.html<\/a>\u7f16\u8f91\uff1a\u51af\u745e\u6d9b\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb Tomcat\u662fApache \u8f6f\u4ef6\u57fa\u91d1\u4f1a\uff08Apache Software Foundation\uff09\u7684Jaka […]<\/p>\n","protected":false},"author":1329,"featured_media":110544,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-110532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/110532","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\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=110532"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/110532\/revisions"}],"predecessor-version":[{"id":110616,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/110532\/revisions\/110616"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/110544"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=110532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=110532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=110532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}