httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] VirtualHost HELP!
Date Thu, 17 Apr 2003 08:00:41 GMT
Plain text please..

I had a quick look at your config and it seems reasonably OK - you have
a NameVirtualHost directive and your VH blocks look OK. However, if you
separate out the important parts of the config, you get:

<outside VH>
DocumentRoot "C:/CHMS_Site"

  DocumentRoot "C:/CHMS_Site/EM"
  DocumentRoot "C:/CHMS_Site"

- The VH ServerNames do not begin "www." - is this intentional? Do you
really want the sites to be and (Guess you do - they work :-)
- the first block acts as a kind of "default" server, but it has the
same docroot as VH2. Hmmm... Not sure why you'd want this.
- VH1's docroot is a sub-dir of VH2's docroot. This means that and lead to the same file. Is this

I think the last point might be the root of your trouble - most of the
time, different VHs access separate branches of the filesystem, e.g. VH1
-> /home/html/vh1_data, VH2 -> /home/html/vh2_data etc. There is nothing
wrong with having different VHs come in at different levels on the same
filesystem but it would certainly make your internal <img> and <a href>
tags complicated. I notice that in the pages you use relative URLs to
images (e.g. <img src="images/blankdot.gif"> so this would mean that for
your two VHs to work, you'd need two images directories,
C:/CHMS_Site/EM/images and C:/CHMS_Site/images. Do you have that?

I would suggest the following:

- Tidy up the config; put all site specific directives inside VHs and
use ServerAlias, e.g.

  DocumentRoot "C:/CHMS_Site"
  DocumentRoot "C:/CHMS_Site/EM"

N.B. put your default VH first - if apache comes in with the correct IP
address but can't match the ServerName, it takes the first one it finds.

- Put all the images in one directory, e.g. C:/CHMS_Site/images in VH1.
Then use an Alias in VH2 to map to it:

	Alias /images C:/CHMS_Site/images

This way, and lead to the same file, even
though the VHs have different docroots. Now you can reference images
throughout both sites with *absolute* URLS, e.g. <img
src="/images/blankdot.gif"> (N.B. The leading "/" on the file path!)

Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

-----Original Message-----
From: Webmaster []
Sent: Mittwoch, 16. April 2003 21:32
Subject: [users@httpd] VirtualHost HELP!

I have set up a few Apache Servers, all on Windows 2000 machines, and
all successfully using VirtualHost.

I am moving a site from hosting at one server to a new server running on
Windows XP Pro.

I can not getting the VirtualHost to work correctly.

I am running Apache 2.0.45 with PHP 4.3.0, on a windows XP Pro machine.

Basically I am trying to host two sites, and the VirtualHosts, are
"bleeding" together, pulling the index.html file from the wrong document
root, but the correct image from the correct document root. 

I have tried virtually every deviation of NameServer address, using IP
Address within VirtualHost tags, Using IP and Port within VirtualHost
tags, Using * within VirtualHost tags.  I have also tried using
ApacheConf, and recreating the conf file from scratch.

I am at a total loss here...

Any, and I mean ANY ideas would be greatly appreciated!

Please feel free to view my http.conf file at

Thanks in advance for any suggestions!

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message