{"id":1673,"date":"2024-05-08T17:33:22","date_gmt":"2024-05-08T09:33:22","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1673"},"modified":"2024-05-08T17:33:22","modified_gmt":"2024-05-08T09:33:22","slug":"tomcat%e9%85%8d%e7%bd%ae%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1673","title":{"rendered":"tomcat\u914d\u7f6e\u76d1\u63a7"},"content":{"rendered":"<p>\u7b2c\u4e00\u90e8\u5206\u3001 \u9996\u5148$CATALINA_HOME\/webapps\u4e0b\u9700\u8981\u6709tomcat\u81ea\u5e26\u7684ROOT(\u6b22\u8fce\u9875\u9762)\u548cmanager(Tomcat\u7ba1\u7406\u9875\u9762)\u76ee\u5f55<\/p>\n<pre><code>tomcat8.0\u4e0a\uff0c\u76f4\u63a5\u4fee\u6539\u914d\u7f6e\u6587\u4ef6$CATALINA_HOME\/conf\/tomcat-users.xml\uff0c\u5728<tomcat-users>\u4e2d\u6dfb\u52a0\uff1a<\/code><\/pre>\n<p><role rolename=\"admin-gui\"\/><br \/>\n<user username=\"admin\" password=\"1234\" roles=\"manager-gui\"\/><\/p>\n<p>$CATALINA_HOME\/webapps\/manager\/META-INF\/context.xml\u6587\u4ef6\uff0c\u6ce8\u6389Valve\u90e8\u5206\uff0c\u8fd9\u4e2a\u662f\u9650\u5236\u8bbf\u95eeIP\u7684\uff1a<\/p>\n<p>\u540c\u65f6\u8fd8\u9700\u8981\u4fee\u6539\uff0c\u5982\u65e0\u65b0\u5efaconf\/Catalina\/localhost\/manager.xml \u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>&lt;Context privileged=&quot;true&quot; antiResourceLocking=&quot;false&quot;<br \/>\ndocBase=&quot;${catalina.home}\/webapps\/manager&quot;&gt;<\/p>\n<p><Valve className=\"org.apache.catalina.valves.RemoteAddrValve\" allow=\"^.*$\" \/><\/p>\n<p>\/Context&gt;<\/p>\n<hr \/>\n<p>\u8005\uff1aMaybebb <\/p>\n<p>\u6e90\uff1aCSDN <\/p>\n<p>\u6587\uff1a<a href=\"https:\/\/blog.csdn.net\/hy245120020\/article\/details\/78431594?utm_source=copy\">https:\/\/blog.csdn.net\/hy245120020\/article\/details\/78431594?utm_source=copy<\/a> <\/p>\n<p>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u535a\u6587\u94fe\u63a5\uff01<\/p>\n<p>\u7b2c\u4e8c\u90e8\u5206\uff0c\u4f7f\u7528probe\u9879\u76ee\u7ba1\u7406\u76d1\u63a7tomcat<br \/>\n\u7531\u4e8etomcat\u81ea\u5e26\u7684\u76d1\u63a7\u9875\u9762\u8f83\u4e3a\u7b80\u5355\uff0c\u53ef\u914d\u5408psi-probe\u9879\u76ee\u7ba1\u7406<br \/>\n1.\u4e0b\u8f7dprobe\u9879\u76ee\u70b9\u51fb\u6253\u5f00\u94fe\u63a5<\/p>\n<pre><code>2.\u6309\u7167github\u4e0a\u7684\u6253\u5305\u8bf4\u660e\u6253\u6210war\u5305\uff0c\u653e\u5230tomcat\u7684webapps\u4e0b\uff0c\u91cd\u542ftomcat\n\n3.\u6253\u5f00http:\/\/IP:PORT\/probe\/\uff0c\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u5373tomcat\u4e2d\u914d\u7f6e\u7684\u8d26\u53f7\u5bc6\u7801<\/code><\/pre>\n<h2>4.\u5177\u4f53\u7684\u76d1\u63a7\u4fe1\u606f\u89e3\u91ca\u53ef\u53c2\u770b\u70b9\u51fb\u6253\u5f00\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.csdn.net\/a19881029\/article\/details\/36662861\">https:\/\/blog.csdn.net\/a19881029\/article\/details\/36662861<\/a><\/h2>\n<p>\u7b2c\u4e09\u90e8\u901a\u8fc7jconsole \u8fde\u63a5\u914d\u7f6e\uff1a<\/p>\n<h1>\u8bbe\u7f6ejmx \u662f\u5426\u901a\u8fc7ssl \u8fde\u63a5<\/h1>\n<pre><code>JAVA_OPTS=\"$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false\"\n\n# \u8bbe\u7f6ermi \u8fdc\u7a0b\u8fde\u63a5ip \u5730\u5740\nJAVA_OPTS=\"$JAVA_OPTS -Djava.rmi.server.hostname=192.168.145.100\"\n\n# \u8bbe\u7f6ejmx \u8fdc\u7a0b\u8fde\u63a5\u7aef\u53e3\u53f7\nJAVA_OPTS=\"$JAVA_OPTS -Dcom.sun.management.jmxremote.port=8899\"\n\n# \u8bbe\u7f6ejmx \u8fdc\u7a0b\u8fde\u63a5\u662f\u5426\u9700\u8981\u7528\u6237\u8ba4\u8bc1,\u5373\u7528\u6237\u540d\u548c\u5bc6\u7801\nJAVA_OPTS=\"$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false\"<\/code><\/pre>\n<p>\u6216\u76f4\u63a5\u8bbe\u7f6e\uff1a<br \/>\nexport JAVA_OPTS=&quot;-server -XX:PermSize=1024M -XX:MaxPermSize2048M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1&quot;<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u90e8\u5206\u3001 \u9996\u5148$CATALINA_HOME\/webapps\u4e0b\u9700\u8981\u6709tomcat\u81ea\u5e26\u7684ROOT(\u6b22\u8fce\u9875\u9762)\u548cmanager(Tomcat\u7ba1\u7406\u9875\u9762)\u76ee\u5f55 tomcat8.0\u4e0a\uff0c\u76f4\u63a5\u4fee\u6539\u914d\u7f6e\u6587\u4ef6$CATALINA_HOME\/conf\/tomcat-users.xml\uff0c\u5728\u4e2d\u6dfb\u52a0\uff1a $CATALINA_HOME\/webapps\/manager\/META-INF\/context.xml\u6587\u4ef6\uff0c\u6ce8\u6389Valve\u90e8\u5206\uff0c\u8fd9\u4e2a\u662f\u9650\u5236\u8bbf\u95eeIP\u7684\uff1a \u540c\u65f6\u8fd8\u9700\u8981\u4fee\u6539\uff0c\u5982\u65e0\u65b0\u5efaconf\/Catalina\/localhost\/manager.xml \u5185\u5bb9\u5982\u4e0b\uff1a &lt;Context privileged=&quot;true&quot; antiResourceLocking=&quot;false&quot; docBase=&quot;${catalina.home}\/webapps\/manager&quot;&gt; \/Context&gt; \u8005\uff1aMaybebb \u6e90\uff1aCSDN \u6587\uff1ahttps:\/\/blog.csdn.net\/hy245120020\/article\/details\/78431594?utm_source=copy \u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u535a\u6587\u94fe\u63a5\uff01 \u7b2c\u4e8c\u90e8\u5206\uff0c\u4f7f\u7528probe\u9879\u76ee\u7ba1\u7406\u76d1\u63a7tomcat \u7531\u4e8etomcat\u81ea\u5e26\u7684\u76d1\u63a7\u9875\u9762\u8f83\u4e3a\u7b80\u5355\uff0c\u53ef\u914d\u5408psi-probe\u9879\u76ee\u7ba1\u7406 1.\u4e0b\u8f7dprobe\u9879\u76ee\u70b9\u51fb\u6253\u5f00\u94fe\u63a5 2.\u6309\u7167github\u4e0a\u7684\u6253\u5305\u8bf4\u660e\u6253\u6210war\u5305\uff0c\u653e\u5230tomcat\u7684webapps\u4e0b\uff0c\u91cd\u542ftomcat 3.\u6253\u5f00http:\/\/IP:PORT\/probe\/\uff0c\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u5373tomcat\u4e2d\u914d\u7f6e\u7684\u8d26\u53f7\u5bc6\u7801 4.\u5177\u4f53\u7684\u76d1\u63a7\u4fe1\u606f\u89e3\u91ca\u53ef\u53c2\u770b\u70b9\u51fb\u6253\u5f00\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/a19881029\/article\/details\/36662861 \u7b2c\u4e09\u90e8\u901a\u8fc7jconsole \u8fde\u63a5\u914d\u7f6e\uff1a \u8bbe\u7f6ejmx \u662f\u5426\u901a\u8fc7ssl \u8fde\u63a5 JAVA_OPTS=&#8221;$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false&#8221; # \u8bbe\u7f6ermi \u8fdc\u7a0b\u8fde\u63a5ip \u5730\u5740 JAVA_OPTS=&#8221;$JAVA_OPTS -Djava.rmi.server.hostname=192.168.145.100&#8243; # \u8bbe\u7f6ejmx \u8fdc\u7a0b\u8fde\u63a5\u7aef\u53e3\u53f7 JAVA_OPTS=&#8221;$JAVA_OPTS -Dcom.sun.management.jmxremote.port=8899&#8243; # \u8bbe\u7f6ejmx \u8fdc\u7a0b\u8fde\u63a5\u662f\u5426\u9700\u8981\u7528\u6237\u8ba4\u8bc1,\u5373\u7528\u6237\u540d\u548c\u5bc6\u7801 JAVA_OPTS=&#8221;$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false&#8221; \u6216\u76f4\u63a5\u8bbe\u7f6e\uff1a export JAVA_OPTS=&quot;-server -XX:PermSize=1024M -XX:MaxPermSize2048M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1&quot;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[94,101,80],"tags":[],"class_list":["post-1673","post","type-post","status-publish","format-standard","hentry","category-tomcat","category-101","category-80"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1673"}],"version-history":[{"count":1,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1673\/revisions"}],"predecessor-version":[{"id":1674,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1673\/revisions\/1674"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}