You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Yves Arsenault <yv...@carrefour.peicaps.org> on 2003/06/23 15:05:47 UTC

[users@httpd] Virtualhost question

Hello,

I have a server that I have set up running Apache 1.3.26

I have one site that I set up a while back that seems to work fine....

I have just set up another domain name to point to my server last friday.
This morning I modified my Vhosts.conf file so that there is a new Virtual
Host.

But now when I type the new domain (site No2) in my browser, it points to
site No1.
Also, when I type in my server's IP address, I get site No1. When I should
be getting my server's default webpage.

This is what I have in my Vhosts.conf file..
#domain1.com
<VirtualHost ip>
ServerName www.domain1.com
ServerPath /www
DocumentRoot /var/www/domain1.com/www
</VirtualHost>

#domain2.com
<VirtualHost ip>
ServerName www.domain2.com
ServerPath /www
DocumentRoot /var/www/domain2.com/www
</VirtualHost>

Any ideas?

Thanks,

Yves Arsenault
Carrefour Infotech
5,promenade Acadian
Charlottetown, IPE
C1C 1M2
yves@carrefour.peicaps.org
(902)368-1895 ext.242
ICQ #117650823


---------------------------------------------------------------------
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


RE: [users@httpd] Virtualhost question

Posted by Yves Arsenault <yv...@carrefour.peicaps.org>.
Thanks for the reply,

My NameVirtualHost was not properly identified.

I also removed the ServerPath.

It works now.

Thanks again,

Yves Arsenault
Carrefour Infotech
5, Acadian Dr.
Charlottetown, PEI
C1C 1M2
yves@carrefour.peicaps.org
(902)368-1895 ext.242
ICQ #117650823

-----Original Message-----
From: Robert Andersson [mailto:robert@profundis.nu]
Sent: June 23, 2003 10:21 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Virtualhost question


Yves Arsenault wrote:
> But now when I type the new domain (site No2) in my browser, it points to
> site No1.
> Also, when I type in my server's IP address, I get site No1. When I should
> be getting my server's default webpage.

This is related. If you define a virtual host section, the first virtual
host becomes your "default server"; the main configuration only serves as
default settings for your virtual hosts. When Apache can't identify which
virtual host to serve from, it will serve from the first virtual host
specified in the configuration.

> This is what I have in my Vhosts.conf file..
> #domain1.com
> <VirtualHost ip>
> ServerName www.domain1.com
> ServerPath /www
> DocumentRoot /var/www/domain1.com/www
> </VirtualHost>
>
> #domain2.com
> <VirtualHost ip>
> ServerName www.domain2.com
> ServerPath /www
> DocumentRoot /var/www/domain2.com/www
> </VirtualHost>

I'm not sure you understand what ServerPath do, while setting it to the same
value for all hosts render it useless, so you should probably remove it.

I assume you are doing name-based virtual hosting. If so, do you have a
"NameVirtualHost <ip> or *" directive above the virtual host sections? And,
you should use an asterisk in the VirtualHost directives instead of the IP
address, unless you're doing an advanced setup.

Regards,
Robert Andersson


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


Re: [users@httpd] Virtualhost question

Posted by Robert Andersson <ro...@profundis.nu>.
Yves Arsenault wrote:
> But now when I type the new domain (site No2) in my browser, it points to
> site No1.
> Also, when I type in my server's IP address, I get site No1. When I should
> be getting my server's default webpage.

This is related. If you define a virtual host section, the first virtual
host becomes your "default server"; the main configuration only serves as
default settings for your virtual hosts. When Apache can't identify which
virtual host to serve from, it will serve from the first virtual host
specified in the configuration.

> This is what I have in my Vhosts.conf file..
> #domain1.com
> <VirtualHost ip>
> ServerName www.domain1.com
> ServerPath /www
> DocumentRoot /var/www/domain1.com/www
> </VirtualHost>
>
> #domain2.com
> <VirtualHost ip>
> ServerName www.domain2.com
> ServerPath /www
> DocumentRoot /var/www/domain2.com/www
> </VirtualHost>

I'm not sure you understand what ServerPath do, while setting it to the same
value for all hosts render it useless, so you should probably remove it.

I assume you are doing name-based virtual hosting. If so, do you have a
"NameVirtualHost <ip> or *" directive above the virtual host sections? And,
you should use an asterisk in the VirtualHost directives instead of the IP
address, unless you're doing an advanced setup.

Regards,
Robert Andersson


---------------------------------------------------------------------
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