A tentative approach to Tomcat (iii) multi-project deployment

Source: Internet
Author: User

Nonsense

Yesterday the landlord asked me to say that the recent soaring prices, the rent has to rise, can not be mixed down, the boss must raise wages. Early in the morning to find the boss, the boss looked at me, let me publish the first two sites: a front-end site frontend, to users; a background management site backend, for administrators, two sites to deploy two sites on the same server, but only one tomcat on the server, what to do?

Multi-project deployment of the same port

Still looking for me before I understand the role of the various nodes in the Server.xml, just come in handy, you can set a different path to match to the corresponding context, ah, so do, open a 8001 port, modify the context of the path, the following configuration appears:

<path= "/user"  docBase= "/frontend"/><    path = "/manager" docBase = "/backend"/> 

By address: Http://localhost:8001/user and Http://localhost:8001/manager into the corresponding project (same port with the domain name) can be normal access. Fart fart to find the boss to pay wages, the boss a look, redo, why, the foreground domain name to www.frontend.com, background domain name to www.backend.com only, this also difficult not to pour me, adjust the Host node configuration can:

    <Hostname= "Www.backend.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">            <ContextPath=""DocBase= "/backend" />      </Host>      <Hostname= "Www.frontend.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">        <ContextPath=""DocBase= "/frontend" />      </Host>

The user site and the Administrator site are then accessed by address: http://www.frontend.com:8001 and http://www.backend.com:8001 (different domain names on the same port). and fart on the fart to find the boss to ask for a pay rise, boss not, assistant sister said the boss meeting went, don't know when to come back, sister seems to have no boyfriend, good cute, just smiled on me, is not interesting to me, hey.

Multi-project deployment of different ports

The boss finally returned, but also to change (¥#@% ... ), the reason is a port is not enough trenches, to two: a 8001 for the front desk, a 8002 for the backstage. In order to pay, endure, configuration and change. Looking back at the contents of the Server.xml, the port number is responsible for the Connector node, is not to engage two Connector can, say dry on the dry, modify the configuration as follows (listening multiport):

   <ConnectorPort= "8001"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443" />   <ConnectorPort= "8002"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443" />    

It is then possible to access user sites and administrator sites by address: http://www.frontend.com:8001 and http://www.backend.com:8002, but http://www.frontend.com : 8002 and http://www.backend.com:8001 Incredibly also normal, fortunately I self-test a bit, or it must be the boss to find reasons for arrears in wages, again adjusted:

  <!--configuration of the www.frontend.com -  <Servicename= "Catalina">    <ConnectorPort= "8001"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8013" />    <ConnectorPort= "8109"Protocol= "ajp/1.3"Redirectport= "8013" />    <Enginename= "Catalina"Defaulthost= "localhost">      <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">      </Host>      <Hostname= "Www.frontend.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">            <ContextPath=""DocBase= "/frontend" />      </Host>    </Engine>  </Service>  <!--configuration of the www.backend.com -  <Servicename= "Catalina">    <ConnectorPort= "8002"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8014" />    <ConnectorPort= "8110"Protocol= "ajp/1.3"Redirectport= "8014" />    <Enginename= "Catalina"Defaulthost= "localhost">      <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">      </Host>              <Hostname= "Www.backend.com"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">        <ContextPath=""DocBase= "/backend" />      </Host>    </Engine>  </Service>

Access to user sites and administrator sites by address: http://www.frontend.com:8001 and http://www.backend.com:8002, but http://www.frontend.com:8002 and http://www.backend.com:8001 not normal access, fix, hurriedly to find the boss, by the way about assistant sister at night to eat spicy (promotion, win white rich beauty, wow haha), disturbed to knock open the door of the boss. The boss saw me said: "Just to find you, in order to facilitate the management, or to get two servers, you finish today, raise the wages of the matter, tomorrow again." Look at the table, there are a few minutes to work, the assistant sister looked at me one eye (eyes very pity there is wood), I opened the mouth, eat things have not said, forget, another day about it, tonight to overtime, not reconciled (I am a yard farm AH) ...

A tentative approach to Tomcat (iii) multi-project deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.