0
votes

I'm working on 2 different sites. I have local copies of them checked out from SVN at my home folder, and symbolic links in /var/www pointing to them. I've set up virtual hosts in httpd.conf like this:

<VirtualHost *:80>
    DocumentRoot /var/www/siteA
    ServerName 192.168.0.10/siteA

    <Directory "/var/www/siteA">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
   </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/siteB
    ServerName 192.168.0.10/siteB

    <Directory "/var/www/siteB">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I would like to be able to access the sites with 192.168.0.10/siteA and /siteB, but when typing the address in browser, it throws a 404 and apache error log says: "File does not exist: /var/www/siteA/siteA".

What am I doing wrong and where does the second "/siteA" come from?

1

1 Answers

0
votes

You've got too much configuration in there. /SiteA and /SiteB should be paths relative to your site root, you can't have different sites on the same host header, which in this case is "192.168.0.10". If you want to bind that address to the configuration, something along the lines of the following should work.

    <VirtualHost 192.168.0.10:80>
      DocumentRoot /var/www
      ServerName 192.168.0.10

      <Directory "/var/www">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
      </Directory>
    </VirtualHost>

If you now browse to /SiteA, /SiteB you should see the contents of your directory as long as your symlinks are correct. You also need to ensure you have the "NameVirtualHost" directive set correctly in your httpd.conf.