{"id":136,"date":"2020-11-28T09:08:25","date_gmt":"2020-11-28T09:08:25","guid":{"rendered":"https:\/\/www.aran.cat\/wp\/?p=136"},"modified":"2020-11-28T16:40:08","modified_gmt":"2020-11-28T16:40:08","slug":"crear-cluster-amb-tomcat-amb-apache-mod_proxy-com-a-load-balancer","status":"publish","type":"post","link":"https:\/\/www.aran.cat\/wp\/?p=136","title":{"rendered":"Crear Cl\u00faster amb tomcat amb apache mod_proxy com a load balancer."},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Comen\u00e7arem pel final: Optimitzaci\u00f3 del Tomcat : <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Copiant la info de : <a href=\"https:\/\/rimuhosting.com\/knowledgebase\/linux\/java\/libtcnative\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/rimuhosting.com\/knowledgebase\/linux\/java\/libtcnative<\/a> <\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><a href=\"https:\/\/rimuhosting.com\/index.jsp\">Home<\/a> &gt; <a href=\"https:\/\/rimuhosting.com\/support\/sindex.jsp\">Support<\/a> &gt; <a href=\"https:\/\/rimuhosting.com\/support\/howtolist.jsp\">HOWTO List<\/a> &gt; libtcnative install <\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>In most cases we recomend using the <a href=\"http:\/\/rimuhosting.com\/mod_jk2_and_mod_proxy_ajp.jsp\">mod_proxy \/apache<\/a> combination as a frontend to tomcat. However for those looking to squeeze extra performance out of a bare tomcat installation the following may be useful<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Apache Portable Runtime (APR) and Tomcat<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Per <a href=\"http:\/\/apr.apache.org\/\">http:\/\/apr.apache.org\/<\/a> Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies.<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Installing the JNI wrappers for APR used by Tomcat (libtcnative)<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>You can now grab the latest tcnative wrapper from <a href=\"http:\/\/tomcat.apache.org\/native-doc\/\">http:\/\/tomcat.apache.org\/native-doc\/<\/a> and drop that into the tomcat libs folder (eg \/usr\/local\/tomcat\/libs).<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>We recommend you use the package install methods shown on the above link to obtain the libraries noted. Those should be available using either yum or apt-get depending on your installed distribution.<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>You should be able to just grab the jar file and drop that into the tomcat libs folder (check in case it is already present).<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Remeber to restart tomcat to make that load the updated\/new libraries. And check in the tomcat logs to confirm they have been imported correctly.<\/p><\/blockquote>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">I seguim: <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"> Segons:  <a rel=\"noreferrer noopener\" href=\"https:\/\/tomcat.apache.org\/tomcat-10.0-doc\/config\/http.html\" target=\"_blank\">https:\/\/tomcat.apache.org\/tomcat-10.0-doc\/config\/http.html<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cal utilitzar el connector? : Java Nio2 Connector NIO2<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Instal\u00b7laci\u00f3 b\u00e0sica del tomcat a debian:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Instal\u00b7larem nom\u00e9s el paquets tomcat9 necessaris&#8230; <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>apt-get install tomcat9 tomcat9-admin tomcat9-docs tomcat9-examples<br>apt-get install libtcnative-1<br>apt-get install ca-certificates-java<br>apt-get install libapr1 libaprutil1 libaprutil1-dbd-mysql libaprutil1-dbd-odbc libaprutil1-dbd-pgsql libaprutil1-dbd-sqlite3 libaprutil1-ldap libwinpr2-2<br>cd \/usr\/lib<br>ln -s \/usr\/lib\/x86_64-linux-gnu\/libtcnative-1.so<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Nota recordatoria; De la documentaci\u00f3 de Tomcat: <\/h6>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>CATALINA_HOME and CATALINA_BASE<\/p><p>Throughout the documentation, there are references to the two following properties:<\/p><p><strong>CATALINA_HOME<\/strong>: Represents the root of your Tomcat installation, for example <code>\/home\/tomcat\/apache-tomcat-9.0.10<\/code> or <code>C:\\Program Files\\apache-tomcat-9.0.10<\/code>.<\/p><p><strong>CATALINA_BASE<\/strong>: Represents the root of a runtime configuration of a specific Tomcat instance. If you want to have multiple Tomcat instances on one machine, use the <code>CATALINA_BASE<\/code> property.<\/p><p>If you set the properties to different locations, the CATALINA_HOME location contains static sources, such as <code>.jar<\/code> files, or binary files. The CATALINA_BASE location contains configuration files, log files, deployed applications, and other runtime requirements.<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">En el cas de Debian:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CATALINA_HOME<\/strong>:  \/usr\/share\/tomcatX<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CATALINA_BASE<\/strong>:  \/var\/lib\/tomcatX<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comen\u00e7arem pel final: Optimitzaci\u00f3 del Tomcat : Copiant la info de : https:\/\/rimuhosting.com\/knowledgebase\/linux\/java\/libtcnative Home &gt; Support &gt; HOWTO List &gt; libtcnative install In most cases we recomend using the mod_proxy \/apache combination as a frontend to tomcat. However for those looking to squeeze extra performance out of a bare tomcat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,4,9],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-apache","category-programari-lliure","category-tomcat"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":9,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions\/157"}],"wp:attachment":[{"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aran.cat\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}