[opensuse] Apache2 default host using virtual hosts



Hi,

I'm trying to configure apache2 to use three virtual hosts. I want to
use one of them (www.mydomain.com) as the "default server" to serve
all the domains that don't match any of the virtual host defined.
Using yast I created all the vhosts, I want to use:

/etc/apache2/vhosts.d/
...................................admin.mydomain.com.conf
...................................webmail.mydomain.com.conf
...................................www.mydomain.dom.conf
...................................vhost-ssl.template
...................................vhost.template

According to the apache documentation, the default host is the first defined:

"Now when a request arrives, the server will first check if it is
using an IP address that matches the NameVirtualHost. If it is, then
it will look at each <VirtualHost> section with a matching IP address
and try to find one where the ServerName or ServerAlias matches the
requested hostname. If it finds one, then it uses the configuration
for that server. If no matching virtual host is found, then the first
listed virtual host that matches the IP address will be used."

In opensuse, each virtual host is defined in is own file, so the first
defined host depends on the filename, but because yast choose the name
based on the domain name, the first domain is "admin.mydomain.com" and
not the one I want "www.mydomain.com". Just changing
"www.mydomain.com.conf" to "1-www.mydomain.com.conf" makes apache to
set the default name the domain I want (however, this is reverted each
time I start yast).

Is this normal or I'm being hitting by a bug?

Thanks in advance!
Cheers,
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Apache & VirtualHosts - config file attached here
    ... > # ServerName gives the name and port that the server uses to identify ... should not use the main server configuration. ... > # Virtual host Default Virtual Host ... have another server started on port 81 and this instance of apache is ...
    (comp.os.linux.networking)
  • Re: Apache & VirtualHosts - config file attached here
    ... > # ServerName gives the name and port that the server uses to identify ... should not use the main server configuration. ... > # Virtual host Default Virtual Host ... have another server started on port 81 and this instance of apache is ...
    (comp.os.linux)
  • Re: Apache & VirtualHosts - config file attached here
    ... > # ServerName gives the name and port that the server uses to identify ... should not use the main server configuration. ... > # Virtual host Default Virtual Host ... have another server started on port 81 and this instance of apache is ...
    (alt.linux)
  • Re: Apache & VirtualHosts - config file attached here
    ... > # ServerName gives the name and port that the server uses to identify ... should not use the main server configuration. ... > # Virtual host Default Virtual Host ... have another server started on port 81 and this instance of apache is ...
    (alt.os.linux.redhat)
  • Re: virtualhosts, dns, and cnames. For the love of God, please help me!
    ... my log files and also find stupid stuff in my anon server such as space.asp ... So the first virtual host is a trap, ... myfamily.org should get stuck in the first virtual host section, ... [root@ohmster conf]# httpd -t ...
    (alt.os.linux)