{"id":12290,"date":"2023-06-13T06:58:24","date_gmt":"2023-06-12T21:58:24","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=12290"},"modified":"2024-01-06T16:46:24","modified_gmt":"2024-01-06T07:46:24","slug":"tomcat-9%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88locky-linux-9%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/12290","title":{"rendered":"Tomcat 9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08Rocky Linux 9\uff09"},"content":{"rendered":"<p>Rocky Linux9\u306b\u3001Tomcat 9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u74b0\u5883\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>Tomcat 9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u74b0\u5883\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# hostnamectl\r\n Static hostname: vmsapp11.loc.lab4ict.com\r\n       Icon name: computer-vm\r\n         Chassis: vm\r\n      Machine ID: b562ef5fa24c465d81798fd3224943d6\r\n         Boot ID: fe715e2608724cbfa9e85850b3d3acfb\r\n  Virtualization: oracle\r\nOperating System: Rocky Linux 9.2 (Blue Onyx)       \r\n     CPE OS Name: cpe:\/o:rocky:rocky:9::baseos\r\n          Kernel: Linux 5.14.0-284.11.1.el9_2.x86_64\r\n    Architecture: x86-64\r\n Hardware Vendor: innotek GmbH\r\n  Hardware Model: VirtualBox\r\nFirmware Version: VirtualBox\r\n<\/pre>\n<h2>Java\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01<\/h2>\n<p>\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306b\u5f93\u3063\u3066\u3001Java\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12284\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"Java 17\uff08Open JDK\uff09\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08Rocky Linux 9\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2018\/06\/fia0000001-150x150.gif\" class=\"lazyload\"><\/div><div class=\"title\">Java 17\uff08Open JDK\uff09\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08Rocky Linux 9\uff09<\/div><div class=\"substr\">Rocky Linux9\u306b\u3001Java 17\uff08OpenJDK\uff09\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>Tomcat 9\u3092\u52d5\u4f5c\u3055\u305b\u308b\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u300ctomcat\u300d\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# useradd -m -d \/opt\/tomcat -U -s \/bin\/false tomcat\r\n<\/pre>\n<h2>Tomcat 9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\uff01<\/h2>\n<p>Tomcat 9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# wget https:\/\/dlcdn.apache.org\/tomcat\/tomcat-9\/v9.0.76\/bin\/apache-tomcat-9.0.76.tar.gz \r\n--2023-06-12 07:28:07--  https:\/\/dlcdn.apache.org\/tomcat\/tomcat-9\/v9.0.76\/bin\/apache-tomcat-9.0.76.tar.gz\r\nResolving dlcdn.apache.org (dlcdn.apache.org)... 151.101.2.132, 2a04:4e42::644\r\nConnecting to dlcdn.apache.org (dlcdn.apache.org)|151.101.2.132|:443... connected.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: 11677655 (11M) &#x5B;application\/x-gzip]\r\nSaving to: \u2018apache-tomcat-9.0.76.tar.gz\u2019\r\n\r\napache-tomcat-9.0.76.tar.gz   100%&#x5B;=================================================&gt;]  11.14M  10.9MB\/s    in 1.0s    \r\n\r\n2023-06-12 07:28:14 (10.9 MB\/s) - \u2018apache-tomcat-9.0.76.tar.gz\u2019 saved &#x5B;11677655\/11677655]\r\n<\/pre>\n<h2>\u30c0\u30a6\u30f3\u30c8\u30fc\u30ed\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01<\/h2>\n<p>Tomcat 9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n# tar xzf apache-tomcat-9.0.76.tar.gz \r\n# mv apache-tomcat-9.0.76\/* \/opt\/tomcat\/\r\n# chown -R tomcat:tomcat \/opt\/tomcat\/ \r\n<\/pre>\n<h2>SELinux\u306e\u30e2\u30fc\u30c9\u3092permissive\u306b\u5909\u66f4\u3059\u308b\uff01<\/h2>\n<p>SELinux\u306e\u30e2\u30fc\u30c9\u3092enforcing\u304b\u3089permissive\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n# vi \/etc\/selinux\/config\r\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nSELINUX=permissive\r\n<\/pre>\n<h2>firewalld\u3067\u901a\u4fe1\u8a31\u53ef\u8a2d\u5b9a\u3092\u884c\u3046\uff01<\/h2>\n<p>8080\u30dd\u30fc\u30c8\u306e\u901a\u4fe1\u8a31\u53ef\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3,5]; title: ; notranslate\" title=\"\">\r\n# firewall-cmd --permanent --add-port=8080\/tcp\r\nsuccess\r\n# sudo firewall-cmd --reload\r\nsuccess\r\n# firewall-cmd --list-ports\r\n8080\/tcp\r\n<\/pre>\n<h2>Systemd\u306b\u3088\u308b\u8d77\u52d5\u8a2d\u5b9a\u3092\u884c\u3046\uff01<\/h2>\n<p>Systemd\u3067\u5236\u5fa1\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vi \/etc\/systemd\/system\/tomcat.service\r\n<\/pre>\n<p>\u4ee5\u4e0b\u3001\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;Unit]\r\nDescription=Apache Tomcat Server\r\nAfter=network.target\r\n\r\n&#x5B;Service]\r\nType=forking\r\nUser=tomcat\r\nGroup=tomcat\r\n\r\nEnvironment=CATALINA_PID=\/opt\/tomcat\/temp\/tomcat.pid\r\nEnvironment=CATALINA_HOME=\/opt\/tomcat\r\nEnvironment=CATALINA_BASE=\/opt\/tomcat\r\n\r\nExecStart=\/opt\/tomcat\/bin\/startup.sh\r\nExecStop=\/opt\/tomcat\/bin\/shutdown.sh\r\n\r\nRestart=always\r\n\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>tomcat\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n# systemctl daemon-reload\r\n# systemctl enable --now tomcat.service\r\n# systemctl status tomcat\r\n\u25cf tomcat.service - Apache Tomcat Server\r\n     Loaded: loaded (\/etc\/systemd\/system\/tomcat.service; enabled; preset: disabled)\r\n     Active: active (running) since Tue 2023-06-13 06:41:03 JST; 1min 18s ago\r\n   Main PID: 751 (java)\r\n      Tasks: 30 (limit: 11008)\r\n     Memory: 119.9M\r\n        CPU: 3.290s\r\n     CGroup: \/system.slice\/tomcat.service\r\n             \u2514\u2500751 \/usr\/bin\/java -Djava.util.logging.config.file=\/opt\/tomcat\/conf\/logging.properties -Djava.util.loggin&gt;\r\n<\/pre>\n<h2>Tomcat\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\uff01<\/h2>\n<p>\u30d6\u30e9\u30a6\u30b6\u3084curl\u30b3\u30de\u30f3\u30c9\u3067\u3001Tomcat\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhttp:\/\/vmsapp11.loc.lab4ict.com:8080\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Rocky Linux 9\u306bTomcat\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002SELinux\u3001Firewalld\u306e\u8a2d\u5b9a\u3082\u5fd8\u308c\u305a\u306b\u884c\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/tomcat.apache.org\/\" rel=\"noopener\" target=\"_blank\">Tomcat Home - Apache Tomcat\uff08https:\/\/tomcat.apache.org\/\uff09<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rocky Linux9\u306b\u3001Tomcat 9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":14987,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[232],"tags":[430,427,472,473,470,471],"class_list":["post-12290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server-applications","tag-j2ee","tag-java","tag-locky-linux","tag-locky-linux-9","tag-tomcat","tag-tomcat-9"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=12290"}],"version-history":[{"count":17,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12290\/revisions"}],"predecessor-version":[{"id":15744,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12290\/revisions\/15744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/14987"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=12290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=12290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=12290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}