|
Home > Archive > Apache Server configuration support > February 2006 > two vhost problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| misiek 2006-02-14, 6:02 pm |
| I got two domain registered for example with networksolutions.com which
are...
firstdomain.com and IP 111.111.11.111
seconddomain.com and IP 111.111.11.111
my vhosts looks like
01_firstdomain.com_vhost.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/firstdomain.com
Servername firstdomain.com
</VirtualHost>
and
02_seconddomain.com_vhost.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/seconddomain.com
Servername seconddomain.com
</VirtualHost>
and /etc/hosts
111.111.11.111 firstdomain.com
111.111.11.111 seconddomain.com
I was trying <VirtualHost 111.111.11.111:80> also
now should works ? or not ? because it does not ...
what I need to get it works ?
OS gentoo
net-www/apache-2.0.54-r31
| |
| Davide Bianchi 2006-02-14, 6:02 pm |
| On 2006-02-14, misiek <michaelaugustyniak@gazeta.pl> wrote:
> my vhosts looks like
>
> 01_firstdomain.com_vhost.conf
And do you have a NameVirtualHost *:80 somewhere in your httpd.conf?
Because if you don't, the VHost are not used.
><VirtualHost *:80>
> ServerAdmin webmaster@localhost
> DocumentRoot /home/ftp/workspace/firstdomain.com
> Servername firstdomain.com
></VirtualHost>
Usually, after the DocumentRoot, you should have a <Directory> block with
the details of what to do with the Docroot.
Davide
--
C:\WINDOWS>DEL *.*
I feel better now.
| |
| misiek 2006-02-14, 6:02 pm |
| Davide Bianchi wrote:
> On 2006-02-14, misiek <michaelaugustyniak@gazeta.pl> wrote:
>
>
>
> And do you have a NameVirtualHost *:80 somewhere in your httpd.conf?
> Because if you don't, the VHost are not used.
>
>
yea wneh I put NameVirtualHost to that files I got a message
[Tue Feb 14 13:10:35 2006] [error] VirtualHost www.seconddomain.com:0 --
mixing * ports and non-* ports with a NameVirtualHost address is not
supported, proceeding with undefined results
[Tue Feb 14 13:10:35 2006] [error] VirtualHost www.firstdomain.com:0 --
mixing * ports and non-* ports with a NameVirtualHost address is not
supported, proceeding with undefined results
[Tue Feb 14 13:10:35 2006] [warn] NameVirtualHost 111.111.11.111:80 has
no VirtualHosts
NameVirtualHost 111.111.11.111:80
<VirtualHost www.firstdomain.com>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/firstdomain.com
Servername www.firstdomain.com
</VirtualHost>
~
NameVirtualHost 111.111.11.111:80
<VirtualHost www.seconddomain.com>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/seconddomain.com
Servername www.seconddomain.com
</VirtualHost>
| |
|
|
| misiek 2006-02-14, 6:02 pm |
| Robert Ionescu wrote:
> try to append the port www.firstdomain.com:80 like
>
> NameVirtualHost 111.111.11.111:80
> <VirtualHost www.firstdomain.com:80>
> ServerAdmin webmaster@localhost
> DocumentRoot /home/ftp/workspace/firstdomain.com
> Servername www.firstdomain.com
> </VirtualHost>
>
> NameVirtualHost 111.111.11.111:80
> <VirtualHost www.seconddomain.com:80>
> ServerAdmin webmaster@localhost
> DocumentRoot /home/ftp/workspace/seconddomain.com
> Servername www.seconddomain.com
> </VirtualHost>
>
no I got that message
[Tue Feb 14 13:28:33 2006] [warn] NameVirtualHost
www.seconddomain.com:80 has no VirtualHosts
why only second whh\en firsdomain is configured the same
before that on short time was wroking now it does not ??
| |
|
| On Tue, 14 Feb 2006 13:14:14 -0600, misiek wrote:
> Davide Bianchi wrote:
>
> yea wneh I put NameVirtualHost to that files I got a message
>
>
> [Tue Feb 14 13:10:35 2006] [error] VirtualHost www.seconddomain.com:0 --
> mixing * ports and non-* ports with a NameVirtualHost address is not
> supported, proceeding with undefined results
> [Tue Feb 14 13:10:35 2006] [error] VirtualHost www.firstdomain.com:0 --
> mixing * ports and non-* ports with a NameVirtualHost address is not
> supported, proceeding with undefined results
> [Tue Feb 14 13:10:35 2006] [warn] NameVirtualHost 111.111.11.111:80 has
> no VirtualHosts
>
> NameVirtualHost 111.111.11.111:80
> <VirtualHost www.firstdomain.com>
> ServerAdmin webmaster@localhost
> DocumentRoot /home/ftp/workspace/firstdomain.com
> Servername www.firstdomain.com
> </VirtualHost>
>
> ~
>
> NameVirtualHost 111.111.11.111:80
> <VirtualHost www.seconddomain.com>
> ServerAdmin webmaster@localhost
> DocumentRoot /home/ftp/workspace/seconddomain.com
> Servername www.seconddomain.com
> </VirtualHost>
OK, this is thae way I do it, and I seem to be permanently answering this
one!
1. Set up either yout local dns or /etc/hosts so that www.firstdomain.com
and www.seconddomain.com resolve to 111.111.11.111 ( personally, I'd use a
proper non-routable IP address, not this ).
In the httpd.conf, use the following section:
NameVirtualHost 111.111.11.111:80
<VirtualHost www.firstdomain.com>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/firstdomain.com
Servername www.firstdomain.com
</VirtualHost>
<VirtualHost www.seconddomain.com>
ServerAdmin webmaster@localhost
DocumentRoot /home/ftp/workspace/seconddomain.com
Servername www.seconddomain.com
</VirtualHost>
Note that there's only one NameVirtualHost statement. If this starts up
cleanly, then it should work!
I think the only mistake in httpd.conf is the extra NameVirtualHost,
which defines separate blocks of virtual hosts.
Steve
|
|
|
|
|