You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "D. Alvarado" <la...@gmail.com> on 2006/11/13 17:20:38 UTC

Why is "ROOT" appended?

Hi, I installed Tomcat 5.5.20 on Fedora Core 5 Linux.  In my
"server.xml" file, I have the default appbase as "webapps"

      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

but when i request a loose page, it gets the file from "webapps/ROOT".
 How do I change the configuration such that it gets the page from
"webapps"?

Thanks, - Dave

---------------------------------------------------------------------
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: Why is "ROOT" appended?

Posted by "D. Alvarado" <la...@gmail.com>.
Actually the problem was I still had "/usr/local/apache2/htdocs" as my
"appBase" directive in my server.xml file.  When I changed that back
to "webapps", things worked.

Thanks for your taking the time to explain these things. - Dave

On 11/13/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: D. Alvarado [mailto:laredotornado@gmail.com]
> > Subject: Re: Why is "ROOT" appended?
> >
> > <Context docBase="/usr/local/apache2/htdocs"
> >          privileged="true" antiResourceLocking="false"
> > antiJARLocking="false">
> > </Context>
> >
> > Is the ROOT.xml file correct?
>
> That looks o.k. to me.  Could there be a permissions problem - Tomcat
> unable to access /usr/local/apache2/htdocs?
>
>  - 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
>
>

---------------------------------------------------------------------
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: Why is "ROOT" appended?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: D. Alvarado [mailto:laredotornado@gmail.com] 
> Subject: Re: Why is "ROOT" appended?
> 
> <Context docBase="/usr/local/apache2/htdocs"
>          privileged="true" antiResourceLocking="false" 
> antiJARLocking="false">
> </Context>
>
> Is the ROOT.xml file correct?

That looks o.k. to me.  Could there be a permissions problem - Tomcat
unable to access /usr/local/apache2/htdocs?

 - 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: Why is "ROOT" appended?

Posted by "D. Alvarado" <la...@gmail.com>.
Thanks.  I did as you instructed creating in
"$CATALINA_HOME/conf/Catalina/localhost" the file ROOT.xml

<Context docBase="/usr/local/apache2/htdocs"
         privileged="true" antiResourceLocking="false" antiJARLocking="false">
</Context>

and I deleted the webapps/ROOT directory.  I restarted and now i get a
404 when I make my request ...

[root@localhost ~]# wget http://localhost:8080/test.jsp
--11:21:19--  http://localhost:8080/test.jsp
           => `test.jsp'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 404 /test.jsp
11:21:19 ERROR 404: /test.jsp.

Is the ROOT.xml file correct?

 - Dave

On 11/13/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: D. Alvarado [mailto:laredotornado@gmail.com]
> > Subject: Re: Why is "ROOT" appended?
> >
> > Ok, let me ask another question.  If I want to change the directory to
> > where I put JSP files that I don't want to package into a WAR, to say,
> > "/usr/local/apache2/htdocs", how do I do that?
>
> They don't have to be in a .war, but they do have to part of some
> webapp.  The easiest thing to do is put them under webapps/ROOT.  If you
> don't want them there, delete the webapps/ROOT directory, and create a
> ROOT.xml file in conf/[engine]/[host] containing a docBase attribute
> that points to the location of your JSPs.
>
>  - 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
>
>

---------------------------------------------------------------------
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: Why is "ROOT" appended?

Posted by "D. Alvarado" <la...@gmail.com>.
Thanks but this fails.  Here's what I changed the appBase dir to

      <Host name="localhost" appBase="/usr/local/apache2/htdocs"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

and here is what happened when I restarted and tried to request a page
that I just created (with 775 perms)

[root@localhost bin]# wget http://localhost:8080/test.jsp
--10:49:24--  http://localhost:8080/test.jsp
           => `test.jsp'
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 400 No Host matches server
name localhost
10:49:24 ERROR 400: No Host matches server name localhost.

Do I have to create a "ROOT" directory within "/usr/local/apache2/htdocs"?

 - Dave




On 11/13/06, Edoardo Panfili <ed...@aspix.it> wrote:
> D. Alvarado ha scritto:
> > Ok, let me ask another question.  If I want to change the directory to
> > where I put JSP files that I don't want to package into a WAR, to say,
> > "/usr/local/apache2/htdocs", how do I do that?
>
> take a look at
> http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
>
> you can use the "appBase" attribute
>
> Edoardo
>
>
> >
> > - Dave
> >
> > On 11/13/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
> >> > From: D. Alvarado [mailto:laredotornado@gmail.com]
> >> > Subject: Why is "ROOT" appended?
> >> >
> >> >       <Host name="localhost" appBase="webapps"
> >> >        unpackWARs="true" autoDeploy="true"
> >> >        xmlValidation="false" xmlNamespaceAware="false">
> >> >
> >> > but when i request a loose page, it gets the file from "webapps/ROOT".
> >> >  How do I change the configuration such that it gets the page from
> >> > "webapps"?
> >>
> >> You can't, and you should not be putting random files under webapps.
> >> All pages must belong to some webapp or another (there's no such thing
> >> as a "loose page"), and those apps are by default under webapps.
>
>
> --
> edoardo@aspix.it
> AIM: edoardopn
> Jabber: edoardopa@talk.google.com
> tel:075 9142766
>
> ---------------------------------------------------------------------
> 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: Why is "ROOT" appended?

Posted by Edoardo Panfili <ed...@aspix.it>.
D. Alvarado ha scritto:
> Ok, let me ask another question.  If I want to change the directory to
> where I put JSP files that I don't want to package into a WAR, to say,
> "/usr/local/apache2/htdocs", how do I do that?

take a look at
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html

you can use the "appBase" attribute

Edoardo


> 
> - Dave
> 
> On 11/13/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
>> > From: D. Alvarado [mailto:laredotornado@gmail.com]
>> > Subject: Why is "ROOT" appended?
>> >
>> >       <Host name="localhost" appBase="webapps"
>> >        unpackWARs="true" autoDeploy="true"
>> >        xmlValidation="false" xmlNamespaceAware="false">
>> >
>> > but when i request a loose page, it gets the file from "webapps/ROOT".
>> >  How do I change the configuration such that it gets the page from
>> > "webapps"?
>>
>> You can't, and you should not be putting random files under webapps.
>> All pages must belong to some webapp or another (there's no such thing
>> as a "loose page"), and those apps are by default under webapps.


-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
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: Why is "ROOT" appended?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: D. Alvarado [mailto:laredotornado@gmail.com] 
> Subject: Re: Why is "ROOT" appended?
> 
> Ok, let me ask another question.  If I want to change the directory to
> where I put JSP files that I don't want to package into a WAR, to say,
> "/usr/local/apache2/htdocs", how do I do that?

They don't have to be in a .war, but they do have to part of some
webapp.  The easiest thing to do is put them under webapps/ROOT.  If you
don't want them there, delete the webapps/ROOT directory, and create a
ROOT.xml file in conf/[engine]/[host] containing a docBase attribute
that points to the location of your JSPs.

 - 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: Why is "ROOT" appended?

Posted by "D. Alvarado" <la...@gmail.com>.
Ok, let me ask another question.  If I want to change the directory to
where I put JSP files that I don't want to package into a WAR, to say,
"/usr/local/apache2/htdocs", how do I do that?

 - Dave

On 11/13/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: D. Alvarado [mailto:laredotornado@gmail.com]
> > Subject: Why is "ROOT" appended?
> >
> >       <Host name="localhost" appBase="webapps"
> >        unpackWARs="true" autoDeploy="true"
> >        xmlValidation="false" xmlNamespaceAware="false">
> >
> > but when i request a loose page, it gets the file from "webapps/ROOT".
> >  How do I change the configuration such that it gets the page from
> > "webapps"?
>
> You can't, and you should not be putting random files under webapps.
> All pages must belong to some webapp or another (there's no such thing
> as a "loose page"), and those apps are by default under webapps.
>
>  - 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
>
>

---------------------------------------------------------------------
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: Why is "ROOT" appended?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: D. Alvarado [mailto:laredotornado@gmail.com] 
> Subject: Why is "ROOT" appended?
> 
>       <Host name="localhost" appBase="webapps"
>        unpackWARs="true" autoDeploy="true"
>        xmlValidation="false" xmlNamespaceAware="false">
> 
> but when i request a loose page, it gets the file from "webapps/ROOT".
>  How do I change the configuration such that it gets the page from
> "webapps"?

You can't, and you should not be putting random files under webapps.
All pages must belong to some webapp or another (there's no such thing
as a "loose page"), and those apps are by default under webapps.

 - 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