about tomcat context

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

  1. david wolf

    david wolf Guest

    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
    #1
    1. Advertising

  2. david wolf

    sdavids Guest

    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
    #2
    1. Advertising

  3. david wolf

    david wolf Guest

    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
    #3
  4. david wolf

    sdavids Guest

    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
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VS_NET_DEV
    Replies:
    2
    Views:
    3,788
    jenny
    May 25, 2004
  2. =?Utf-8?B?U3VuU21pbGU=?=
    Replies:
    0
    Views:
    690
    =?Utf-8?B?U3VuU21pbGU=?=
    Jan 10, 2006
  3. Flip Rayner
    Replies:
    1
    Views:
    636
    bruce barker
    Jan 23, 2007
  4. asd
    Replies:
    1
    Views:
    422
    www.pulpjava.com
    Nov 9, 2006
  5. Jani Tiainen
    Replies:
    3
    Views:
    1,004
    Jani Tiainen
    Aug 27, 2007
Loading...

Share This Page