I have a VirtualBox Ubuntu Server with Java 8 and Tomcat 8. I want to use Tomcat to serve all web content using it's webapps directory for all my Java apps and create a webdocs directory at the same level and permissions for all my static html websites.
I also have security that checks each URL serving a login if necessary so serving my static html can't be based on the URL path. I want to replicate Apache2's ability to match a domain name and serve the associated docBase. The following is my server.xml attempting to add a Context Path for my static html within the Engine tag:
<Host name="localhost" appBase="webapps"
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
pattern="%h %l %u %t "%r" %s %b" />
<Host name="myets.us" appBase="webdocs">
<Context path="" docBase="/mywebsql/" />
I've tried variations of the above, but get 404 codes or access denied. I'm sure there is conflict with my web.xml where security is designed to intercept each URL. As I said, I need to keep security doing the same, but want domain names to resolve to the docBase similar to what Apache2 does.
Lastly, how can I use domain names instead of 192.168.x.x:8080/ to mimic my production server? Is there a way to do that on my laptop running VirtualBox?
Any help would be greatly appreciated.
P.S. I know I have to setup my IPTable Rules to reroute 8080 to 80 and 8443 to 443 and next get multiple SSL certificates configured in Tomcat. I'm taking each of these configurations in steps.