Problems configuring a <Context> path="xx" on Apache/Tomcat

Discussion in 'Java' started by =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=, Oct 23, 2006.

  1. Hi All

    I'm running Apache 2.0, Tomcat 5.5.17, jdk 1.5

    I'm upgrading from Apache 1.3 Tomcat 3.* jdk 1.4

    In my Apache log file I have the following:

    JkMount /manager* foo
    JkMount /servlets/* foo

    The manager application works fine, when typing the URL

    http://website/manager/html

    Everything is ok.

    Now I'm trying to install an application on the path
    /servlets/myapplication. The Context file looks like this:

    <Context reloadable="true" path="/servlets/myapplication/"
    docBase="${catalina.home}/home/schade/myapplication/" debug="5"
    allowoverride="true">
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    prefix="kvisremote_by_schade." suffix=".txt"
    pattern="common"/>
    </Context>

    Typing a URL like http://website/servlets/myapplication/testfile.html
    does not trigger this context. I've made a similar Valve for the
    manager-application, and here every request to the manager Context is
    logged.

    I guess it has something to do with the path-attribute. A similar
    solution worked fine on the old server...

    Regards,
    René
     
    =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=, Oct 23, 2006
    #1
    1. Advertising

  2. =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=

    Simon Brooke Guest

    in message <>, René
    Schade ('') wrote:

    > Hi All
    >
    > I'm running Apache 2.0, Tomcat 5.5.17, jdk 1.5
    >
    > I'm upgrading from Apache 1.3 Tomcat 3.* jdk 1.4
    >
    > In my Apache log file I have the following:
    >
    > JkMount /manager* foo
    > JkMount /servlets/* foo
    >
    > The manager application works fine, when typing the URL
    >
    > http://website/manager/html
    >
    > Everything is ok.
    >
    > Now I'm trying to install an application on the path
    > /servlets/myapplication. The Context file looks like this:
    >
    > <Context reloadable="true" path="/servlets/myapplication/"
    > docBase="${catalina.home}/home/schade/myapplication/" debug="5"
    > allowoverride="true">
    > <Valve className="org.apache.catalina.valves.AccessLogValve"
    > prefix="kvisremote_by_schade." suffix=".txt"
    > pattern="common"/>
    > </Context>


    You're trying to be way too complex.

    You should not need to create a new context for your webapp. Simply take
    the original server.xml, just as it was when you first installed Tomcat,
    and do nothing whatever with it. Then drop your war file into the webapps
    directory, and, hey presto! your webapp will work.

    --
    (Simon Brooke) http://www.jasmine.org.uk/~simon/

    ;; Want to know what SCO stands for?
    ;; http://ars.userfriendly.org/cartoons/?id=20030605
     
    Simon Brooke, Oct 23, 2006
    #2
    1. Advertising

  3. Simon Brooke wrote:
    > in message <>, René
    > Schade ('') wrote:
    >
    > > Hi All
    > >
    > > I'm running Apache 2.0, Tomcat 5.5.17, jdk 1.5
    > >
    > > I'm upgrading from Apache 1.3 Tomcat 3.* jdk 1.4
    > >
    > > In my Apache log file I have the following:
    > >
    > > JkMount /manager* foo
    > > JkMount /servlets/* foo
    > >
    > > The manager application works fine, when typing the URL
    > >
    > > http://website/manager/html
    > >
    > > Everything is ok.
    > >
    > > Now I'm trying to install an application on the path
    > > /servlets/myapplication. The Context file looks like this:
    > >
    > > <Context reloadable="true" path="/servlets/myapplication/"
    > > docBase="${catalina.home}/home/schade/myapplication/" debug="5"
    > > allowoverride="true">
    > > <Valve className="org.apache.catalina.valves.AccessLogValve"
    > > prefix="kvisremote_by_schade." suffix=".txt"
    > > pattern="common"/>
    > > </Context>

    >
    > You're trying to be way too complex.
    >
    > You should not need to create a new context for your webapp. Simply take
    > the original server.xml, just as it was when you first installed Tomcat,
    > and do nothing whatever with it. Then drop your war file into the webapps
    > directory, and, hey presto! your webapp will work.
    >
    > --
    > (Simon Brooke) http://www.jasmine.org.uk/~simon/
    >
    > ;; Want to know what SCO stands for?
    > ;; http://ars.userfriendly.org/cartoons/?id=20030605



    Unfortunatly its not that easy :)

    I have to follow the JKMount definitions, this I have to say in which
    path the application will be deployed.

    The tomcat server is not in full control of the root of the webserver.
    As described it controls urls starting with /manager and /servlets/*.
    That is, there is no "home" or "root" dir for tomcat (please correct me
    if I am wrong).

    For instance, it is not possible to call the example-applications
    "jsp-examples" "tomcat-docs" etc.

    Regards,
    René
     
    =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=, Oct 24, 2006
    #3
  4. =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=

    steen Guest

    René Schade wrote:
    > The tomcat server is not in full control of the root of the webserver.
    > As described it controls urls starting with /manager and /servlets/*.
    > That is, there is no "home" or "root" dir for tomcat (please correct me
    > if I am wrong).


    Hm, maybe its just me thats not quite following what you mean, but my
    tomcat has a ROOT dir ($TOMCAT_HOME/webapps/ROOT) which is the root of
    the default host ?

    /Steen
     
    steen, Oct 24, 2006
    #4
  5. =?iso-8859-1?B?UmVu6SBTY2hhZGU=?=

    Lew Guest

    > René Schade wrote:
    >> The tomcat server is not in full control of the root of the webserver.
    >> As described it controls urls starting with /manager and /servlets/*.
    >> That is, there is no "home" or "root" dir for tomcat (please correct me
    >> if I am wrong).

    >

    steen wrote:
    > Hm, maybe its just me thats not quite following what you mean, but my
    > tomcat has a ROOT dir ($TOMCAT_HOME/webapps/ROOT) which is the root of
    > the default host ?
    >
    > /Steen


    René pointed out that Apache Web Server doesn't forward those paths.

    - Lew
     
    Lew, Oct 26, 2006
    #5
    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. Stian Kaasa

    Apache + Tomcat + mod_jk configuring

    Stian Kaasa, Jan 18, 2004, in forum: Java
    Replies:
    1
    Views:
    2,401
    Sudsy
    Jan 18, 2004
  2. Someone
    Replies:
    4
    Views:
    430
  3. Joshua
    Replies:
    5
    Views:
    2,566
    dundonald
    Nov 27, 2004
  4. roohbir

    Configuring Apache with Tomcat

    roohbir, Feb 23, 2007, in forum: Java
    Replies:
    2
    Views:
    313
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Feb 24, 2007
  5. ad
    Replies:
    3
    Views:
    208
    Ryan Davis
    Dec 29, 2009
Loading...

Share This Page