• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to deploy to Root of Tomcat for Website?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I deploy my site to a Tomcat web server, in order to show it at the Root of the Site?

I need something like this:
http://www.mysite.com/
NOT this:
http://www.mysite.com/myapp/

I've tried to deploy the .war file which had been renamed to ROOT.war but it's not working. And with anyother named .war file it's deployed to the /myapp/ uri.

The server is Windows and IIS and Tomcat.
Control Panel is Plesk 8.4.

Many Thanks.
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone??
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can create a new HOST entry in TOMCAT_HOME/conf/server.xml

e.g.


with this sample setup, you will have a folder in the root of TOMCAT_HOME called 'www', and it will only work with the host name www.mysite.com - all other requests (localhost, 127.0.0.1, etc) will hit the localhost host configuration.

In the 'www' folder you need to have a 'ROOT' folder, which again contains the contents of your 'myapp'.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I've tried to deploy the .war file which had been renamed to ROOT.war but it's not working.



Any valid application .war unpacked into the ROOT directory should work. Exactly what did you do and what happens? "not working" is not very informative.

Bill
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rene :

You can create a new HOST entry in TOMCAT_HOME/conf/server.xml



Well, I don't have access to TOMCAT_HOME/conf/server.xml. It's a shared hosting. BTW, Isn't this configuration only working for Local Websites?


Bill :

Exactly what did you do and what happens? "not working" is not very informative.



Sorry for not being so informative. I had the domain, and just purchased the hosting. It's a shared Hosting Plan which is a Windows-Based Server with IIS and Tomcat Module. Hosting Control Panel Plesk 8.4.

When I depoly the myApp.war (which is valid. works fine on my computer) the site would be accessible through this url : http://www.mysite.com/myApp/ (works ok too!)
but I want the site would be accessible through this url : http://www.mysite.com/

So I've tried to rename the war file to ROOT.war (which should be deployed to TOMCAT_HOME/webapps/ROOT/ (Isn't it?) ) in order to get this done. But it's neither loading the myApp nor responding any HTTP's Error Page or Tomcat's Error Page. Just a Blank Page.

I'm currently don't have access to Tomcat's Log too, so I can't see Stack Trace or something.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Well, I don't have access to TOMCAT_HOME/conf/server.xml. It's a shared hosting. BTW, Isn't this configuration only working for Local Websites?


It is also working from outside your local site - but only with the domain used in the host setup.

So I've tried to rename the war file to ROOT.war (which should be deployed to TOMCAT_HOME/webapps/ROOT/ (Isn't it?) ) in order to get this done. But it's neither loading the myApp nor responding any HTTP's Error Page or Tomcat's Error Page. Just a Blank Page.


For this to work, you need to overwrite the ROOT folder - or delete it, and then deploy a ROOT.war file, which then when it deploys will be to a ROOT folder.
[ December 25, 2008: Message edited by: Rene Larsen ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic