简体   繁体   中英

Tomcat virtual host and context config

I'm having an issue accomplishing something. I currently own a domain and I have the DNS set up to hit Tomcat on 8080 on my local machine when requested in the browser. All good so far. So when it hits Tomcat I get the standard "Cat" page where I can access manager, host-manager, etc...

My goal is to set up a virtual host to have a request to my domain routed to a specific webapp located in the Tomcat_Home\\webapp folder. So I configure my server.xml as such:

<Host name="dwnewton.com" appBase="webapps"
    unpackWARs="true" autoDeploy="true">

</Host>

The dwnewton.war has been deployed to webapps and has unpacked itself as expected. But no matter what I do I cannot get Tomcat to route my request to a specific webapp within the Tomcat_Home\\webapp directory.

  • I've tried putting context.xml in the Meta_Inf of the specific application
  • I've tried configuring the context.xml in the conf directory
  • I've tried putting the [appname].xml in the conf\\localhost directory

I'm getting pretty frustrated. Perhaps I'm specifying the appBase or path or docBase incorrectly. Or maybe I'm putting them in the wrong location.

如果将dwnewton.war重命名为ROOT.war,则它应该在域的根目录中可用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM