about tomcat context

D

david wolf

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
 
S

sdavids

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
 
D

david wolf

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?
 
S

sdavids

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top