*** ../original_httpd-2.0.39/include/http_core.h        Sun May 12 01:24:29 2002
--- include/http_core.h Sun Jul  7 11:47:04 2002
***************
*** 460,467 ****
  #define USE_CANONICAL_NAME_OFF   (0)
  #define USE_CANONICAL_NAME_ON    (1)
  #define USE_CANONICAL_NAME_DNS   (2)
! #define USE_CANONICAL_NAME_UNSET (3)
!     unsigned use_canonical_name : 2;
  
      /* since is_fnmatch(conf->d) was being called so frequently in
       * directory_walk() and its relatives, this field was created and
--- 460,468 ----
  #define USE_CANONICAL_NAME_OFF   (0)
  #define USE_CANONICAL_NAME_ON    (1)
  #define USE_CANONICAL_NAME_DNS   (2)
! #define USE_CANONICAL_NAME_FIXED (3)
! #define USE_CANONICAL_NAME_UNSET (4)
!     unsigned use_canonical_name : 2;
  
      /* since is_fnmatch(conf->d) was being called so frequently in
       * directory_walk() and its relatives, this field was created and
*** server/core.c.orig  Sun Jul  7 11:03:20 2002
--- server/core.c       Sun Jul  7 11:28:37 2002
***************
*** 891,896 ****
--- 891,901 ----
      core_dir_config *d =
        (core_dir_config *)ap_get_module_config(r->per_dir_config,
&core_module);
  
+         if (d->use_canonical_name == USE_CANONICAL_NAME_FIXED) {
+                                       return 80;
+         }
+         else {
+ 
          if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
              || d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
        
***************
*** 916,921 ****
--- 921,927 ----
                  r->connection->local_addr->port ?
r->connection->local_addr->port :
                  ap_default_port(r);
        }
+               }
  
      /* default */
      return port;
***************
*** 2150,2155 ****
--- 2156,2164 ----
      else if (strcasecmp(arg, "dns") == 0) {
          d->use_canonical_name = USE_CANONICAL_NAME_DNS;
      }
+        else if (strcasecmp(arg, "fixed") == 0) {
+            d->use_canonical_name = USE_CANONICAL_NAME_FIXED;
+        }
      else {
          return "parameter must be 'on', 'off', or 'dns'";
      }

-- 

#========================================================
# This Patch is for Server Cluster which are using only one single 
# Interfaces for the Real Server behing a port mapping Load Balancer.
# -----------------------------------------------------------------------
# -------

Example:
* you have a load balancer with many VIPs listening on Port 80.
* Each VIP redirects his requests to the Real Server Farm on a special
Port:
  www.domain1.com gets mapped to Realserver.farm.com:81
  www.domain2.com gets mapped to Realserver.farm.com:82
  www.domain3.com gets mapped to Realserver.farm.com:83

without this Patch it isn't possible to catch the trailing Slash Problem, 
because a request from the client to:

   http://www.domain1.com/test 

gets redirected to:

   http://www.domain1.com:81/test/

but the Load Balancer only listens at Port 80, because it should be
transparent
for the User.

So you can just use "UseCanonicalName Fixed" and the Server will always
redirect
the Client to Port 80.


Sincerely
Helge Laurisch

Linux: Because rebooting is for adding new hardware.  

Attachment: msg10775/pgp00000.pgp
Description: PGP signature

Reply via email to