This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Changing docbase? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Changing docbase?" Watch "Changing docbase?" New topic
Author

Changing docbase?

Julia Irving
Greenhorn

Joined: Jun 30, 2003
Posts: 17
When I installed Apache Tomcat 4.1.24, I downloaded this new conf/server.xml document that uncommented the line:
<Context path="" docBase="ROOT" debug="0" />
Now, I want to be able to serve files that are located on my C-drive without having to copy them into my webapps/root folder. If I change docBase, will I be able to do so? If so, what do I change it to?
Thanks in advance for any help or suggestions!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Rather than changing the default docbase, you create as many new contexts as you like. Here's a couple of examples from my own server.xml on a Windows box:

These are them available as
[code]
http://localhost:8080/garden/
and
http://localhost:8080/lawns/
[/code}
respectively.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Julia Irving
Greenhorn

Joined: Jun 30, 2003
Posts: 17
Thanks for the help! I added the following line by editing in word and then resaving as an .xml:

However, when I went to open the xml file up, I got an error saying invalid character found in text content.
Sorry, but I am new at this. Should I be editing the xml file some other way.
[ August 19, 2003: Message edited by: Julia Irving ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Absolutely! There's no telling what Word will do to a file. Most probably it's turing your quotes into so-called "smart quotes".
If you have nothing else to use, use Notepad or a similar text editor.
bear
Julia Irving
Greenhorn

Joined: Jun 30, 2003
Posts: 17
It worked perfectly! Thanks a lot for all of your help!
 
Don't get me started about those stupid light bulbs.
 
subject: Changing docbase?
 
Similar Threads
how to configure the a web application directory as the root directory
Servlet reloading
Why is Servlet Reloading not functioning?
Tomcat,Eclipse and form data
Yet another tomcat problem