title: Improper behavior of Host Alias
body: <p>I have two host alias in my directory structure that fail to properly register with g-wan. My folder structure is as follows:</p>
  
  <blockquote>
    <p>/srv/gwan_linux64-bit/192.168.3.101_80/$dg.lcl <br>
    /srv/gwan_linux64-bit/192.168.3.101_80/$myapp <br>
    /srv/gwan_linux64-bit/192.168.3.101_80/#192.168.3.101 <br>
    /srv/gwan_linux64-bit/192.168.3.101_80/#192.168.3.101:gwan.klickitat.lcl
    <br> /srv/gwan_linux64-bit/192.168.3.101_80/#192.168.3.101:test.lcl
    <br></p>
  </blockquote>
  
  <p>When starting g-wan, I receive the error:</p>
  
  <blockquote>
    <p>loading.........
    * unresolved aliases: 2
    <br></p>
  </blockquote>
  
  <p><br>
  From the sample server report in the default g-wan configuration:</p>
  
  <blockquote>
    <p>Listeners <br> 5 host(s): 192.168.3.101_80 <br> Virtual: $dg.lcl <br>
    Root: #test.lcl <br> Root: #gwan.klickitat.lcl <br> Virtual: $myapp
    <br> Root: #192.168.3.101 <br></p>
  </blockquote>
  
  <p>As you can see, g-wan identifies the two root aliases as additional roots. G-wan only allows a single root host, so the two alias fail to function in the browser with a 404 error. Each of the hosts respond properly to ping, so they are accounted for by the dns. The virtual hosts and root host function as expected.</p>
  
  <p>Thoughts?</p>
  
  <hr>
  
  <h2>Additional research:</h2>
  
  <p>I have corrected my posting error and simplified the presentation. I hope that you will find this to be concise.</p>
  
  <p>My hosts file is as follows for all tests: <br></p>
  
  <blockquote>
    <p>127.0.0.1 localhost.klickitat.lcl localhost  <br>
    192.168.3.101 gwan.klickitat.lcl test.lcl <br></p>
  </blockquote>
  
  <p>I implemented an example that is identical to your test with the exception that I used a different IP address to match my local subnet and I eliminated the virtual hosts, which do not impact my result in my testing. <br><br>
  The only changes to the default gwan configuration are as follows: <br></p>
  
  <ul>
  <li>Changed the listener from 0.0.0.0_8080 to 192.168.3.101_8080</li>
  <li>Changed the root host IP from #0.0.0.0 to #192.168.3.101</li>
  <li>Added two host aliases  #192.168.3.101:gwan.klickitat.lcl and
  #192.168.3.101:test.lcl</li>
  </ul>
  
  <p>This is my folder structure: <br></p>
  
  <blockquote>
    <p>/srv/gwan_linux64-bit/192.168.3.101_8080 <br>
    /srv/gwan_linux64-bit/192.168.3.101_8080/#192.168.3.101 <br>
    /srv/gwan_linux64-bit/192.168.3.101_8080/#192.168.3.101:gwan.klickitat.lcl
    <br> /srv/gwan_linux64-bit/192.168.3.101_8080/#192.168.3.101:test.lcl
    <br></p>
  </blockquote>
  
  <p>This is my result as reported by gwans included server report application:  <br></p>
  
  <blockquote>
    <p>3 host(s): 192.168.3.101_8080 <br> Root:  #test.lcl <br> Root:
     #gwan.klickitat.lcl <br> Root:  #192.168.3.101 <br></p>
  </blockquote>
  
  <p>Gwan does not recognize the aliases and I cannot access the aliased urls. My result is inconsistent with yours. <br> </p>
  
  <p>The rest of this post is intended only to illustrate that aliases are reported by gwan in alternate configurations in my environment, but with some inconsistencies in the expected outcome. I simply identify the folder structure and my result.</p>
  
  <p><strong>Alternate Config 1</strong> <br>
  /srv/gwan_linux64-bit/0.0.0.0_8080 <br>
  /srv/gwan_linux64-bit/0.0.0.0_8080/#localhost <br>
  /srv/gwan_linux64-bit/0.0.0.0_8080/#localhost:gwan.klickitat.lcl <br>
  /srv/gwan_linux64-bit/0.0.0.0_8080/#localhost:test.lcl <br></p>
  
  <p><strong>Result:</strong> <br>
  3 host(s): 0.0.0.0_8080 <br>
  Root:  #localhost <br>
  Alias:  0.0.0.0:#gwan.klickitat.lcl <br>
  Alias:  0.0.0.0:#test.lcl <br></p>
  
  <p><strong>Alternate Config 2</strong> <br>
  /srv/gwan_linux64-bit/192.168.3.101_8080 <br>
  /srv/gwan_linux64-bit/192.168.3.101_8080/#localhost <br>
  /srv/gwan_linux64-bit/192.168.3.101_8080/#localhost:gwan.klickitat.lcl <br>
  /srv/gwan_linux64-bit/192.168.3.101_8080/#localhost:test.lcl <br></p>
  
  <p><strong>Result:</strong> <br>
  3 host(s): 192.168.3.101_8080 <br>
  Root:  #localhost <br>
  Alias:  192.168.3.101:#gwan.klickitat.lcl <br>
  Alias:  192.168.3.101:#test.lcl <br></p>
  
  <p>While the alternate configurations function, note that the aliases naming varies from the explicit naming in the folder structure. It appears that the listeners are being properly set up, but that there is some issue in how the host laiases are being generated. I'm happy to test further if you so desire.</p>