• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to deploy to Root of Tomcat for Website?

 
Khosrow Moossavi
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone??
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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'.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic