title: getting 404 not found - website with apache2 on ubuntu
body: <p><strong>Background:</strong> </p>
  
  <p>I've installed apache2 and have tried set up virtual directories... but when I try to test the different sites, I keep getting 404 error messages.  </p>
  
  <p>The article /tutorial I've been following is located at:
  <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps" rel="nofollow">https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps</a></p>
  
  <p>I have the following folder structure in place:</p>
  
  <pre><code>/var/www/webtest.com/test.html
  /var/www/ttimes.com/test.php
  </code></pre>
  
  <p>In the /etc/apache2/sites-available folder, I have the following configuration files: </p>
  
  <pre><code>jmj@cp-AOA150:/etc/apache2/sites-available$ ls -lah /var/www/
  total 44K
  drwxr-xr-x  9 root root 4.0K Jul 28 21:37 .
  drwxr-xr-x 15 root root 4.0K Jul 28 19:54 ..
  drwxr-xr-x  2 root root 4.0K May 11  2013 current
  drwxr-xr-x  2 root root 4.0K Apr  3 08:21 html
  -rwxr-xr-x  1 root root  177 Nov 23  2013 index.html
  -rwxr-xr-x  1 root root  124 Jul 28 20:14 test.php
  drwxr-xr-x  5 jmj root 4.0K Jun  6 11:58 ttimes.com
  drwxr-xr-x  2 jmj root 4.0K Jul 28 21:21 webtest.com
  </code></pre>
  
  <p>Here's what the webtest.com.conf file looks like:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin admin@webtest.com
          ServerName webtest.com
          ServerAlias www.webtest.com
          DocumentRoot /var/www/webtest.com
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Here's what my hosts file looks like: </p>
  
  <pre><code>127.0.0.1       localhost
  127.0.1.1       cp-AOA150
  </code></pre>
  
  <p>This is all just on a local dev box where I want to have multiple sites located under /var/www.  Once the site is developed, I'm going to move them to my hosting company. 
  I currently don't have other IP addresses to add, so I skipped the step of adding VPS server IPs.</p>
  
  <p>I am able to successfully run the </p>
  
  <blockquote>
    <p>sudo a2ensite webtest.com.conf</p>
  </blockquote>
  
  <p>command and I restart apache. </p>
  
  <p>But when I go to my site by typing <code>http://localhost/webtest.com/test.html</code>, I get a 404 not found error. </p>
  
  <p>What I've tried so far:
  - I've reviewed the article to make sure I didn't miss any steps. 
  - proved that apache itself is working by going to <code>http://localhost.</code>  When I do that, I get a page that reads: </p>
  
  <pre><code>Index of /
  [ICO]   Name    Last modified   Size    Description
  Apache/2.4.7 (Ubuntu) Server at localhost Port 80
  </code></pre>
  
  <p>Then I stop the apache service and try the same URL.  It fails. </p>