You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@apache.org on 2001/07/19 06:25:24 UTC

cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

pier        01/07/18 21:25:24

  Modified:    webapp/lib pr_warp_config.c
  Log:
  Now web-applications are correctly deployed from the configuration data
  contained in the web-server config file.
  
  Revision  Changes    Path
  1.3       +38 -1     jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c
  
  Index: pr_warp_config.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pr_warp_config.c	2001/07/18 19:12:38	1.2
  +++ pr_warp_config.c	2001/07/19 04:25:24	1.3
  @@ -54,7 +54,7 @@
    *                                                                           *
    * ========================================================================= */
   
  -/* @version $Id: pr_warp_config.c,v 1.2 2001/07/18 19:12:38 pier Exp $ */
  +/* @version $Id: pr_warp_config.c,v 1.3 2001/07/19 04:25:24 pier Exp $ */
   #include "pr_warp.h"
   
   wa_boolean n_check(wa_connection *conn, warp_packet *pack) {
  @@ -105,6 +105,7 @@
       apr_pool_t *pool=NULL;
       wa_boolean ret=wa_false;
       warp_packet *pack=NULL;
  +    char *temp=NULL;
   
       if (apr_pool_create(&pool,wa_pool)!=APR_SUCCESS) {
           wa_log(WA_MARK,"Cannot create WARP temporary configuration pool");
  @@ -133,7 +134,43 @@
           p_write_string(pack,appl->rpth);
           n_send(conf->sock,pack);
   
  +        if (n_recv(conf->sock,pack)!=wa_true) {
  +            wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +            return(wa_false);
  +        }
  +        if (pack->type==TYPE_ERROR) {
  +            wa_log(WA_MARK,"Cannot deploy application %s",appl->name);
  +            continue;
  +        }
  +        if (pack->type!=TYPE_CONF_APPLIC) {
  +            wa_log(WA_MARK,"Unknown packet received (%d)",pack->type);
  +            p_reset(pack);
  +            pack->type=TYPE_FATAL;
  +            p_write_string(pack,"Invalid packet received");
  +            n_send(conf->sock,pack);
  +        }
  +        p_read_int(pack,(int *)&appl->conf);
  +        p_read_string(pack,&temp);
  +        wa_debug(WA_MARK,"TEMP=\"%s\"",temp);
  +        appl->lpth=apr_pstrdup(wa_pool,temp);
  +        appl->depl=wa_true;
  +        wa_debug(WA_MARK,"Application \"%s\" deployed with root=%s id=%d",
  +                appl->name,appl->lpth,appl->conf);
  +
           elem=elem->next;
  +    }
  +
  +    p_reset(pack);
  +    pack->type=TYPE_CONF_DONE;
  +    n_send(conf->sock,pack);
  +
  +    if (n_recv(conf->sock,pack)!=wa_true) {
  +        wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +        return(wa_false);
  +    }
  +    if (pack->type!=TYPE_CONF_PROCEED) {
  +        wa_log(WA_MARK,"Cannot proceed on this connection");
  +        return(wa_false);
       }
   
       apr_pool_destroy(pool);
  
  
  

Re: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Thom Park wrote:
> 
> Wow!
> 
> I'm impressed - that looks pretty good for a default case but, what if I
> want
> tweak and tune my web app to use things like custom loggers or realms or
> even
> valves or listeners?
> 
> I guess in that case I need to edit the server.xml directly wouldn't you
> say?
> 
> What happens if my WebAppDeploy command matches an already defined webapp,
> will it
> override the existing one or just notice that it's already there and ignore
> the webappdeploy
> request.
> 
> What happens if they conflict, ie.
> WebAppDeploy says the following:
> 
> WebAppDeploy example.jar myConnection /servlet-examples/
> 
> but my server.xml entry is something like
> 
> <Context path="/servlet-examples", docBase="example_two", debug="99">
>         <Realm className="myRealm">
>         </Realm>
> </Context>
> 
> Now I have two jar/webapp folders referring to the same path name and am
> looking
> at a potentially nasty conflict.
> 
> Will the Warp handler object to this?

I have tried to deploy an existing application it seems it works. (As least I
think it does!).

> 
> -Thom
> 
> p.s. Damn good job though - it looks much simpler to manage that mod_jk -

mod_jk relies on the Tomcat server.xml, and mod_jk manage is improving a lot.

> now, how about
> load balancing ;-)
> 
> -----Original Message-----
> From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> Sent: Thursday, July 19, 2001 8:20 AM
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: cvs commit: jakarta-tomcat-connectors/webapp/lib
> pr_warp_config.c
> 
> Thom Park at tpark@borland.com wrote:
> 
> > Pier,
> >
> > I'm curious and appear to be too thick to understand exactly what the
> > WebAppDeploy step does with the webAppConnector, could you find some time
> in
> > your extremely busy schedule to jot down a few notes w.r.t. the what the
> > WebAppDeploy/configure step does exactly.
> >
> > I'm curious to know what information is passed between tomcat and apache
> in
> > that stage.
> 
> Oh, simple... In the web-server configuration file you have something like:
> 
> WebAppConnection myConnection warp localhost:8008
> WebAppDeploy example.jar myConnection /servlet-examples/
> 
> Basically you configure a warp connection between Apache and Tomcat (first
> line), and over that connection you "deploy" a web application:
> 
> Specifically what goes on, is that Apache tells to Tomcat that there should
> be a web application in its directories, in a file called "example.jar", and
> that should be deployed under the "/servlet-examples/" URL path (it's
> Context path). Tomcat finds the example.jar file, unpacks it, deploys it
> into the appropriate host (which is derived from Apache's VirtualHost
> directive), and is ready to process requests...
> 
> So you don't have to configure the same thing twice :)
> 
> Actually, my server.xml file for Tomcat is something like:
> 
> <Server ....>
>   <Service ....>
>     <Connector className="....WarpConnector" port="8008" ..../>
>     <Engine ..../>
>   </Service>
> </Server>
> 
> SIX LINES :)
> 
>     Pier

RE: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

Posted by Thom Park <tp...@borland.com>.
Wow!

I'm impressed - that looks pretty good for a default case but, what if I
want
tweak and tune my web app to use things like custom loggers or realms or
even
valves or listeners?

I guess in that case I need to edit the server.xml directly wouldn't you
say?

What happens if my WebAppDeploy command matches an already defined webapp,
will it
override the existing one or just notice that it's already there and ignore
the webappdeploy
request.

What happens if they conflict, ie.
WebAppDeploy says the following:

WebAppDeploy example.jar myConnection /servlet-examples/

but my server.xml entry is something like

<Context path="/servlet-examples", docBase="example_two", debug="99">
	<Realm className="myRealm">
	</Realm>
</Context>

Now I have two jar/webapp folders referring to the same path name and am
looking
at a potentially nasty conflict.

Will the Warp handler object to this?

-Thom

p.s. Damn good job though - it looks much simpler to manage that mod_jk -
now, how about
load balancing ;-)






-----Original Message-----
From: Pier P. Fumagalli [mailto:pier@betaversion.org]
Sent: Thursday, July 19, 2001 8:20 AM
To: tomcat-dev@jakarta.apache.org
Subject: Re: cvs commit: jakarta-tomcat-connectors/webapp/lib
pr_warp_config.c


Thom Park at tpark@borland.com wrote:

> Pier,
>
> I'm curious and appear to be too thick to understand exactly what the
> WebAppDeploy step does with the webAppConnector, could you find some time
in
> your extremely busy schedule to jot down a few notes w.r.t. the what the
> WebAppDeploy/configure step does exactly.
>
> I'm curious to know what information is passed between tomcat and apache
in
> that stage.

Oh, simple... In the web-server configuration file you have something like:

WebAppConnection myConnection warp localhost:8008
WebAppDeploy example.jar myConnection /servlet-examples/

Basically you configure a warp connection between Apache and Tomcat (first
line), and over that connection you "deploy" a web application:

Specifically what goes on, is that Apache tells to Tomcat that there should
be a web application in its directories, in a file called "example.jar", and
that should be deployed under the "/servlet-examples/" URL path (it's
Context path). Tomcat finds the example.jar file, unpacks it, deploys it
into the appropriate host (which is derived from Apache's VirtualHost
directive), and is ready to process requests...

So you don't have to configure the same thing twice :)

Actually, my server.xml file for Tomcat is something like:

<Server ....>
  <Service ....>
    <Connector className="....WarpConnector" port="8008" ..../>
    <Engine ..../>
  </Service>
</Server>

SIX LINES :)

    Pier




Re: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Thom Park at tpark@borland.com wrote:

> Pier,
> 
> I'm curious and appear to be too thick to understand exactly what the
> WebAppDeploy step does with the webAppConnector, could you find some time in
> your extremely busy schedule to jot down a few notes w.r.t. the what the
> WebAppDeploy/configure step does exactly.
> 
> I'm curious to know what information is passed between tomcat and apache in
> that stage.

Oh, simple... In the web-server configuration file you have something like:

WebAppConnection myConnection warp localhost:8008
WebAppDeploy example.jar myConnection /servlet-examples/

Basically you configure a warp connection between Apache and Tomcat (first
line), and over that connection you "deploy" a web application:

Specifically what goes on, is that Apache tells to Tomcat that there should
be a web application in its directories, in a file called "example.jar", and
that should be deployed under the "/servlet-examples/" URL path (it's
Context path). Tomcat finds the example.jar file, unpacks it, deploys it
into the appropriate host (which is derived from Apache's VirtualHost
directive), and is ready to process requests...

So you don't have to configure the same thing twice :)

Actually, my server.xml file for Tomcat is something like:

<Server ....>
  <Service ....>
    <Connector className="....WarpConnector" port="8008" ..../>
    <Engine ..../>
  </Service>
</Server>

SIX LINES :)

    Pier



RE: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

Posted by Thom Park <tp...@borland.com>.
Pier,

I'm curious and appear to be too thick to understand exactly what the
WebAppDeploy step does
with the webAppConnector, could you find some time in your extremely busy
schedule to jot
down a few notes w.r.t. the what the WebAppDeploy/configure step does
exactly.

I'm curious to know what information is passed between tomcat and apache in
that stage.

-Thom


-----Original Message-----
From: pier@apache.org [mailto:pier@apache.org]
Sent: Wednesday, July 18, 2001 9:25 PM
To: jakarta-tomcat-connectors-cvs@apache.org
Subject: cvs commit: jakarta-tomcat-connectors/webapp/lib
pr_warp_config.c


pier        01/07/18 21:25:24

  Modified:    webapp/lib pr_warp_config.c
  Log:
  Now web-applications are correctly deployed from the configuration data
  contained in the web-server config file.

  Revision  Changes    Path
  1.3       +38 -1     jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c

  Index: pr_warp_config.c
  ===================================================================
  RCS file:
/home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pr_warp_config.c	2001/07/18 19:12:38	1.2
  +++ pr_warp_config.c	2001/07/19 04:25:24	1.3
  @@ -54,7 +54,7 @@
    *
*
    *
========================================================================= */

  -/* @version $Id: pr_warp_config.c,v 1.2 2001/07/18 19:12:38 pier Exp $ */
  +/* @version $Id: pr_warp_config.c,v 1.3 2001/07/19 04:25:24 pier Exp $ */
   #include "pr_warp.h"

   wa_boolean n_check(wa_connection *conn, warp_packet *pack) {
  @@ -105,6 +105,7 @@
       apr_pool_t *pool=NULL;
       wa_boolean ret=wa_false;
       warp_packet *pack=NULL;
  +    char *temp=NULL;

       if (apr_pool_create(&pool,wa_pool)!=APR_SUCCESS) {
           wa_log(WA_MARK,"Cannot create WARP temporary configuration
pool");
  @@ -133,7 +134,43 @@
           p_write_string(pack,appl->rpth);
           n_send(conf->sock,pack);

  +        if (n_recv(conf->sock,pack)!=wa_true) {
  +            wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +            return(wa_false);
  +        }
  +        if (pack->type==TYPE_ERROR) {
  +            wa_log(WA_MARK,"Cannot deploy application %s",appl->name);
  +            continue;
  +        }
  +        if (pack->type!=TYPE_CONF_APPLIC) {
  +            wa_log(WA_MARK,"Unknown packet received (%d)",pack->type);
  +            p_reset(pack);
  +            pack->type=TYPE_FATAL;
  +            p_write_string(pack,"Invalid packet received");
  +            n_send(conf->sock,pack);
  +        }
  +        p_read_int(pack,(int *)&appl->conf);
  +        p_read_string(pack,&temp);
  +        wa_debug(WA_MARK,"TEMP=\"%s\"",temp);
  +        appl->lpth=apr_pstrdup(wa_pool,temp);
  +        appl->depl=wa_true;
  +        wa_debug(WA_MARK,"Application \"%s\" deployed with root=%s
id=%d",
  +                appl->name,appl->lpth,appl->conf);
  +
           elem=elem->next;
  +    }
  +
  +    p_reset(pack);
  +    pack->type=TYPE_CONF_DONE;
  +    n_send(conf->sock,pack);
  +
  +    if (n_recv(conf->sock,pack)!=wa_true) {
  +        wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +        return(wa_false);
  +    }
  +    if (pack->type!=TYPE_CONF_PROCEED) {
  +        wa_log(WA_MARK,"Cannot proceed on this connection");
  +        return(wa_false);
       }

       apr_pool_destroy(pool);