Bug 59962 - Tux module does not work as documented for mass hosting
Tux module does not work as documented for mass hosting
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-15 20:17 EST by whn
Modified: 2007-04-18 12:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-18 06:28:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description whn 2002-02-15 20:17:17 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.9-21 i686; Nav)

Description of problem:
In kernel-2.4.9-21, the tux module behavior does not match what the
documentation in tux-2.2.0-1 says the behavior for mass_hosting_hash
is documented to do (or on 
http://www.redhat.com/docs/manuals/tux/TUX-2.1-Manual/virtual-hosting.html). 
The documentation says:

 If the value is set to 0, mass_hosting_hash is disabled. 

 If the value is set to 1: 
http://www.some.site.com/a.html => docroot/s/some.site.com/a.html

 If the value is set to 2: 
http://www.some.site.com/a.html => docroot/s/so/some.site.com/a.html

 If the value is set to 3: 
http://www.some.site.com/a.html => docroot/s/so/som/some.site.com/a.html

The reality (both according to the source code and experimentation is:
0 disable mass hosting
1 maps to docroot/s/so/some.site.com/a.html
2 maps to docroot/s/so/som/some.site.com/a.html
3 maps to docroot/some.site.com/a.html

Please fix the source code and keep the functionality described by the
documentation.  Please see patch included in this bug report.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Setup tux with:
   echo 1 > /proc/sys/net/tux/virtual_server
   echo 1 > /proc/sys/net/tux/mass_hosting_hash
   Create a directory tree with all the various designs and try it out.
2. Read /usr/src/linux-2.4.9-21/net/tux/proto_http.c lines 1429 - 1461
3.
	

Additional info:

Here is a fix:

--- net/tux/proto_http.c.orig   Fri Feb 15 20:01:54 2002
+++ net/tux/proto_http.c        Fri Feb 15 20:03:02 2002
@@ -1431,6 +1431,15 @@
                case 0:
                        return req->host;
                case 1:
+                       // www.ABCDEFG.com => A/ABCDEFG.com
+
+                       tmp[0] = req->host[0];
+                       tmp[1] = '/';
+                       memcpy(tmp + 2, req->host, req->host_len);
+                       tmp[req->host_len + 2] = 0;
+
+                       return tmp;
+               case 2:
                        // www.ABCDEFG.com => A/AB/ABCDEFG.com

                        tmp[0] = req->host[0];
@@ -1442,7 +1451,7 @@
                        tmp[req->host_len + 5] = 0;

                        return tmp;
-               case 2:
+               case 3:
                        // www.ABCDEFG.com => A/AB/ABC/ABCDEFG.com

                        tmp[0] = req->host[0];
Comment 1 Ingo Molnar 2003-02-18 06:28:08 EST
oops - this patch fell through the cracks. Patch applied.

Note You need to log in before you can comment on or make changes to this bug.