Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread jean-frederic clere
Hi,
Be carefull with our os:
+++
#if (APR_MAJOR_VERSION  1)^M
#undef apr_socket_create
#define apr_socket_create apr_socket_create_ex^M
#endif^M
+++
It does not run on my OS(s):
+++
[EMAIL PROTECTED]:~/apache20  bin/apachectl start
httpd: Syntax error on line 287 of /home/apache20/apache20/conf/httpd.conf: 
Cannot load /home/apache20/apache20/modules/mod_proxy.so into server: 
/home/apache20/apache20/modules/mod_proxy.so: undefined symbol: apr_socket_create_ex
+++

Cheers
Jean-Frederic
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread Mladen Turk
 

jean-frederic clere wrote: 
 
 Be carefull with our os:
 +++
 #if (APR_MAJOR_VERSION  1)^M
 #undef apr_socket_create
 #define apr_socket_create apr_socket_create_ex^M #endif^M
 +++
 
 It does not run on my OS(s):

And I thought that I'm the 'style police' ;-).

MT.


smime.p7s
Description: S/MIME cryptographic signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread Mladen Turk
 

[EMAIL PROTECTED] commited:

new = apr_array_push(conf-aliases);
   -new-fake = f;
   -new-real = r;
   +new-fake = apr_pstrdup(cmd-pool, f);
   +new-real = apr_pstrdup(cmd-pool, r);



There is no need to do that.
The f is eventually set to cmd-path that is already duped from cmd pool.
They r is always obtained using ap_getword_conf.

MT.


smime.p7s
Description: S/MIME cryptographic signature


Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread jean-frederic clere
Mladen Turk wrote:
 

[EMAIL PROTECTED] commited:
  
  new = apr_array_push(conf-aliases);
 -new-fake = f;
 -new-real = r;
 +new-fake = apr_pstrdup(cmd-pool, f);
 +new-real = apr_pstrdup(cmd-pool, r);
  


There is no need to do that.
The f is eventually set to cmd-path that is already duped from cmd pool.
They r is always obtained using ap_getword_conf.
Without the apr_pstrdup() it does not work on my machine...
I have seen that real gets corrupted. (fake does not but in my test it set to 
cmd-path).

MT.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread Graham Leggett
Mladen Turk wrote:
IMO we could perhaps use exiting Proxy:
Proxy balancer://myCluster
   BalancerMember ajp://host1:port [balancer params]
   etc...
/Proxy
Or..
Proxy balancer://myCluser[/StickySessionName]
   BalancerMember http://host1:port [balancer params]
   etc ...
/Proxy
I just looked at the manual for Proxy - it defines config that is 
common to a particular part of the URL space (it seems to refer to the 
backend URL space).

As the URL defined in Proxy must match the URL defined in ProxyPass, 
sticking stuff on the end of it like the StickySessionName would 
probably cause hassles and confusion. Rather have a directive for 
sticksession, or add it as an option to the ProxyBalancer directive.

I am still mulling over whether using Proxy is a good idea, initially 
I thought not, but thinking about it some more it's making sense.

The idea of this kind of config seems to work, what do you think? Is 
this how you've done it?

Proxy balancer://myCluster/myWebapp
  ProxyBalancer http://host1:port1/myWebapp
  ProxyBalancer http://host2:port2/myWebapp
/Proxy
ProxyPass /myWebapp balancer://myCluster/myWebapp
You can even do funky mixing and matching of protocols inside the load 
balancer, like this:

Proxy balancer://myCluster/myWebapp
  ProxyBalancer ajp://host1:port1/myWebapp
  ProxyBalancer http://host2:port2/theServerIsDown
Proxy
Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread Mladen Turk
I'm experiencing cca 2 hour mail delay on minotaur.
Can you cc: to [EMAIL PROTECTED],hr

jean-frederic clere wrote: 
 [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, August 04, 2004 3:20 PM
 To: Tomcat Developers List
 Subject: Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy 
 mod_proxy.c
 
 Mladen Turk wrote:
   
  
  [EMAIL PROTECTED] commited:
  

new = apr_array_push(conf-aliases);
   -new-fake = f;
   -new-real = r;
   +new-fake = apr_pstrdup(cmd-pool, f);
   +new-real = apr_pstrdup(cmd-pool, r);

 
  
  
  There is no need to do that.
  The f is eventually set to cmd-path that is already duped 
 from cmd pool.
  They r is always obtained using ap_getword_conf.
 
 Without the apr_pstrdup() it does not work on my machine...
 I have seen that real gets corrupted. (fake does not but in 
 my test it set to cmd-path).
 

Well, then there is some other bug (I'll check).
The real is always obtained using ap_getword_conf that internally makes
apr_palloc for the return value.
Further more the same (cmd-pool) pool is used for them, so it should fail
on apr_pstrdup(cmd-pool, r).


MT.


smime.p7s
Description: S/MIME cryptographic signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-04 Thread Mladen Turk
 

Graham Leggett wrote:
  Proxy balancer://myCluser[/StickySessionName]
 BalancerMember http://host1:port [balancer params]
 etc ...
  /Proxy
 
 I just looked at the manual for Proxy - it defines config 
 that is common to a particular part of the URL space (it 
 seems to refer to the backend URL space).


Yes, I saw that too and left the idea of having params inside Proxy
 
 
 I am still mulling over whether using Proxy is a good idea, 
 initially I thought not, but thinking about it some more it's 
 making sense.
 
 The idea of this kind of config seems to work, what do you 
 think? Is this how you've done it?
 
 Proxy balancer://myCluster/myWebapp
ProxyBalancer http://host1:port1/myWebapp
ProxyBalancer http://host2:port2/myWebapp 
 /Proxy


It does not have ProxyBalancer directive but rather BalancerMember (just a
string so easily changeable :)

 
ProxyPass /myWebapp balancer://myCluster/myWebapp stickysession=jsessionid
nofailover=On retry=3


Or just ...
ProxyPass /myOherApp ajp://server:port/myOtherApp min=25 max=75 timeout=2

The Proxy  section is not required.
It can be also written as:

ProxyPass /myClusterApp balancer://myCluster
ProxyBalancer balancer://myCluster http://host1:port1/myWebapp lbfactor=25
ProxyBalancer balancer://myCluster http://host1:port1/myWebapp lbfactor=75


 You can even do funky mixing and matching of protocols inside 
 the load balancer, like this:
 
 Proxy balancer://myCluster/myWebapp
ProxyBalancer ajp://host1:port1/myWebapp
ProxyBalancer http://host2:port2/theServerIsDown
 Proxy

Sure, the mixture is allowed, cause the balancer is not protocol dependant.

MT.


smime.p7s
Description: S/MIME cryptographic signature


Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-03 Thread Graham Leggett
[EMAIL PROTECTED] wrote:
  Allow parsing lbfactor for ProxyPassReverse in the form
  ProxyPassReverse scheme://uri/path(lbfactor).
  The lbfactor is number 1...100 inside braces.
Just a quick note - ProxyPassReverse is for dealing with the conversion 
of Location headers from the backend to the frontend.

A load balancing module should be using it's own directive for this, not 
ProxyPassReverse.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-03 Thread Mladen Turk
 

Graham Leggett wrote:
 
 Just a quick note - ProxyPassReverse is for dealing with the 
 conversion of Location headers from the backend to the frontend.
 
 A load balancing module should be using it's own directive 
 for this, not ProxyPassReverse.


Sure, but it's IMO the proper place for adding loadbalancers (usable only
for reverse proxies).

ProxyPass /url balancer://[stickysessionname | default]/[nofailover]
ProxyPassReverse /url host-1(lbfactor) 
ProxyPassReverse /url host-2(lbfactor)
...
ProxyPassReverse url host-n(lbfactor)

Then I'll merge all the entries with the same url and that will be a
loadbalancer.
Proxy_loadbalance will then maintain those structure runtime params and
fixup balancing factors.

I was thinking to add the balancer:// sheme to the ProxyPass. 

MT.


smime.p7s
Description: S/MIME cryptographic signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-03 Thread Mladen Turk
 

Graham Leggett wrote:
 
 [EMAIL PROTECTED] wrote:
 
Allow parsing lbfactor for ProxyPassReverse in the form
ProxyPassReverse scheme://uri/path(lbfactor).
The lbfactor is number 1...100 inside braces.
 
 Just a quick note - ProxyPassReverse is for dealing with the 
 conversion of Location headers from the backend to the frontend.


Disregard my previous post:

Here is what I meant:


ProxyPass /url balancer:number//[stickysessionname | none]/[nofailover]

ProxyRemote balancer:number ajp|http://host-1(lbfactor)
ProxyRemote balancer:number ajp|http://host-2(lbfactor) ...
ProxyRemote balancer:number ajp|http://host-n(lbfactor)

And (eventually) ...

ProxyPassReverse /url balancer:number
 
 A load balancing module should be using it's own directive for this, 
 not ProxyPassReverse.
 

You may have other ideas perhaps.
Feel free to share them. It's still in early design stage :)

Regards,
MT.


smime.p7s
Description: S/MIME cryptographic signature


Re: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-03 Thread Graham Leggett
Mladen Turk wrote:
Here is what I meant:
ProxyPass /url balancer:number//[stickysessionname | none]/[nofailover]
ProxyRemote balancer:number ajp|http://host-1(lbfactor)
ProxyRemote balancer:number ajp|http://host-2(lbfactor) ...
ProxyRemote balancer:number ajp|http://host-n(lbfactor)
And (eventually) ...
ProxyPassReverse /url balancer:number
 

A load balancing module should be using it's own directive for this, 
not ProxyPassReverse.


You may have other ideas perhaps.
Feel free to share them. It's still in early design stage :)
:)
I have been mulling this over in my head for a bit. What do you think of 
defining a group of load balancing servers that serve requests, such as:

ProxyBalancer myCluster
  BalancerMember host1:port [balancer params]
  BalancerMember host2:port [balancer params]
/ProxyBalancer
Later in the config we then do this:
ProxyPass /myWebapp ajp://myCluster/myWebapp
The balancer params could include things like:
BalancerMember host:port loadfactor=12, dynamic=true
The dynamic=true could mean the backend server(s) will return headers 
that add, or gracefully remove servers from this cluster. Allow this to 
happen.

The balancer app would be technically independant of protocol, however 
some protocols may want to provide the balancer with more information 
about the cluster state. The balancer might provide hooks for this, or 
there might be an official way of updating the balancer scoreboard 
directly from within proxy_http or proxy_ajp.

A simplest case of balancer, in other words in the case where you've 
said connect to host myCluster but myCluster has not been defined, 
fall back to looking up myCluster in DNS.

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


RE: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c

2004-08-03 Thread Mladen Turk
 
Graham Leggett wrote:
 
 I have been mulling this over in my head for a bit. What do 
 you think of defining a group of load balancing servers that 
 serve requests, such as:
 
 ProxyBalancer myCluster
BalancerMember host1:port [balancer params]
BalancerMember host2:port [balancer params] /ProxyBalancer



IMO we could perhaps use exiting Proxy:
Proxy balancer://myCluster
   BalancerMember ajp://host1:port [balancer params]
   etc...
/Proxy

Or..
Proxy balancer://myCluser[/StickySessionName]
   BalancerMember http://host1:port [balancer params]
   etc ...
/Proxy


It will lower the number of additional directives. 

 Later in the config we then do this:
 
 ProxyPass /myWebapp ajp://myCluster/myWebapp
 

OK, but we can better include proper scheme and use :
ProxyPass /myWebapp balancer://myCluster/myWebapp

So that proxy_balancer handler will reply.

Or

ProxyPass /myWebapp2 ajp://host:port/myWebapp2

So that ajp handler gets controll directly.


 The balancer params could include things like:
 
 BalancerMember host:port loadfactor=12, dynamic=true
 

OK. I can do that perhaps only using spaces as delimiters.

MT.


smime.p7s
Description: S/MIME cryptographic signature