Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > about tomcat context

Reply
Thread Tools

about tomcat context

 
 
david wolf
Guest
Posts: n/a
 
      06-08-2006
I am using tomcat to try to host some html and jsp files. What happened
is that: I create a dir under tomcat_home/webapps, the dir is
tomcat_home/webapps/tst

Then I put a file called abc.html under this tst dir, I cannot see the
file after restart tomcat ( I mean I cannot use
http://hostnameort/tst/abc.html to see the content of the page)

What I have to do to make it work is that:

I need to put a file call tst.xml under this followin dir (actully I
just copy another arbitrary .xml under this dir as this tst.xml)
/home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost

Can anyone give me help to let me know that why I have to have this
tst.xml?

If I really need this file, what I'd better put in this file?

Thanks,

David

 
Reply With Quote
 
 
 
 
sdavids
Guest
Posts: n/a
 
      06-08-2006
Well the default location for the webserver is in the ROOT directory
under the webapps, in order for you to change the default directory you
will need to change the server.xml file located: Tomcat
5.5\conf\server.xml - - open up the file and look for this block of
code:

<Engine
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseR ealm"/>
<Host
appBase="webapps"
name="localhost">
<Context
docBase="steve/"
path="">
</Context>
</Host>
</Engine>

In order for you to change the default location over to tst you will
need to change the line corresponding to docBase to: docBase="tst/"

Hope that works for you

Steve

david wolf wrote:
> I am using tomcat to try to host some html and jsp files. What happened
> is that: I create a dir under tomcat_home/webapps, the dir is
> tomcat_home/webapps/tst
>
> Then I put a file called abc.html under this tst dir, I cannot see the
> file after restart tomcat ( I mean I cannot use
> http://hostnameort/tst/abc.html to see the content of the page)
>
> What I have to do to make it work is that:
>
> I need to put a file call tst.xml under this followin dir (actully I
> just copy another arbitrary .xml under this dir as this tst.xml)
> /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
>
> Can anyone give me help to let me know that why I have to have this
> tst.xml?
>
> If I really need this file, what I'd better put in this file?
>
> Thanks,
>
> David


 
Reply With Quote
 
 
 
 
david wolf
Guest
Posts: n/a
 
      06-08-2006
Your solution is not working, Steve.

Can you help see what is the problem?

BTW, what's the best way to do this, modifying server.xml or create a
tst.xml under
/home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost?


sdavids wrote:
> Well the default location for the webserver is in the ROOT directory
> under the webapps, in order for you to change the default directory you
> will need to change the server.xml file located: Tomcat
> 5.5\conf\server.xml - - open up the file and look for this block of
> code:
>
> <Engine
> name="Catalina">
> <Realm className="org.apache.catalina.realm.UserDatabaseR ealm"/>
> <Host
> appBase="webapps"
> name="localhost">
> <Context
> docBase="steve/"
> path="">
> </Context>
> </Host>
> </Engine>
>
> In order for you to change the default location over to tst you will
> need to change the line corresponding to docBase to: docBase="tst/"
>
> Hope that works for you
>
> Steve
>
> david wolf wrote:
> > I am using tomcat to try to host some html and jsp files. What happened
> > is that: I create a dir under tomcat_home/webapps, the dir is
> > tomcat_home/webapps/tst
> >
> > Then I put a file called abc.html under this tst dir, I cannot see the
> > file after restart tomcat ( I mean I cannot use
> > http://hostnameort/tst/abc.html to see the content of the page)
> >
> > What I have to do to make it work is that:
> >
> > I need to put a file call tst.xml under this followin dir (actully I
> > just copy another arbitrary .xml under this dir as this tst.xml)
> > /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
> >
> > Can anyone give me help to let me know that why I have to have this
> > tst.xml?
> >
> > If I really need this file, what I'd better put in this file?
> >
> > Thanks,
> >
> > David


 
Reply With Quote
 
sdavids
Guest
Posts: n/a
 
      06-08-2006
Well I am running tomcat under windows, but I dont expect that to make
too much of a difference, for the overall setup for Tomcat server I use
the server.xml file to alter any of the changes to point to the
docBase, can you send me the server.xml file under
\Tomcat 5.5\conf



david wolf wrote:
> Your solution is not working, Steve.
>
> Can you help see what is the problem?
>
> BTW, what's the best way to do this, modifying server.xml or create a
> tst.xml under
> /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost?
>
>
> sdavids wrote:
> > Well the default location for the webserver is in the ROOT directory
> > under the webapps, in order for you to change the default directory you
> > will need to change the server.xml file located: Tomcat
> > 5.5\conf\server.xml - - open up the file and look for this block of
> > code:
> >
> > <Engine
> > name="Catalina">
> > <Realm className="org.apache.catalina.realm.UserDatabaseR ealm"/>
> > <Host
> > appBase="webapps"
> > name="localhost">
> > <Context
> > docBase="steve/"
> > path="">
> > </Context>
> > </Host>
> > </Engine>
> >
> > In order for you to change the default location over to tst you will
> > need to change the line corresponding to docBase to: docBase="tst/"
> >
> > Hope that works for you
> >
> > Steve
> >
> > david wolf wrote:
> > > I am using tomcat to try to host some html and jsp files. What happened
> > > is that: I create a dir under tomcat_home/webapps, the dir is
> > > tomcat_home/webapps/tst
> > >
> > > Then I put a file called abc.html under this tst dir, I cannot see the
> > > file after restart tomcat ( I mean I cannot use
> > > http://hostnameort/tst/abc.html to see the content of the page)
> > >
> > > What I have to do to make it work is that:
> > >
> > > I need to put a file call tst.xml under this followin dir (actully I
> > > just copy another arbitrary .xml under this dir as this tst.xml)
> > > /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
> > >
> > > Can anyone give me help to let me know that why I have to have this
> > > tst.xml?
> > >
> > > If I really need this file, what I'd better put in this file?
> > >
> > > Thanks,
> > >
> > > David


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spring context refering to application context Jani Tiainen Java 3 08-27-2007 07:24 AM
return HttpStatusCode.ServiceUnavailable in the context.context.Response.StatusCode (Http response code 503) Flip Rayner ASP .Net 1 01-23-2007 06:35 AM
How to retrieve a session Bean in the Context in a class with the Context reference asd Java 1 11-09-2006 05:00 PM
Strange Context Error: Context 0x197ee0 is disconnected in VS 2005 =?Utf-8?B?U3VuU21pbGU=?= ASP .Net 0 01-10-2006 03:59 PM
Context.Items vs Context.Handler (passing values between pages) VS_NET_DEV ASP .Net 2 05-25-2004 01:16 PM



Advertisments