<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi William.<br>
    <br>
    On 6/4/2012 12:44 PM, William Thackrey wrote:
    <blockquote
      cite="mid:1F7F4A67-F2BA-48B4-99B9-E5283B16DDC4@gmail.com"
      type="cite">
      <pre wrap="">If we enter a new web alias or change the web alias in the BlueOnyx Virtual Site::Services::Web page, the vHost file (i.e site1) in /etc/httpd/conf/vhosts is written correctly.  However, if we clear the Web Server Aliases field, the vSite file does not get re-writen to reflect the change.  That is, a "null" entry in the field should clear the aliases in the vHost file.  It does not.  The previous entries remain.  Deleting or renaming the vHost file causes it to be written correctly.
</pre>
    </blockquote>
    <br>
    I replicated what you were doing. In the log file, 99% of the logs
    are identical... There are some differences when you add an alias
    compared to deleting an alias.<br>
    <br>
    <b>Add an alias</b><br>
    Jun  5 06:57:00 node2 cced(smd)[x]: client 6:[y]: SET  98
    "webAliases" "=" "&x.com&" "webAliasRedirects" "=" "1"<br>
    Jun  5 06:57:00 node2 cced(smd)[x]: client
    6:handlers/base/vsite/change_net_info.pl: SET  104 fqdn =
    "www2.compassnetworks.com.au" webAliases = "&x.com&" ipaddr
    = "203.26.211.122"<br>
    Jun  5 06:57:00 node2 cced(smd)[x]: client
    6:handlers/base/vsite/change_net_info.pl: SET succeeded<br>
    <br>
    <b>Clear alias</b><br>
    Jun  5 06:57:00 node2 cced(smd)[x]: client 6:[y]: SET  98
    "webAliases" "=" "" "webAliasRedirects" "=" "1"<br>
    <br>
    change_net_info.pl is the trigger to update the alias file for a
    vsite. The line below is from this file:<br>
    <br>
    <b><u>change_net_info.pl</u>: if ($vsite_new->{ipaddr} ||
      $vsite_new->{fqdn} || $vsite_new->{webAliases})</b><br>
    <br>
    This IF statement appears to be our smoking smoking gun. What is
    this IF statement actually doing? $vsite_new is an object that
    contains only CHANGED fields. If we change an IP address, the new
    address will be in $vsite_new->{ipaddr}. If this field is not
    changed, that will be empty. Same goes for FQDN. Both of those
    fields are mandatory, so they will never be empty. However,
    webAliases is optional. When we clear that field, it will be an
    empty value. This if statement thinks nothing has changed requiring
    an update to the alias file whenever we clear the alias.<br>
    <br>
    <b>Solution:</b><br>
    I had a look at the triggers for this handler. There are three
    variables in the associated conf file.<br>
    <blockquote><i># handle configuration of various things<br>
        Vsite.fqdn      perl:base/vsite/change_net_info.pl     
        CONFIGURE<br>
        Vsite.ipaddr    perl:base/vsite/change_net_info.pl     
        CONFIGURE<br>
        Vsite.webAliases        perl:base/vsite/change_net_info.pl     
        CONFIGURE<br>
      </i></blockquote>
    If the handler is only triggered whenever we update fqdn, ipaddr, or
    webAliases .... we can just comment out that if statement totally...
    because one of those things will change each and every time that
    handler runs. I've tested this on my box and it looks good to me.<br>
    <br>
    Michael... Are you happy with that fix? The only issue would be if
    we add other triggers to that handler in future other than the three
    above. <br>
    <br>
    Regards,<br>
    Greg.<br>
  </body>
</html>