You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mark McCulligh <mm...@visualtech.ca> on 2002/12/17 16:53:30 UTC

[users@httpd] Virtual Hosting problem

I am trying to setup VirtaulHosting using names. The problem is when I go to
site1.domain.ca it loads the site fine but when you move around the pages
from the primary site www.domain.ca keep coming up instead of the pages from
site1.domain.ca  Did I declare my site1.domain.ca right?

<VirtualHost 192.168.192.100>
    ServerName        www.domain.ca
    DocumentRoot    /www/domain
    DirectoryIndex    index.php index.html index.htm
</VirtualHost>

<VirtualHost 192.168.192.100>
    ServerName        site1.domain.ca
    DocumentRoot    /www/site1
    DirectoryIndex    index.php index.html index.htm
</VirtualHost>

Thanks, Mark.


---------------------------------------------------------------------
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] Virtual Hosting problem

Posted by Mark McCulligh <mm...@visualtech.ca>.
I  was looking at this example on apache.org

    NameVirtualHost 111.22.33.55

    <VirtualHost 111.22.33.55>
    DocumentRoot /www/otherdomain
    ServerName www.otherdomain.tld
    </VirtualHost>

    <VirtualHost 111.22.33.55>
    DocumentRoot /www/subdomain
    ServerName www.sub.domain.tld
    ServerAlias *.sub.domain.tld
    </VirtualHost>

I want one primary site www.domain.ca with add sub sites. site1.domain.ca,
site2.domain.ca , etc...
Could I add the www to the front of my site1.domain.ca and the ServerAlias?

Mark.

_________________________________________
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
mmcculli@SykesCanada.com
----- Original Message -----
From: "Jon Steer" <jo...@da-group.co.uk>
To: <us...@httpd.apache.org>
Sent: Tuesday, December 17, 2002 11:05 AM
Subject: Re: [users@httpd] Virtual Hosting problem


> Hi Mark,
>
> > I am trying to setup VirtaulHosting using names. The problem is when I
go to
> > site1.domain.ca it loads the site fine but when you move around the
pages
> > from the primary site www.domain.ca keep coming up instead of the pages
from
> > site1.domain.ca  Did I declare my site1.domain.ca right?
> >
> > <VirtualHost 192.168.192.100>
> >     ServerName        www.domain.ca
> >     DocumentRoot    /www/domain
> >     DirectoryIndex    index.php index.html index.htm
> > </VirtualHost>
> >
> > <VirtualHost 192.168.192.100>
> >     ServerName        site1.domain.ca
> >     DocumentRoot    /www/site1
> >     DirectoryIndex    index.php index.html index.htm
> > </VirtualHost>
> >
>
> you setup looks fine as long as you have a NameVirtualHost directive in
the configuration files as well:
>
> NameVirtualHost 192.168.192.100
>
> should do the trick.
>
> Regards
>
> Jon
>
>
>
> ---------------------------------------------------------------------
> 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] Virtual Hosting problem

Posted by Jon Steer <jo...@da-group.co.uk>.
Hi Mark,

> I am trying to setup VirtaulHosting using names. The problem is when I go to
> site1.domain.ca it loads the site fine but when you move around the pages
> from the primary site www.domain.ca keep coming up instead of the pages from
> site1.domain.ca  Did I declare my site1.domain.ca right?
> 
> <VirtualHost 192.168.192.100>
>     ServerName        www.domain.ca
>     DocumentRoot    /www/domain
>     DirectoryIndex    index.php index.html index.htm
> </VirtualHost>
> 
> <VirtualHost 192.168.192.100>
>     ServerName        site1.domain.ca
>     DocumentRoot    /www/site1
>     DirectoryIndex    index.php index.html index.htm
> </VirtualHost>
> 

you setup looks fine as long as you have a NameVirtualHost directive in the configuration files as well:

NameVirtualHost 192.168.192.100

should do the trick.

Regards

Jon



---------------------------------------------------------------------
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] Virtual Hosting problem

Posted by Koen Vingerhoets <ko...@ubench.com>.
Hi!

As far as I know, as you defined both on same IP, the first one has
precedence and will be used.
This however are my two cents and thrown in from very very far.

If you switch them around, your www.domain.ca will not be usable anymore.

Koen


-----Original Message-----
From: Mark McCulligh [mailto:mmcculli@visualtech.ca]
Sent: 17 December 2002 16:54
To: users@httpd.apache.org
Subject: [users@httpd] Virtual Hosting problem


I am trying to setup VirtaulHosting using names. The problem is when I go to
site1.domain.ca it loads the site fine but when you move around the pages
from the primary site www.domain.ca keep coming up instead of the pages from
site1.domain.ca  Did I declare my site1.domain.ca right?

<VirtualHost 192.168.192.100>
    ServerName        www.domain.ca
    DocumentRoot    /www/domain
    DirectoryIndex    index.php index.html index.htm
</VirtualHost>

<VirtualHost 192.168.192.100>
    ServerName        site1.domain.ca
    DocumentRoot    /www/site1
    DirectoryIndex    index.php index.html index.htm
</VirtualHost>

Thanks, Mark.


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