Hi,

I compared revision 1.52 of jk/native2/server/apache2/mod_jk2.c to my 
current version.

I currently use the following code to distingquish between different 
virtual hosts:

static int jk2_translate(request_rec *r)
{
    ...

    char vhost_port_buf[1024];
    char *vhost_port;
           
    ...

    if (r->server->is_virtual) {
      snprintf(vhost_port_buf, sizeof(vhost_port_buf), "%s:%u",
               r->server->server_hostname, r->server->port);
      vhost_port = vhost_port_buf;
    }
    else vhost_port = NULL;

    uriEnv = workerEnv->uriMap->mapUri(env, 
workerEnv->uriMap,vhost_port,r->uri );

    ...

}


This code allows to distinguish between different hosts when the server 
name is the same
and only port number is different.

In workers2.properties I now use:

[uri:host1.net:80]
info=host1.net hostname definition.

[uri:host2.net:80]
info=host2.net hostname definition.

#Now you can make all the mappings

[uri:host1.net:80/*.jsp]
info=host1.net extension mapping.
worker=ajp13:localhost:8009

[uri:host2.net:80/*.jsp]
info=host2.net extension mapping.
worker=ajp13:localhost:8013


I have checked-out revision 1.52 from CVS. Though it tells in history:

revision 1.52
date: 2002/09/22 09:35:46;  author: mturk;  state: Exp;  lines: +2 -2
Cannot use the hostname:server_port cause the port is 0 for all
host:80 requests. Also is_virtual is used for separating default and
virtual hosts. In case of default server host the hostname provided
to uriMap _MUST_ be NULL to be able to map the default uri:/


I do not see the fix this it in this revision.

Dmitry


Mladen Turk wrote:

>
> Could you guys thest against the current CVS.
>
> > -----Original Message-----
> > From: Dom [mailto:[EMAIL PROTECTED] ]
> >
> > [uri:/host1.net/*.jsp]
> > info=host1.net default context.
> > group=lb
> > debug=0
> >
> > [uri:/host2.net/*.jsp]
> > info=host2.net default context.
> > group=lb
> > debug=0
> >
>
> This is wrong!!!
> All the host definition _must_ not start with the forward slash.
> So... HOSTNAME/URI (this is how we figure out what is the host and what
> is the uri).
>
> Correct one would be:
>
> [uri:host1.net]
> info=host1.net hostname definition.
>
> [uri:host2.net]
> info=host2.net hostname definition.
>
> #Now you can make all the mappings
>
> [uri:host1.net/*.jsp]
> info=host1.net extension mapping.
>
> [uri:host2.net/*.jsp]
> info=host2.net extension mapping.
>
>
>
> MT.
>




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

Reply via email to