Tomcat and multiple domains/applications

后端 未结 3 726
情深已故
情深已故 2020-12-12 19:02

Currently I run single tomcat with single WAR application on port 80. The domain name www.foo.org is pointed to this server ip.

What is the procedure of ad

3条回答
  •  时光说笑
    2020-12-12 19:48

    In its default configuration, Tomcat accepts requests for any hostname and sends them all to the "localhost" defined in conf/server.xml. If you haven't change that, then all you have to do is make sure that you have DNS records set up for both hostnames to point to your server.

    If you want to have a different set of webapps for each hostname, then you'll have to define a second in conf/server.xml and use the appropriate hostname for it. (Note that you'll always have to have a "default" host where all requests go that don't match any of the explicitly-defined hosts).

    You can read the documentation for here: http://tomcat.apache.org/tomcat-7.0-doc/config/host.html (That's for Tomcat 7.0.x. You didn't mention your version so I gave you a link to the latest version's documentation).

提交回复
热议问题