It seems to me that while you have defined the document root for each VH, you have not defined the directory access for  each host.
See my attachment which is similar to what I use in Apache2 on this Windoze machine and also in Apache 1.3 on my Linux server.
 
Hope this helps,
Trevor
----- Original Message -----
From: Rob Wood
To: CLUG
Sent: Thursday, January 20, 2005 10:15 PM
Subject: Apache 2

Greetings,
I have been having major problems with Apache, running a main server and two virtual hosts.
 
I have been through the Apache documentation with a fine tooth comb and as far as I can see my cofiguration should work. It works OK when accessing the main server from outside, but when I try to access the virtual hosts, they all default to the main server.
 
The best I have managed so far is to run the main server and 1 virtual host, using the _default_vhost directive on a separate port. With this setup, I managed to access 2 of the sites, but then that leaves 1 site out of the setup.
 
Assuming that the first 2 sections of the httpd.conf are correct, as it is as the default except that I entered the basic main server information, then the 3rd section, Virtual Hosts must be causing the problem.
 
I have therefore attached the VHost section of the httpd.conf to keep the e-mail concise. If anyone can point me in the right direction I would be grateful.
 
I have unfortunately had to run my commercial site on Win2000 and IIS to stay online for now so none of my 3 sites can be accessed via Apache just now.
 
Woodsey


No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.1 - Release Date: 19/01/2005
###### SECTION 3 VIRTUAL HOSTS ######
############################################################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
#
#Use name-based virtual hosting.
NameVirtualHost *:80
NameVirtualHost 192.168.1.9:80
#
#
###### VIRTUAL HOST 00 NO KNOWN SERVER NAME ######
#
<VirtualHost *:80>
ServerAdmin [EMAIL PROTECTED]
ServerName website01.domainA.com
DocumentRoot "F:/websites/website01"
</VirtualHost>
#
###### VIRTUAL HOST 01 ######
#
<VirtualHost 192.168.1.9:80>
ServerAdmin [EMAIL PROTECTED]
ServerName website01.domainA.com
ServerAlias website01.domainA.com www.website01.domainA.com
DocumentRoot "F:/websites/website01"
<Directory "F:/websites/website01">
    Options Includes Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
ErrorLog logs/log01/error.log
CustomLog logs/log01/access.log
</VirtualHost>
#
###### VIRTUAL HOST 02 ######
#
<VirtualHost 192.168.1.9:80>
ServerAdmin [EMAIL PROTECTED]
ServerName website02.domainB.com
ServerAlias website02.domainB.com www.website02.domainB.com
DocumentRoot "F:/websites/website02"
<Directory "F:/websites/website02">
    Options Includes Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
ErrorLog logs/log02/error.log
CustomLog logs/log02/access.log
</VirtualHost>
#
#
###### VIRTUAL HOST 03 ######
#
<VirtualHost 192.168.1.9:80>
ServerAdmin [EMAIL PROTECTED]
ServerName website03.domainC.com
ServerAlias website03.domainC.com www.website03.domainC.com
DocumentRoot "F:/websites/websiteC"
<Directory "F:/websites/websiteC">
    Options Includes Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
ErrorLog logs/log03/error.log
CustomLog logs/log03/access.log
</VirtualHost>
#
#
###### VIRTUAL HOST 04 ######
#

Reply via email to