Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 24th, 2007, 07:44 AM
Registered User
Join Date: Oct 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Virtual Hosting Setup Not Working In Tomcat 6

Hey everyone,

I am currently upgrading from Tomcat 4 to Tomcat 6. In version 4 I had several context environments setup like so. However when I use the same setup in the server.xml file of Tomcat 6, all environments get authenticated by the first context I have setup instead of there respective databases. This is no good because each context is for a separate client, anyone know how to set this up properly.

<Context path="/App_1" docBase="App_1" debug="0" reloadable="true" crossContext="true">
<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
userTable="PPMUser" userNameCol="UserName" userCredCol="UserPassword"
          userRoleTable="PPMUser" roleNameCol="RoleTomcat" />

Heres a overview of my setup.

Client 1: www.domainname.com/app_1
Client 2: www.domainname.com/app_2

The app is being authenticated with a SQL back end, right now in Tomcat 6, first context is handling all the databases authentication - which is not right. Hope someone can help.


Reply With Quote
  #2 (permalink)  
Old October 25th, 2007, 11:53 PM
Friend of Wrox
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post

Try by giving seperate context XML files for each context. Like for app_1 you need to have app_1.xml which will be placed under TOMCAT_HOME/conf/Catalina/localhost directory. Each context will have its own context xml and that context xml file will have the <context> tag for it.

- Rakesh
Reply With Quote
  #3 (permalink)  
Old December 12th, 2007, 11:26 PM
Registered User
Join Date: Dec 2007
Location: , , Korea.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I am new to tomcat. I also haven't succeeded in setup virtual host in Tomcat6. First I tried with tomcat6 standalone mode.

My $Catalina_home: /usr/share/tomcat6

Following is the section to config virtual hosts in my sever.xml:

        <Host name="biocyberman.com"  appBase="/home/biocyberman/public_html/webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

         <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="virtual_log." suffix=".txt" timestamp="true"/>
        <Context path="" docBase="/home/biocyberman/public_html" debug="0" reloadable="true"/>
       <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="virtual_log." suffix=".txt"
    <Host name="mbio.dom" debug="0"
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    <Context path="" docBase="ROOT" debug="0"/>

This is not successful. My question is:
Is it possible to config a virtual host that all of its files are put out side of $Catalina_home?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in tomcat working in linux frozen84 Apache Tomcat 1 January 2nd, 2007 01:56 AM
JNDI setup in Embedded Tomcat 5.0.19 Pretty Apache Tomcat 3 July 12th, 2005 06:55 AM
apache virtual server, mod_jk, tomcat 5 curiousmind Apache Tomcat 1 May 17th, 2005 09:44 AM
Virtual Hosting (Simple Query) angrycat Apache Tomcat 2 August 10th, 2004 01:31 PM

All times are GMT -4. The time now is 09:56 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.