title: using domain name in localhost
body: <p>i have problem to using domain name in localhost<br>
  i'm using <code>windows 8.1 64 bit</code> and my xampp in <code>drive F</code></p>
  
  <p>i'm already edit <code>httpd.conf</code> in <code>F:\xampp\apache\conf</code> to load vhost</p>
  
  <pre><code># Virtual hosts
  Include conf/extra/httpd-vhosts.conf
  </code></pre>
  
  <p>already edit too <code>httpd-vhosts.conf</code> in <code>F:\xampp\apache\conf\extra</code></p>
  
  <pre><code>NameVirtualHost *:80
  &lt;VirtualHost *:80&gt;
     DocumentRoot "F:/xampp/htdocs/itklan/public/"
     ServerName mydomain.dev
     ServerAlias mydomain.dev
       &lt;Directory "F:/xampp/htdocs/itklan/public/"&gt;
          Order allow,deny
          Allow from all
       &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>i'm adding to <code>host</code> in <code>C:\Windows\System32\drivers\etc</code></p>
  
  <pre><code># For example:
  #
  #      102.54.94.97     rhino.acme.com          # source server
  #       38.25.63.10     x.acme.com              # x client host
  
  # localhost name resolution is handled within DNS itself.
  #   127.0.0.1       localhost
  #   ::1             localhost
      127.0.0.1       mydomain.com
  </code></pre>
  
  <p>already restart <code>apache</code>...and i even restart my windows</p>
  
  <p>but i still get something like this in google chrome</p>
  
  <pre><code>This webpage is not available
  ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>hm where i'm missing?<br>
  <em>ps : i still can access <code>http://localhost:8080/itklan/public/</code> normaly</em></p>
  
  <hr>
  
  <p><strong>update</strong></p>
  
  <p>when i try to ping <code>mydomain.dev</code> it's success receiving all data from my localhost ip like this</p>
  
  <p><a href="https://i.stack.imgur.com/skSEG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/skSEG.png" alt="enter image description here"></a></p>
  
  <p>and i test to run 127.0.0.1 it's showing </p>
  
  <pre><code>This webpage is not available
  ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>of cource because i change my apache port to <code>8080</code> and mysql port to <code>4433</code><br>
  so it's should 127.0.0.1:8080 to open xampp home page </p>
  
  <p>based on <a href="https://serverfault.com/a/246474/277709">this</a> page -> <em>thanks to abdula</em> <br>
  i try to edit 'httpd-vhosts.conf' and make it listen port 8080<br>
  but when i add script <code>Listen 8080</code> my apache wont run again<br>
  i tried to change that script to <code>Listen 80</code> and it's make my apache can running again. i notice if apache open ports now become 3 <code>(80, 8080, 4433)</code>
  so i guess i don't need to add <code>Listen 8080</code> again because my apache already listen to that port<br>
  so i just changed the rest like this</p>
  
  <pre><code>NameVirtualHost *:8080
  &lt;VirtualHost *:8080&gt;
     DocumentRoot "F:/xampp/htdocs/itklan/public/"
     ServerName mydomain.dev
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>and in <code>hosts file</code></p>
  
  <pre><code># For example:
  #
  #      102.54.94.97     rhino.acme.com          # source server
  #       38.25.63.10     x.acme.com              # x client host
  
  # localhost name resolution is handled within DNS itself.
  #   127.0.0.1       localhost
  #   ::1             localhost
      127.0.0.1  mydomain.dev
  </code></pre>
  
  <p>but it's still same</p>