httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <rbo...@rcbowen.com>
Subject Re: [users@httpd] Virtual Hosts
Date Sun, 05 Jan 2003 15:34:02 GMT
On Sun, 5 Jan 2003, Selmer Ausland wrote:

> Hello Group;
>
>     I am running Apache 2.0.43 on Win NT 4.0. and I am running a number
> of virtual hosts, all name based. All of the webpages are served up
> normally, but I have a problem.
>
> In my web browser, I can view my domain http://www.abcd.com/
> I can also view www.abcd.com/

Those two things are not different. The browser assumes http://

> However, in my web browser, abcd.com or abcd.com/ gives me a page not
> found error.

That is a different hostname, and must be in DNS as a separate record.
Neither DNS, nor Apache, nor your browser, think of them as being the
same hostname. Make sure that you have an entry in your name server for
both hostnames.

> But, if I enter efgh.com it goes to http://abcd.com (my domain), (not
> http://www.abcd.com ??)

You need to make sure that all possible hostnames are listed in
ServerAlias records. If the hostname does not exactly match, you will
get the default (ie, first) virtual host.

> Below is a sample of my VirtualHost config. Can anyone enlighten me as
> to what I am doing wrong?
>
> Listen 80 (I have also tried Listen xx.xx.xxx.xxx:80)
>
> <VirtualHost *>
>      ServerAdmin webmaster@abcd.com
>      DocumentRoot "E:/Apache2/htdocs"
>      ServerName www.abcd.com
ServerAlias abcd.com

Adding that ServerAlias entry will make it answer to that hostname as
well. That is, assuming that the name correctly resolves in DNS.

Likewise, here:
> <VirtualHost *>
>      ServerAdmin webmaster@efgh.com
>      DocumentRoot "E:/Apache2/htdocs/efgh"
>      ServerName www.efghsqn.com
ServerAlias efghsqn.com

Hope this helps

-- 
Rich Bowen - rbowen@rcbowen.com
As we trace our own few circles around the sun
We get it backwards and our seven years go by like one
	Dog Years (Rush - Test for Echo - 1999)


---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message