Link to home
Start Free TrialLog in
Avatar of suprapto45
suprapto45Flag for Singapore

asked on

Tomcat Virtual Host

Hi guys,

I know that this would be better if we use Apache to define the Virtual Host in Tomcat. However, I am still testing my application so it would be good if I just can use Tomcat only.

       <Host name="mortgagecalc.tus" appBase="MortgageCalculator">
      <Context path="/MortgageCalculator" docBase="MortgageCalculator"
            debug="5" reloadable="true" crossContext="true">
            
      </Context>
       </Host>

I have it in my <TOMCAT_HOME>/MortgageCalculator/ROOT/index.jsp

These are my questions.
1. Is that the right way to do it?
2. Do I need to define any DNS Server that will map the mortgagecalc.tus with my local IP Address? Is it local DNS Server or etc?
3. I just want to test it locally (within my networks) so that people won't need to type in my IP Address (192.168.0.16) but only defining the name of mortgagecalc.tus.

Well, my networking knowledge is limited. I am learning it now :)

Thanks
David
Avatar of suprapto45
suprapto45
Flag of Singapore image

ASKER

I think that my local machine needs to be a DNS Server where I can map the IP with the name. Am I right? Then it means that I need to be in Windows NT4 Server or Win 2K Server or perhaps...I can test in my Linux RedHat box.

David
ASKER CERTIFIED SOLUTION
Avatar of Holger101497
Holger101497

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Holger101497
Holger101497

P.S.: server names don't "need" a top level domain.
http://server/page.html works just as well as http://server.tus/page.html, so everybody in my company can always do http://HolgerX25/somePage.html to access my Apache... NO additional network configuration (or virtual hosts) needed...
Hi Holger,

Thanks much. I will try it.

David
Thanks Holger,

I can work it out successfully :). Thanks.

However, I am confused about one more thing now. Ok, I can modify WINDOWS\system32\drivers\etc\hosts to map mortgagecalc.tus into my IP which is 192.168.1.16. So why do I need to configure <host> again in my Tomcat. Would that be redundant? In my opinion, yes.

David
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much

David