You really only need one virtual host, but with several aliases.  I
assume PHP is taking care of reading the host headers to know whether
it should serve site A or Site B's content.  Like so:

<VirtualHost 192.168.1.10:80>
        ServerName   siteA.com:80
        ServerAlias  siteB.com
        ServerAlias siteC.com
        UseCanonicalName Off
        DocumentRoot /www/website/htdocs
</VirtualHost>

However, if you want separate log files for each, then you'd want
separate virtual hosts (all with the same DocumentRoot:

<VirtualHost 192.168.1.10:80>
        ServerName   siteA.com:80
        UseCanonicalName Off
        DocumentRoot /www/website/htdocs
        ErrorLog /www/website/logs/siteA_error.log
        CustomLog  /www/website/logs/siteA_access.log combined
</VirtualHost>

<VirtualHost 192.168.1.10:80>
        ServerName   siteB.com:80
        UseCanonicalName Off
        DocumentRoot /www/website/htdocs
        ErrorLog /www/website/logs/siteB_error.log
        CustomLog  /www/website/logs/siteB_access.log combined
</VirtualHost>


I hope this helps.

Sean

On 11/14/05, George Pitcher <[EMAIL PROTECTED]> wrote:
> > > This isn't a website with three sub-directories. Its actually
> > five websites
> > > that use the same directory and it isn't the document root.
> > >
> > > When the user come in with the url
> > 'http://www.website.com/site_a/' it takes
> > > them to 'home.php' which breaks down the url and loads the config file
> > > according to the site. This makes site maintenance much easier
> > for me as I
> > > only have one set of templates and scripts to maintain for the
> > five sites.
> > >
> > > Hope this clarifies things.
> >
> > Not really.  Your message is still subject to many different
> > interpretations.  But if the "config file" that you speak of is the
> > php config file, then you should consider taking your question to the
> > php list.
> >
> Joshua,
>
> It isn't a PHP issue. On IIS, I set a virtual site called 'site_a' and
> specify which folder was going to be used. I then set up another 4 virtual
> sites with their own names and they all point to the same folder. I want to
> know how to do that with Apache2. In time, with some success on the sales
> side, I could have hundreds of sites pointing to this folder. PHP simply
> takes car of serving up the appropriate images, admin details etc on a per
> site basis.
>
> Cheers
>
> George
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: [EMAIL PROTECTED]
>    "   from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to