Discussion in 'Java' started by david wolf, Jun 8, 2006.

1. ### david wolfGuest

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://hostname:port/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
david wolf, Jun 8, 2006

2. ### sdavidsGuest

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.UserDatabaseRealm"/>
<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://hostname:port/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
sdavids, Jun 8, 2006

3. ### david wolfGuest

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.UserDatabaseRealm"/>
> <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://hostname:port/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
david wolf, Jun 8, 2006
4. ### sdavidsGuest

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.UserDatabaseRealm"/>
> > <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://hostname:port/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
sdavids, Jun 8, 2006