aspose file tools*
The moose likes Tomcat and the fly likes WebSite Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "WebSite Mapping" Watch "WebSite Mapping" New topic
Author

WebSite Mapping

Patrick McDonogh
Ranch Hand

Joined: Oct 13, 2005
Posts: 89
Hi all,

I am very confused about how to do something.

I have a server which has tomcat installed and have written a Struts web site that i would like to make viewable to the world over the web.

I have a domain name and have changed the name servers to point at my servers IP address which is running tomcat on http port 80(Default). For instance say the name is mydomain.com if someone goes to www.mydomain.com they then see the tomcat welcome page just the same way is if i go to http://localhost:80 on the server running tomcat.

So from this i can see that at least the www.mydomain.com is at least mapping to the correct server.

What i want to know is how to map www.mydomain.com to the actual struts web site running on tomcat, as if on the server i went to http://localhost:80/mydomain

Does anyone know how tomcat maps domains to applications running on tomcat?

Thankyou for the help.

Patrick
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

If you want the web app to be served without a context path (more accurately, with a context path of "") you'll need to replace the root webapp that Tomcat provides with your own.
[ August 04, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Patrick McDonogh
Ranch Hand

Joined: Oct 13, 2005
Posts: 89
OK i see.

But what if you wanted to host more than one site on the tomcat server.

So say one uses www.smart.com and the other is www.silly.com

Is there no way for tomcat to map the domain used to a site it is running?

If tomcat cant do this is there some way to map the domains used.

Cheers,

Patrick
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

Yes, tomcat can be confugred for different hosts. See the tomcat docs for <host> configuration.
Patrick McDonogh
Ranch Hand

Joined: Oct 13, 2005
Posts: 89
Thankyou for the reply this has definatelly pointed me in the right direction.

Take care and have a good day.
 
jQuery in Action, 2nd edition
 
subject: WebSite Mapping