You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Cobban <jc...@magma.ca> on 2003/03/04 16:43:35 UTC

Tomcat application redeploy behind Apache server

I am sorry to keep harping on this, but I still am no closer to solving my
problem.  I don't even know where to look for a solution.

>
> ----- Original Message -----
> From: "Jim Cobban" <jc...@magma.ca>
> To: <us...@httpd.apache.org>
> Sent: Saturday, February 22, 2003 1:29 PM
> Subject: Re: [users@httpd] Tomcat application redeploy behind Apache
server
>
> I have a problem that when I redeploy my JSP/servlet application on a
Tomcat
> server, the new behavior is not visible to users who access the
applications
> through an Apache HTTP server which is the front-end.  The new behavior is
> seen if I go into the backdoor directly into the Tomcat server, but that
> access is not available to my customers.  As a result I have to shutdown
the
> connector and the Tomcat server and restart in order for my customers to
see
> the new behavior.  How do I configure Apache and Tomcat so that
redeploying
> the application using the manager interface on Tomcat causes the new
> functionality to be visible through Apache.
>
> The Apache httpd.conf file contains the following:
>
> LoadModule webapp_module modules/mod_webapp.so
>
> <IfModule mod_webapp.c>
> WebAppConnection warpConnection warp 127.0.0.1:8008
> WebAppDeploy examples warpConnection /examples/
> WebAppInfo /webapp-info
> </IfModule>
>
> WebAppDeploy cocoon warpConnection /cocoon/
> WebAppDeploy Census warpConnection /Census/
> WebAppDeploy Ocfa warpConnection /Ocfa/
> WebAppDeploy manager warpConnection /manager/
>
> The Tomcat server.xml contains the following:
>
>     <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
>                port="8009" minProcessors="5" maxProcessors="75"
>                acceptCount="10" debug="0"/>
>
>
>


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


Re: Tomcat application redeploy behind Apache server

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Jacob Kjome" <ho...@visi.com>
Subject: Re: Tomcat application redeploy behind Apache server


>
> I would suggest that you quit using mod_webapp.  It is not actively
> developed any longer.  Use mod_jk or jk2.  mod_webapp is probably doing
> some funky cacheing.  I couldn't tell you for sure and neither could most
> people.  This is because almost no one uses mod_webapp anymore and you
will
> be hard pressed to find any support out there for it.  Make the switch and
> see if mod_jk or jk2 solves your problem.

I tried mod_jk2 and it got worse.  Now I cannot see updated web pages
without restarting the Tomcat server.

Remember that I am the application programmer writing the servlet which is
running on Tomcat, not the systems programmer configuring the Apache and
Tomcat servers.  So please excuse my stupidity with regard to how those
servers are configured.  In my previous message I copied text from an
obsolete file in apache2/conf.

When I look at the log on the Tomcat server I see messages which I interpret
as indicating that the mod_jk2 connector has started up.

The only thing I see in the httpd.conf on the Apache side which appears to
relate to the mod_jk2 connection is:

LoadModule jk2_module modules/mod_jk2.so

In workers2.properties I see:

[uri:/Census/*]
info=Census Servlets
worker=ajp13:localhost:8009
debug=0

which I assume directs requests to my application, which is on the Tomat
server at localhost:8009

I honestly do not know what questions to ask in order to get this working.
I do not know what information about my configuration is relevant to
resolving this problem.  I do not know one connector from another, so I have
absolutely no reason to pick one over another.  I just want to run my
servlet.  So could someone please hand-hold me through this?


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


Re: Tomcat application redeploy behind Apache server

Posted by Jacob Kjome <ho...@visi.com>.
I would suggest that you quit using mod_webapp.  It is not actively 
developed any longer.  Use mod_jk or jk2.  mod_webapp is probably doing 
some funky cacheing.  I couldn't tell you for sure and neither could most 
people.  This is because almost no one uses mod_webapp anymore and you will 
be hard pressed to find any support out there for it.  Make the switch and 
see if mod_jk or jk2 solves your problem.

Jake

At 03:49 PM 3/8/2003 -0500, you wrote:
>----- Original Message -----
>From: "Ben Ricker" <br...@wellinx.com>
>Subject: Re: Tomcat application redeploy behind Apache server
>
>
> > So you are saying that you cannot go to /manager/reload?path/to/webapp?
>
>No.  The manager application works perfectly.  The application is redeployed
>and I can see the new functionality if I go into the Tomcat server directly.
>The problem, as I have explained countless times, is that a user coming
>through the Apache front end continues to see the old class behavior.
>
> > Anyway, more info would be needed. One more thing to add: if you can
> > embed the mod_jk configs you added to httpd.conf and any
> > workers.properties/mod_jk.properties you setup, I can help you better.
>
>The definition of the connector on the Tomcat side is:
>
>     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>                port="8009" minProcessors="5" maxProcessors="75"
>                enableLookups="true" redirectPort="8443"
>                acceptCount="10" debug="0" connectionTimeout="0"
>                useURIValidationHack="false"
>
>protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
>
>The definition of the connector on the Apache side is:
>
>LoadModule webapp_module modules/mod_webapp.so
>
><IfModule mod_webapp.c>
>WebAppConnection warpConnection warp 127.0.0.1:8008
>WebAppDeploy examples warpConnection /examples/
>WebAppInfo /webapp-info
></IfModule>
>
>WebAppDeploy cocoon warpConnection /cocoon/
>WebAppDeploy Census warpConnection /Census/
>WebAppDeploy Ocfa warpConnection /Ocfa/
>WebAppDeploy manager warpConnection /manager/
>
>Please understand that I am not personally responsible for either the Tomcat
>or Apache servers.  They are being supported by someone else.  So my
>understanding of details is limited.  I barely even know where to look for
>the configuration files, never mind what their contents mean.  I am an
>application programmer and I honestly have very little motivation to clutter
>my mind with such details.  I just need a set of configuration data that
>works.  Surely SOMEBODY has got this to work?
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Re: Tomcat application redeploy behind Apache server

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Ben Ricker" <br...@wellinx.com>
Subject: Re: Tomcat application redeploy behind Apache server


> So you are saying that you cannot go to /manager/reload?path/to/webapp?

No.  The manager application works perfectly.  The application is redeployed
and I can see the new functionality if I go into the Tomcat server directly.
The problem, as I have explained countless times, is that a user coming
through the Apache front end continues to see the old class behavior.

> Anyway, more info would be needed. One more thing to add: if you can
> embed the mod_jk configs you added to httpd.conf and any
> workers.properties/mod_jk.properties you setup, I can help you better.

The definition of the connector on the Tomcat side is:

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="0"
               useURIValidationHack="false"

protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

The definition of the connector on the Apache side is:

LoadModule webapp_module modules/mod_webapp.so

<IfModule mod_webapp.c>
WebAppConnection warpConnection warp 127.0.0.1:8008
WebAppDeploy examples warpConnection /examples/
WebAppInfo /webapp-info
</IfModule>

WebAppDeploy cocoon warpConnection /cocoon/
WebAppDeploy Census warpConnection /Census/
WebAppDeploy Ocfa warpConnection /Ocfa/
WebAppDeploy manager warpConnection /manager/

Please understand that I am not personally responsible for either the Tomcat
or Apache servers.  They are being supported by someone else.  So my
understanding of details is limited.  I barely even know where to look for
the configuration files, never mind what their contents mean.  I am an
application programmer and I honestly have very little motivation to clutter
my mind with such details.  I just need a set of configuration data that
works.  Surely SOMEBODY has got this to work?


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


Re: Tomcat application redeploy behind Apache server

Posted by Ben Ricker <br...@wellinx.com>.
On Fri, 2003-03-07 at 15:59, Jim Cobban wrote:


> The problem I was having with the connector was NOT that updated pages were
> not visible after the redeploy with the manager app.  It was only that
> updated classes were not visible.  Indeed I did not even have to redeploy to
> see the updated pages.  All I had to do was issue a reload at my browser and
> the updated page would appear.  So the problem has nothing to do with
> cacheing on Apache.
>
> Still I cannot get the manager application to redeploy.  Except now things
> are worse, since the ability to update the pages without restarting the
> Tomcat server has been lost.
> 
> There must be SOMEONE out there who has gotten this to work.  Please tell me
> what I have to do to get the manager application to work behind Apache.

So you are saying that you cannot go to /manager/reload?path/to/webapp?
Do you get an error on the browser? If not, check the access_log of
Apache and see if you received an error there. If the access_log shows a
"good" return code on the /manager, then check the mod_jk log (wherever
you set it up to be logged) and see if there any errors there. You might
be dealing with an issue where Apache does not recognize that /managers
needs to be redirected to Tomcat. Or, passing that point, it may be that
mod_jk is not able to pass the connection to Tomcat.

Anyway, more info would be needed. One more thing to add: if you can
embed the mod_jk configs you added to httpd.conf and any
workers.properties/mod_jk.properties you setup, I can help you better.

HTH,

Ben Ricker

I cannot really answer your question until I know what exactly is not
working and where it breaks down.

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


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


Re: Tomcat application redeploy behind Apache server

Posted by Jim Cobban <jc...@magma.ca>.
----- Original Message -----
From: "Ben Ricker" <br...@wellinx.com>
Subject: Re: Tomcat application redeploy behind Apache server


> On Tue, 2003-03-04 at 09:43, Jim Cobban wrote:
> > I am sorry to keep harping on this, but I still am no closer to solving
my
> > problem.  I don't even know where to look for a solution.
>
> Are you sure you are not caching the web pages? Do you have caching on
> in the httpd.conf? Do you send the "pragma-nocache" in your HTML? Try
> changing the browser settings to always go back to the server and if you
> still get the old page, then look to see if Apache has caching on.
>
> I noticed that you are using mod_webapp. you might want to try to switch
> to mod_jk instead. It works with one Tomcat only; I have heard that it
> is a good idea to remobe the load-balancing weight when only using one
> tomcat. The, you should be able to use the manager app.

I did not want to respond until I had tried everything you suggested.

The problem I was having with the connector was NOT that updated pages were
not visible after the redeploy with the manager app.  It was only that
updated classes were not visible.  Indeed I did not even have to redeploy to
see the updated pages.  All I had to do was issue a reload at my browser and
the updated page would appear.  So the problem has nothing to do with
cacheing on Apache.

Since you and one other person suggested that I was using an older, although
not obsolete, connector, I have had the connector replaced by mod_jk2, the
latest, and supposedly greatest, connector.

Still I cannot get the manager application to redeploy.  Except now things
are worse, since the ability to update the pages without restarting the
Tomcat server has been lost.

There must be SOMEONE out there who has gotten this to work.  Please tell me
what I have to do to get the manager application to work behind Apache.


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


Re: Tomcat application redeploy behind Apache server

Posted by Ben Ricker <br...@wellinx.com>.
On Tue, 2003-03-04 at 09:43, Jim Cobban wrote:
> I am sorry to keep harping on this, but I still am no closer to solving my
> problem.  I don't even know where to look for a solution.

Are you sure you are not caching the web pages? Do you have caching on
in the httpd.conf? Do you send the "pragma-nocache" in your HTML? Try
changing the browser settings to always go back to the server and if you
still get the old page, then look to see if Apache has caching on.

I noticed that you are using mod_webapp. you might want to try to switch
to mod_jk instead. It works with one Tomcat only; I have heard that it
is a good idea to remobe the load-balancing weight when only using one
tomcat. The, you should be able to use the manager app.

HTH,

Ben Ricker

> >
> > ----- Original Message -----
> > From: "Jim Cobban" <jc...@magma.ca>
> > To: <us...@httpd.apache.org>
> > Sent: Saturday, February 22, 2003 1:29 PM
> > Subject: Re: [users@httpd] Tomcat application redeploy behind Apache
> server
> >
> > I have a problem that when I redeploy my JSP/servlet application on a
> Tomcat
> > server, the new behavior is not visible to users who access the
> applications
> > through an Apache HTTP server which is the front-end.  The new behavior is
> > seen if I go into the backdoor directly into the Tomcat server, but that
> > access is not available to my customers.  As a result I have to shutdown
> the
> > connector and the Tomcat server and restart in order for my customers to
> see
> > the new behavior.  How do I configure Apache and Tomcat so that
> redeploying
> > the application using the manager interface on Tomcat causes the new
> > functionality to be visible through Apache.
> >
> > The Apache httpd.conf file contains the following:
> >
> > LoadModule webapp_module modules/mod_webapp.so
> >
> > <IfModule mod_webapp.c>
> > WebAppConnection warpConnection warp 127.0.0.1:8008
> > WebAppDeploy examples warpConnection /examples/
> > WebAppInfo /webapp-info
> > </IfModule>
> >
> > WebAppDeploy cocoon warpConnection /cocoon/
> > WebAppDeploy Census warpConnection /Census/
> > WebAppDeploy Ocfa warpConnection /Ocfa/
> > WebAppDeploy manager warpConnection /manager/
> >
> > The Tomcat server.xml contains the following:
> >
> >     <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
> >                port="8009" minProcessors="5" maxProcessors="75"
> >                acceptCount="10" debug="0"/>
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


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