#2544 Apache module slow when using portnumber in NameVirtualHost

1.280
closed
5
2006-06-23
2006-06-23
Anonymous
No

The Apache module index page takes about a minute to
load when:

NameVirtualHost *:80

is used instead of:

NameVirtualHost *

There are only 20 virtualhosts configured.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Webmin was trying to resolve "*:80"

    Please apply this patch to
    /usr/local/lib/webmin/apache/index.cgi

    --- index.cgi.orig Fri Jun 23 14:57:14 2006
    +++ index.cgi Fri Jun 23 14:55:43 2006
    @@ -110,9 +110,14 @@
    # build list of name-based virtual host IP addresses
    @nv = &find_directive("NameVirtualHost", $conf);
    foreach $nv (@nv) {
    - $nv{$nv eq "*" ? "*" : &to_ipaddress($nv)}++;
    + @parts = split(/:/,$nv);
    + if(@parts == 2) {
    + $nv{$parts[0] eq "*" ? "*" :
    &to_ipaddress($parts[0])}++;
    + } else {
    + $nv{$nv eq "*" ? "*" :
    &to_ipaddress($nv)}++;
    }
    }
    +}
    elsif ($httpd_modules{'core'} >= 1.2) {
    # only one name-based virtual host IP address - the
    default address
    $ba = &find_directive("ServerName", $conf);

     
  • Nobody/Anonymous

    Logged In: NO

    Alternative patch:

    --- index.cgi.orig Fri Jun 23 15:24:47 2006
    +++ index.cgi Fri Jun 23 15:22:48 2006
    @@ -110,6 +110,7 @@
    # build list of name-based virtual host IP addresses
    @nv = &find_directive("NameVirtualHost", $conf);
    foreach $nv (@nv) {
    + $nv =~ s/:[0-9]+$//;
    $nv{$nv =~ m/(^\*(|:[0-9]+)$)/ ? "*" :
    &to_ipaddress($nv)}++;
    }
    }

     
  • Jamie Cameron

    Jamie Cameron - 2006-06-23

    Logged In: YES
    user_id=129364

    Thanks .. i will include this fix in the next release.

     
  • Jamie Cameron

    Jamie Cameron - 2006-06-23
    • status: open --> closed
     

Log in to post a comment.