tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Milbourne <anthony.milbou...@becta.org.uk>
Subject RE: Url Mapping with mod_jk
Date Fri, 06 Sep 2002 16:09:31 GMT
Hi

Thanks for that help - I now realise more about how the server.xml works.
I have done what you said and my webapp now appears in the root url when I
connect direct to Tomcat (which is great).  Unfortunately when I connect via
Apache I get back the JSP source, as if it has not gone through Tomcat.  I
have played around a bit and can't figure out what is going on.  
Could you (or anyone) take a look at the config snippets below and see if
you can spot the problem.

The (I think) pertinent bit of my httpd.conf is:

<IfModule !mod_jk.c>
  LoadModule jk_module /usr/local/apache/libexec/mod_jk.so
</IfModule>

JkWorkersFile "/usr/local/jakarta-tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/jakarta-tomcat/logs/mod_jk.log"

JkLogLevel info

<VirtualHost 193.63.51.96>
    ServerName stagenewngfl.ngfl.gov.uk

    JkMount /* ajp13

</VirtualHost>

And the server.xml file (without some comments) is:

<Server port="8005" shutdown="SHUTDOWN" debug="0">
	
  <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
                 modJk="/usr/local/apache/libexec/mod_jk.so" jkDebug="info"
 
workersConfig="/usr/local/jakarta-tomcat/conf/jk/workers.properties"
                 jkLog="/usr/local/jakarta-tomcat/logs/mod_jk.log"/>

  <Service name="Tomcat-Standalone">

    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8080" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="60000"/>
    
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>

    <Engine name="Standalone" defaultHost="localhost" debug="0">

      <Logger className="org.apache.catalina.logger.FileLogger"
               prefix="standalone_catalina_log." suffix=".txt"
               timestamp="true"/>

      <Realm className="org.apache.catalina.realm.MemoryRealm" />

        <Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true">

          <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
               append="true"  />
    
          <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs"  prefix="standalone_localhost_access_log."
suffix=".txt"
               pattern="common"/>

          <Logger className="org.apache.catalina.logger.FileLogger"
               directory="logs"  prefix="standalone_localhost_log."
suffix=".txt"
	         timestamp="true"/>
        
          <Context path="/manager" docBase="manager" 
               debug="0" privileged="true"/>

        </Host>

        <!-- Define the stagenewngfl.ngfl.gov.uk virtual host -->
        <Host name="stagenewngfl.ngfl.gov.uk" debug="0" appBase="webapps"
unpackWARs="true">

          <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
               append="true"  />

          <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs"  prefix="standalone_ngfl_access_log."
suffix=".txt"
               pattern="common"/>

          <Logger className="org.apache.catalina.logger.FileLogger"
               directory="logs"  prefix="standalone_ngfl_log." suffix=".txt"
	         timestamp="true"/>

          <!-- Tomcat Root Context -->
          <Context path="" docBase="stagenewngfl" debug="0"/>

          <!-- Tomcat Manager Context -->
          <Context path="/manager" docBase="manager" 
               debug="0" privileged="true"/>

        </Host>
      </Engine>
    </Service>

    <!-- Define an Apache-Connector Service -->
    <Service name="Tomcat-Apache">

      <Connector
className="org.apache.catalina.connector.warp.WarpConnector"
               port="8008" minProcessors="5" maxProcessors="75"
               enableLookups="true" appBase="webapps"
               acceptCount="10" debug="0"/>

      <Engine className="org.apache.catalina.connector.warp.WarpEngine"
               name="Apache" debug="0">

      <Logger className="org.apache.catalina.logger.FileLogger"
               prefix="apache_catalina_log." suffix=".txt"
               timestamp="true"/>

      <Realm className="org.apache.catalina.realm.MemoryRealm" />

      <!-- Define the stagenewngfl.ngfl.gov.uk virtual host -->
      <Host name="stagenewngfl.ngfl.gov.uk" debug="0" appBase="webapps"
unpackWARs="true">

        <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
               append="true"  />

        <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs"  prefix="apache_ngfl_access_log."
suffix=".txt"
               pattern="common"/>

        <Logger className="org.apache.catalina.logger.FileLogger"
               directory="logs"  prefix="apache_ngfl_log." suffix=".txt"
	         timestamp="true"/>

        <!-- Tomcat Root Context -->
        <Context path="" docBase="stagenewngfl" debug="0"/>

        <!-- Tomcat Manager Context -->
        <Context path="/manager" docBase="manager" 
               debug="0" privileged="true"/>

      </Host>
    </Engine>
  </Service>
</Server>

Sorry that is a bit of a long config snippet - I tried to cut it down but
I'm not confident enough with server.xml to know which bits are relevant.

Thanks for any help,

		Anthony.


> -----Original Message-----
> From:	Turner, John [SMTP:JTurner@AAS.com]
> Sent:	04 September 2002 15:18
> To:	'Tomcat Users List'
> Subject:	RE: Url Mapping with mod_jk
> 
> 
> How is this not handled with a Host and Context element?
> 
> Apache config:
> 
> VirtualHost one.host.com
> JkMount /*.jsp AJP13
> 
> VirtualHost two.host.com
> JkMount /*.jsp AJP13
> 
> Tomcat:
> 
> Host name="one.host.com"
> Context path="" docBase="one"
> 
> Host name="two.host.com"
> Context path="" docBase="two"
> 
> Host one files go in $CATALINA_HOME/webapps/one, host two files go in
> $CATALINA_HOME/webapps/two.  So then you would have one.host.com/index.jsp
> and two.host.com/index.jsp.
> 
> I haven't tried this with 4.x, the tomcats I have with virtual hosts are
> all
> 3.x and server.xml is quite a bit different, but I don't see why it
> wouldn't
> work, especially with some tweaking.
> 
> John
> 
> > -----Original Message-----
> > From: Anthony Milbourne [mailto:anthony.milbourne@becta.org.uk]
> > Sent: Wednesday, September 04, 2002 9:58 AM
> > To: 'tomcat-user@jakarta.apache.org'
> > Subject: Url Mapping with mod_jk
> > 
> > 
> > Hi
> > 
> > I know this question was asked in Feb but it didn't seem to 
> > get a full reply
> > back then - so I'm asking again.
> > 
> > I have one instanve of Apache 1.3 talking over mod_jk to one 
> > instance of
> > Tomcat 4.0.4.  Apache has 2 virtualhosts set up for the 2 
> > webapps deployed
> > on Tomcat.  Both virtualhosts need to have the webapps mapped 
> > to the root
> > url.
> > 
> > Currently I am using directives like:
> > 
> > JkMount /app1/*.jsp ajp13
> > 
> > but this mounts the webapp under the /app1 url.  I can't make app1 the
> > Tomcat root app as this would also need to be done for app2.  With
> > mod_webapp you can mount a given webapp under a given URL - 
> > but I haven't
> > seen anything like this for mod_jk.  Is it possible with 
> > mod_jk or do I have
> > to kludge it with an apache alias ?
> > 
> > Thanks,
> > 
> > 		Anthony.
> > 
> > PS - sorry if Outlook has filled this post with HTML.
> 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message