Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

WebSite Mapping

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Patrick McDonogh
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, tomcat can be confugred for different hosts. See the tomcat docs for <host> configuration.
 
Patrick McDonogh
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou for the reply this has definatelly pointed me in the right direction.

Take care and have a good day.
 
    Bookmark Topic Watch Topic
  • New Topic