You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matus UHLAR - fantomas <uh...@fantomas.sk> on 2006/06/16 12:30:20 UTC

[users@httpd] how to define default name virtual host?

Hello,

this is my current configuration of apache (debian: 1.3.33-6sarge1):

NameVirtualHost 195.168.3.66:80

<VirtualHost 195.168.3.66:80>
ServerName default.fantomas.sk
DocumentRoot /home/webs/default.fantomas.sk
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName fantomas.fantomas.sk
DocumentRoot /home/webs/fantomas.fantomas.sk
</VirtualHost>

<VirtualHost 195.168.3.66:80>
ServerName 195.168.3.66
DocumentRoot /home/webs/195.168.3.66
</VirtualHost>

However, with this configuration I was not able to reach virtual host
195.168.3.66. It seems that apache accepts name defined in
<VirtualHost [NAME]> as one of hames for name virtual host - 
when I switched to <VirtualHost fantomas.fantomas.sk>, I couldn't reach
virtual host for fantomas.fantomas.sk.

I can not simply use <VirtualHost *> because of different virtual servers
running at different IP addresses. Also, at other sites I'm configuring
apache from databases that contain server-IP pairs, configuring given server
at given IP, and exporting this configuration to DNS.

Can anyone confirm this behaviour? Can anyone explain to my, why was
name-based virtual hosting made this way?

I guess it was because of possibility of simple configuration of virtual
hosts way I noticed in one config some time ago:

###
NameVirtualHost [IP]

<VirtualHost first.server.name>
DocumentRoot /server/first
</VirtualHost>

<VirtualHost second.server.name>
DocumentRoot /server/second
</VirtualHost>
###
- defining virtual hosts without ServerName and/or ServerAlias directives.

Can anyone advise me, what could I change in source code to make it work the
expected (and documented) way - only using labels in ServerName and
ServerAlias in virtual hosts?

Thank you.
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux is like a wigwam: no Windows, no Gates and an apache inside...

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