title: Apache 2 Sites-Available Configuration
body: <p>I am trying to write about 5 websites all on one Apache server which is all on one IP address.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>/var/www/site1 </li>
  <li>/var/www/site2</li>
  <li>/var/www/site3</li>
  <li>/var/www/site4</li>
  <li>/var/www/site5</li>
  </ul>
  
  <p>However, if I create a link on site 2 just using, for example. /index.php, you would expect it to look in /var/www/site2/index.php... but it actually resolves to /var/www/index.php.</p>
  
  <p>Is there anyway of setting up Apache to know that the separate site folders need to behave and resolve to the separate folders?</p>
  
  <p>This is my sites-available file at the moment. A fairly default setup I believe:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
  
      DocumentRoot /var/www
      &lt;Directory /&gt;
              Options FollowSymLinks
              AllowOverride None
      &lt;/Directory&gt;
      &lt;Directory /var/www/&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride all
              Order allow,deny
              allow from all
      &lt;/Directory&gt;
  
      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      &lt;Directory "/usr/lib/cgi-bin"&gt;
              AllowOverride None
              Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
              Order allow,deny
              Allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/error.log
  
      # Possible values include: debug, info, notice, warn, error, crit,
      # alert, emerg.
      LogLevel warn
  
      CustomLog /var/log/apache2/access.log combined
  
  Alias /doc/ "/usr/share/doc/"
  &lt;Directory "/usr/share/doc/"&gt;
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order deny,allow
      Deny from all
      Allow from 127.0.0.0/255.0.0.0 ::1/128
  &lt;/Directory&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help would be apreciated.</p>
  
  <p>Thank-you kindly.</p>
  
  <p>Andrew Barlow</p>