You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Basil Mohamed Gohar <ab...@hidayahonline.org> on 2009/05/01 16:44:28 UTC
[users@httpd] Default server is overridden by first VirtualHost
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have my local machine configured as the following:
beta <- default server
x <- vhost1 (with aliases y & z)
When I access the webserver using the name "beta", it loads x, which is
the first VirtualHost.
The output of apachectl -S is as follows:
[basilgohar@beta ~]$ apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server x (/etc/httpd/conf/httpd.conf:1005)
port 80 namevhost x (/etc/httpd/conf/httpd.conf:1005)
Syntax OK
Some lines from httpd.conf:
###########################################################
Listen 80
ServerName beta:80 # this is in the "default" server config
###########################################################
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerName x
ServerAlias y z
DocumentRoot /home/basilgohar/Public/www/app
</VirtualHost>
Can anyone help me get my default server back?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkn7CsUACgkQaVgOCFr0s2LO4QCfQl6ZJWW1w7lWMJBnnGdpH3rJ
e6sAn18c+l7Ivb33HdspxS8raBZgKnm5
=E3ND
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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] Default server is overridden by first VirtualHost
Posted by Basil Mohamed Gohar <ab...@hidayahonline.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/04/2009 06:48 PM, Eric Covener wrote:
> On Mon, May 4, 2009 at 12:19 AM, Basil Mohamed Gohar
> <ab...@hidayahonline.org> wrote:
>
>>> The manual explicitly talks about this. If it matches, it will hide
>>> the base/default server.
>>>
>> The thing is, the vhost names do not match. I type in "beta" and the
>> server loads "x". This is the problem I am having.
>
> There's no comparisons of names at this point, just ips/interfaces and
> ports. If you have a set of *:80 virtualhosts, ip-based selection
> occurs early and then name-based selection comes from this subset of
> virtualhosts.
>
> That's why the base server is covered up.
>
Thank you very much for explaining this!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkn/CXwACgkQaVgOCFr0s2IrSwCeOZU4FgJU1MAggPl4eDXoS2bb
hGIAnRYNf8cNngvpAUu5V+ryZvfnsBoh
=csD3
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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] Default server is overridden by first VirtualHost
Posted by Eric Covener <co...@gmail.com>.
On Mon, May 4, 2009 at 12:19 AM, Basil Mohamed Gohar
<ab...@hidayahonline.org> wrote:
>> The manual explicitly talks about this. If it matches, it will hide
>> the base/default server.
>>
> The thing is, the vhost names do not match. I type in "beta" and the
> server loads "x". This is the problem I am having.
There's no comparisons of names at this point, just ips/interfaces and
ports. If you have a set of *:80 virtualhosts, ip-based selection
occurs early and then name-based selection comes from this subset of
virtualhosts.
That's why the base server is covered up.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
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] Default server is overridden by first VirtualHost
Posted by Basil Mohamed Gohar <ab...@hidayahonline.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/01/2009 11:16 PM, Eric Covener wrote:
> On Fri, May 1, 2009 at 10:44 AM, Basil Mohamed Gohar
> <ab...@hidayahonline.org> wrote:
>> #
>> # Use name-based virtual hosting.
>> #
>> NameVirtualHost *:80
>>
>> <VirtualHost *:80>
>> ServerName x
>> ServerAlias y z
>> DocumentRoot /home/basilgohar/Public/www/app
>> </VirtualHost>
>
>> Can anyone help me get my default server back?
>
> The manual explicitly talks about this. If it matches, it will hide
> the base/default server.
>
The thing is, the vhost names do not match. I type in "beta" and the
server loads "x". This is the problem I am having.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkn+bK4ACgkQaVgOCFr0s2K4EQCfSPzTwLNdMZw/4+YRy5A5RaM+
Q70An2/91yAS8tzGTK4GswmzQwE14dLG
=QSdU
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
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] Default server is overridden by first VirtualHost
Posted by Eric Covener <co...@gmail.com>.
On Fri, May 1, 2009 at 10:44 AM, Basil Mohamed Gohar
<ab...@hidayahonline.org> wrote:
> #
> # Use name-based virtual hosting.
> #
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> ServerName x
> ServerAlias y z
> DocumentRoot /home/basilgohar/Public/www/app
> </VirtualHost>
> Can anyone help me get my default server back?
The manual explicitly talks about this. If it matches, it will hide
the base/default server.
--
Eric Covener
covener@gmail.com
---------------------------------------------------------------------
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