{"id":386,"date":"2016-03-25T16:33:11","date_gmt":"2016-03-25T13:33:11","guid":{"rendered":"http:\/\/leodev.ru\/blog\/?p=386"},"modified":"2018-03-11T18:39:48","modified_gmt":"2018-03-11T15:39:48","slug":"%d0%bd%d0%b5%d1%81%d0%ba%d0%be%d0%bb%d1%8c%d0%ba%d0%be-%d0%b4%d0%be%d0%bc%d0%b5%d0%bd%d0%be%d0%b2-%d0%bd%d0%b0-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80%d0%b5-tomcat","status":"publish","type":"post","link":"https:\/\/leodev.ru\/blog\/application-servers\/%d0%bd%d0%b5%d1%81%d0%ba%d0%be%d0%bb%d1%8c%d0%ba%d0%be-%d0%b4%d0%be%d0%bc%d0%b5%d0%bd%d0%be%d0%b2-%d0%bd%d0%b0-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80%d0%b5-tomcat\/","title":{"rendered":"\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Tomcat + nginx"},"content":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043d\u0430 tomcat \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u043c \u0441 80 \u043f\u043e\u0440\u0442\u0430, \u043d\u0430 8080 Tomcat \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>nginx<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li>\u0434\u0432\u0430 \u0434\u043e\u043c\u0435\u043d\u0430: <strong>tresvir.ru<\/strong> \u0438 <strong>m-tree.ru<\/strong><\/li>\n<li>VDS \u043e\u0442 iHor <a href=\"https:\/\/www.ihor.ru\/?from=56003\"><img decoding=\"async\" src=\"https:\/\/billing.ihor.ru\/manimg\/userdata\/320x50.png\" alt=\"\" \/><\/a><\/li>\n<li>Tomcat 7<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>\u0412\u00a0\u043f\u0430\u043f\u043a\u0435\u00a0<em>tomcat7\/conf<\/em> \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u00a0<strong>server.xml\u00a0<\/strong><\/p>\n<p><a href=\"http:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/5343c-clip-16kb1.png\" rel=\"attachment wp-att-389\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-389\" src=\"http:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/5343c-clip-16kb1.png\" alt=\"leodev.ru tomcat hosts\" width=\"277\" height=\"408\" srcset=\"https:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/5343c-clip-16kb1.png 277w, https:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/5343c-clip-16kb1-204x300.png 204w\" sizes=\"auto, (max-width: 277px) 85vw, 277px\" \/><\/a><\/p>\n<h1>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c Tomcat<\/h1>\n<h4>\u0423\u0434\u0430\u043b\u044f\u0435\u043c<\/h4>\n<pre class=\"lang:xhtml decode:true\">      &lt;Host name=\"localhost\"  appBase=\"webapps\"\r\n            unpackWARs=\"true\" autoDeploy=\"true\"&gt;\r\n\r\n      &lt;!--    &lt;Context path=\"\" docBase=\"datr\" debug=\"1\"\/&gt; --&gt;\r\n\r\n        &lt;!-- SingleSignOn valve, share authentication between web applications\r\n             Documentation at: \/docs\/config\/valve.html --&gt;\r\n        &lt;!--\r\n        &lt;Valve className=\"org.apache.catalina.authenticator.SingleSignOn\" \/&gt;\r\n        --&gt;\r\n\r\n        &lt;!-- Access log processes all example.\r\n             Documentation at: \/docs\/config\/valve.html\r\n             Note: The pattern used is equivalent to using pattern=\"common\" --&gt;\r\n        &lt;Valve className=\"org.apache.catalina.valves.AccessLogValve\" directory=\"logs\"\r\n               prefix=\"localhost_access_log\" suffix=\".txt\"\r\n               pattern=\"%h %l %u %t &amp;quot;%r&amp;quot; %s %b\" \/&gt;\r\n\r\n      &lt;\/Host&gt;<\/pre>\n<h4>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e\u00a0\u0423\u0414\u0410\u041b\u0415\u041d\u041d\u041e\u0413\u041e<\/h4>\n<pre class=\"lang:xhtml decode:true \">&lt;Host name=\"m-tree.ru\" appBase=\"webapps\/mtree\" unpackWARs=\"true\" autoDeploy=\"true\"&gt;\r\n\t&lt;Alias&gt;www.m-tree.ru&lt;\/Alias&gt;\r\n&lt;\/Host&gt;\r\n&lt;Host name=\"tresvir.ru\" appBase=\"webapps\/tresvir\" unpackWARs=\"true\" autoDeploy=\"true\"&gt;\r\n\t&lt;Alias&gt;www.tresvir.ru&lt;\/Alias&gt;\r\n&lt;\/Host&gt;\r\n<\/pre>\n<h1>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/h1>\n<p><a href=\"http:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/784b9-clip-11kb1.png\" rel=\"attachment wp-att-390\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-390\" src=\"http:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/784b9-clip-11kb1.png\" alt=\"leodev.ru tomcat webapp\" width=\"256\" height=\"357\" srcset=\"https:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/784b9-clip-11kb1.png 256w, https:\/\/leodev.ru\/blog\/wp-content\/uploads\/2016\/03\/784b9-clip-11kb1-215x300.png 215w\" sizes=\"auto, (max-width: 256px) 85vw, 256px\" \/><\/a><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0443\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0414\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u0434\u043e\u043c\u0435\u043d\u0430(<em>http:\/\/www.tresvir.ru\/<\/em>)\u00a0<strong>WAR<\/strong> \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c <strong>ROOT<\/strong>, \u0442\u0430\u043a \u0436\u0435\u00a0\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u0435 \u043f\u0430\u043f\u043a\u0438 manager \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>\u041d\u0430\u00a0\u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f , \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432 \u0440\u0443\u0447\u043d\u0443\u044e<\/p>\n<h2>NGINX config<\/h2>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u0433\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 80 \u043f\u043e\u0440\u0442\u0430 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Tomcat 9 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u043b SecketException 80<\/p>\n<p>\u0412\u044b\u0440\u0443\u0447\u0438\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>nginx.\u00a0<\/strong><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u044f \u043d\u0438\u0436\u0435. \u041d\u0435 \u0441\u0442\u0430\u043b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445, \u043d\u043e \u043f\u043e\u043a\u0430 \u0438\u0445 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0430 \u0432\u0441\u0435\u0445 \u0434\u043e\u043c\u0435\u043d\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043e\u043c\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<ul>\n<li>proxy_http_version 1.1;<\/li>\n<li>proxy_set_header Upgrade $http_upgrade;<\/li>\n<li>proxy_set_header Connection &#171;upgrade&#187;;<\/li>\n<li>proxy_set_header Host $http_host;<\/li>\n<\/ul>\n<pre class=\"lang:vim decode:true\">server { \r\n\tlisten 80;\r\n\tlisten [::]:80;\r\n\tserver_name recon24.ru www.recon24.ru;\r\n\t#root \/opt\/apache-tomcat-9.0.1\/webapps\/recon24;\r\n\tserver_name_in_redirect on;\r\n    \r\n\taccess_log \/var\/log\/nginx\/tresvir_access.log;\r\n    error_log \/var\/log\/nginx\/tresvir_error.log debug;\r\n\t\r\n\t\r\n\tlocation \/ {\r\n\t\t#proxy_set_header X-Forwarded-Host $host;\r\n        proxy_set_header X-Forwarded-Host $host;\r\n        proxy_set_header X-Forwarded-Server $host;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n\u00a0       proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_pass http:\/\/localhost:8080\/; \r\n\t\tproxy_redirect off;\r\n\t\tproxy_http_version 1.1;\r\n\t\tproxy_set_header Upgrade $http_upgrade;\r\n\t\tproxy_set_header Connection \"upgrade\";\r\n\t\tproxy_set_header Host $http_host;\r\n\t}\r\n}\r\n\r\nserver { \r\n\tlisten 80;\r\n\tlisten [::]:80;\r\n\tserver_name tresvir.ru\twww.tresvir.ru;\r\n\t#root \/opt\/apache-tomcat-9.0.1\/webapps\/tresvir;\r\n\tserver_name_in_redirect on;\r\n    \r\n\taccess_log \/var\/log\/nginx\/tresvir_access.log;\r\n    error_log \/var\/log\/nginx\/tresvir_error.log debug;\r\n\t\r\n\t\r\n\tlocation \/ {\r\n        proxy_set_header X-Forwarded-Host $host;\r\n        proxy_set_header X-Forwarded-Server $host;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n      \u00a0 proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_pass http:\/\/localhost:8080\/; \r\n\t\tproxy_redirect off;\r\n\t\tproxy_http_version 1.1;\r\n\t\tproxy_set_header Upgrade $http_upgrade;\r\n\t\tproxy_set_header Connection \"upgrade\";\r\n\t\tproxy_set_header Host $http_host;\r\n\t}\r\n}<\/pre>\n<h1>\u0423\u0447\u0438\u043c Tomcat \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 IP<\/h1>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <a href=\"http:\/\/tomcat.apache.org\/tomcat-7.0-doc\/config\/filter.html#Remote_IP_Filter\">\u0444\u0438\u043b\u044c\u0442\u0440\u044b<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Spring Boot \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 <strong>application.properties<\/strong><\/p>\n<blockquote>\n<pre class=\"\">server.use-forward-headers=true<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u043d\u0430 tomcat \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u043c \u0441 80 \u043f\u043e\u0440\u0442\u0430, \u043d\u0430 8080 Tomcat \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e nginx. \u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b: \u0434\u0432\u0430 \u0434\u043e\u043c\u0435\u043d\u0430: tresvir.ru \u0438 m-tree.ru VDS \u043e\u0442 iHor Tomcat 7<\/p>\n","protected":false},"author":1,"featured_media":392,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[98],"tags":[140,234,139],"class_list":["post-386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-servers","tag-hosts","tag-nginx","tag-tomcat"],"_links":{"self":[{"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":6,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":880,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions\/880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/media\/392"}],"wp:attachment":[{"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leodev.ru\/blog\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}