OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] virtual host


Quoting Carmel NY (carmel_ny@xxxxxxxxxxx):

> >Please elaborate on the 'not working out so well' bit.

> >> apachectl -S
> >> VirtualHost configuration:
> >> *:80                   stem.example.net (/usr/local/etc/apache24/extra/httpd-vhosts.conf:24)
> >> *:443                  example.net (/usr/local/etc/apache24/extra/httpd-ssl.conf:121)  

> Okay, on a stock FreeBSD installation, maybe on others too, there is an
> index.html file in the document root that displays, "It Works" when it is
> access. Now, when I type in my normal web address; http://example.net, the
> vhost site is displayed. However, if I type in the vhost name;
> http://stem.example.net, the regular site is display; ie. "It Works". That
> is exactly opposite of what it is supposed to be doing. That make no sense,
> so I know that I am doing something really wrong.

This is Apache 2.4.x ?

I don't see the 'default server ...','ip.add.re.ss:port is a NameVirtualHost'
and 'alias'-lines in your 'apache2ctl -S' output.

Did you remove those yourself?  It always helps not to obfuscate your configs
and logs when seeking help.

# apache2ctl -S
VirtualHost configuration:
213.154.236.176:443    is a NameVirtualHost
   default server www.freshdot.net (/etc/apache2/sites-enabled/01.www.freshdot.net.conf:1)
   port 443 namevhost www.freshdot.net (/etc/apache2/sites-enabled/01.www.freshdot.net.conf:1)
      alias freshdot.net
 [ .. ]
[2001:7b8:633:1:213:154:236:176]:443 is a NameVirtualHost
   default server www.freshdot.net (/etc/apache2/sites-enabled/01.www.freshdot.net.conf:1)
   port 443 namevhost www.freshdot.net (/etc/apache2/sites-enabled/01.www.freshdot.net.conf:1)
      alias freshdot.net

Apache will, by default, treat the first vhost definition it finds as
the default vhost for that IP/port combo. Try defining a simple vhost
before defining the stem.example.net vhost so that no longer is your
default vhost.

Regards,
-Sndr.
-- 
| Scenery is here, wish you were beautiful.
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx