You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Maik Schumacher <nc...@netcologne.de> on 2008/10/14 22:37:18 UTC

Changing the ROOT application in Tomcat 6.0.18 on Linux

Hi all,

I want to change the ROOT application on Tomcat 6 without renaming my Web
application to ROOT.

 

I have successfully changed the ROOT application on a Windows XP System
using Tomcat 6.0.18. However, using Tomcat 6.0.18 on OpenSuse Linux 10.3
does not work...

 

I performed the following steps on Windows where I have a Web application
called "testweb" in the <tomcat>\webapps directory.

 

1) Created new directory structure <tomat>\conf\Catalina\localhost

 

2) Create a new File ROOT.xml in this new direcotry with this content:

   <Context path="testweb" reloadable="true"/>

 

3) Started Tomcat and browse to http://localhost:8080
<http://localhost:8080/> 

    I can see the content of my application testweb

 

 

Doing the same on Linux does not work. The ROOT application then is always
rendered, instead of the testweb applications.

 

Am I missing here something or do I something wrong here?

I appreciate any help! Thanks in advance.

Maik

 


Re: AW: Changing the ROOT application in Tomcat 6.0.18 on Linux

Posted by Mark Thomas <ma...@apache.org>.
Maik Schumacher wrote:
> - Having a changed 'appBase' in the 'server.xml' pointing for example to
> 'c:/test/www' on a Windows machine
> - Deploying a Web application as a WAR file with the name' testweb.war'
> putting it in the folder 'c:/test/www'
> - Now the goal here is to access the Web application with
>   http://localhost:8080
>   and not with
>   http://localhost:8080/testweb

You can't do exactly that.

Leave the appBase alone (pointing to webapps) and use a ROOT.xml file.

> How can I do this? I do not want to rename the 'testweb.war' to 'root.war'.
For the record it is ROOT.war - case matters, even on Windows.

> the <Context> Tag in the folder '<tomcat>/conf/Catalina/localhost'
> I tried having a ROOT.xml as well as testweb.xml, with different settings,
> but it will not work.
It should be called ROOT.xml for the result you want.

> Using a ROOT.xml that points to the 'testweb.war' results into this:
> java.lang.IllegalArgumentException: Document base /srv/www/webapps/ROOT does
> not exist or is not a readable directory

Exactly what did you put in your ROOT.xml file when you saw this error?

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Changing the ROOT application in Tomcat 6.0.18 on Linux

Posted by Maik Schumacher <nc...@netcologne.de>.
Thanks for the response.

> Make sure you don't have a ROOT directory or ROOT.war file under the
<Host> appBase directory, and that you don't have any <Context> elements in
server.xml.  If your new default webapp isn't deploying > for some reason,
there should be log entries indicating why.

Yes, I did that.


> Are you using a real Tomcat on your Linux machine, or one of the 3rd-party
repackaged versions?  The latter has given people no end of problems due to
abuse of symlinks and things not being where they > appear to be.  If so,
delete it and install a real one from the Tomcat download page.
> You might want to do a clean reinstallation on the Linux box regardless,
just to make sure there's not something messed up in what you've got.

Yes, I am using a very clean installation of Tomcat 6.0.18.


However using a different 'appBase' on Windows does not work either and
breaks what I posted before.
I have studied many, many posts on the Web regarding changing the ROOT on
Tomcat, but without successfully implementing this.
Maybe Tomcat just does not support the following scenario (I changed a
little here):

- Having a changed 'appBase' in the 'server.xml' pointing for example to
'c:/test/www' on a Windows machine
- Deploying a Web application as a WAR file with the name' testweb.war'
putting it in the folder 'c:/test/www'
- Now the goal here is to access the Web application with
  http://localhost:8080
  and not with
  http://localhost:8080/testweb


How can I do this? I do not want to rename the 'testweb.war' to 'root.war'.
I believe this is the only way it works.
I have tried all other possibilities. I tried almost every combination with
the <Context> Tag in the folder '<tomcat>/conf/Catalina/localhost'
I tried having a ROOT.xml as well as testweb.xml, with different settings,
but it will not work.

Using a ROOT.xml that points to the 'testweb.war' results into this:
java.lang.IllegalArgumentException: Document base /srv/www/webapps/ROOT does
not exist or is not a readable directory
                at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:14
1)
			...


The Tomcat documentation does not provide any examples for how to do this.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Changing the ROOT application in Tomcat 6.0.18 on Linux

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Maik Schumacher [mailto:nc-schumama66@netcologne.de]
> Subject: RE: Changing the ROOT application in Tomcat 6.0.18 on Linux
>
> As mentioned, no problems on Windows XP, but using ROOT.xml
> on my Linux machine does not work. It seams that Tomcat
> ignores the ROOT.xml in <tomcat>/conf/Catalina/localhost

Make sure you don't have a ROOT directory or ROOT.war file under the <Host> appBase directory, and that you don't have any <Context> elements in server.xml.  If your new default webapp isn't deploying for some reason, there should be log entries indicating why.

Are you using a real Tomcat on your Linux machine, or one of the 3rd-party repackaged versions?  The latter has given people no end of problems due to abuse of symlinks and things not being where they appear to be.  If so, delete it and install a real one from the Tomcat download page.

You might want to do a clean reinstallation on the Linux box regardless, just to make sure there's not something messed up in what you've got.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Changing the ROOT application in Tomcat 6.0.18 on Linux

Posted by Maik Schumacher <nc...@netcologne.de>.
Thanks for the response, Chris.
Yes, I used ROOT.xml (in upper case) but it just does not work.

Well, there is no particular reason for not renaming my 'testweb' directory
to 'ROOT'. I just do not like the fact very much that I have to rely on
Tomcat specific contexts. I prefer to use my one and it bothers me that it
does not work on Linux.

As mentioned, no problems on Windows XP, but using ROOT.xml on my Linux
machine does not work. It seams that Tomcat ignores the ROOT.xml in
<tomcat>/conf/Catalina/localhost


Thanks for the hint to not use the webapps directory. Yes, I do use another
directory outside of Tomcat (I changes the appBase attribute in the host tag
of the server.xml

What do you mean with 'plus have it loaded from a separate ROOT.xml
file, too' ?

Thanks again!
Maik

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Mittwoch, 15. Oktober 2008 00:31
To: Tomcat Users List
Subject: Re: Changing the ROOT application in Tomcat 6.0.18 on Linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maik,

Maik Schumacher wrote:
> I want to change the ROOT application on Tomcat 6 without renaming my Web
> application to ROOT.

Any particular reason? It's /way/ easier to simply re-name your
directory to 'ROOT'.

> I performed the following steps on Windows where I have a Web application
> called "testweb" in the <tomcat>\webapps directory.
> 
> 1) Created new directory structure <tomat>\conf\Catalina\localhost
> 
> 2) Create a new File ROOT.xml in this new direcotry with this content:
> 
>    <Context path="testweb" reloadable="true"/>

Try moving your deployment directory to somewhere other than in the
tomcat/webapps directory. It's not a good idea to allow TC to try to
auto-deploy your webapp, plus have it loaded from a separate ROOT.xml
file, too.

Also, are you sure you used ROOT.xml (case matters)? If you didn't do
that, it won't work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj1HZ0ACgkQ9CaO5/Lv0PC7LgCdEyx1tUi8/dSR3ULdZO8XcU1p
ux0AoKQ9hbApotDORgs94udGEIlUFPZC
=l5Q4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Changing the ROOT application in Tomcat 6.0.18 on Linux

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maik,

Maik Schumacher wrote:
> I want to change the ROOT application on Tomcat 6 without renaming my Web
> application to ROOT.

Any particular reason? It's /way/ easier to simply re-name your
directory to 'ROOT'.

> I performed the following steps on Windows where I have a Web application
> called "testweb" in the <tomcat>\webapps directory.
> 
> 1) Created new directory structure <tomat>\conf\Catalina\localhost
> 
> 2) Create a new File ROOT.xml in this new direcotry with this content:
> 
>    <Context path="testweb" reloadable="true"/>

Try moving your deployment directory to somewhere other than in the
tomcat/webapps directory. It's not a good idea to allow TC to try to
auto-deploy your webapp, plus have it loaded from a separate ROOT.xml
file, too.

Also, are you sure you used ROOT.xml (case matters)? If you didn't do
that, it won't work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj1HZ0ACgkQ9CaO5/Lv0PC7LgCdEyx1tUi8/dSR3ULdZO8XcU1p
ux0AoKQ9hbApotDORgs94udGEIlUFPZC
=l5Q4
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org