problem with virtual named hosts - its always the default virtual site that"s loaded

problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 05:24:06 von rrothberg

I have a server running Trixbox, so apache was already configured and
running. I wanted to add some virtual named hosts to this server, so
I set up A records for them pointing to the same IP. This server has
only 1 IP address.

Following the documents for Apache, I created a virtual host section
first that pointed at the Trixbox files. I then created the
additional virtual hosts. The problem is that while the new domain
names resolve to this server, it's ALWAYS the trixbox website pulled
up. I checked the log files as well, and the other sites are never
hit, the log files for them are at 0 bytes.

Here's the relevant section of my apache config file:

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#

Include /etc/trixbox/httpdconf/*


DocumentRoot /var/www/html
ServerName trixbox.domain.com
ErrorLog logs/trixbox.domain.com-error_log
CustomLog logs/trixbox.domain.com-access_log common



DocumentRoot /www/docs/domain2.com
ServerName www.domain2.com
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log common



DocumentRoot /www/docs/domain3.com
ServerName www.domain3.com
ErrorLog logs/domain3.com-error_log
CustomLog logs/domain3.com-access_log common


Here's an excerpt from the error log file for trixbox.domain.com.
Note that the referrer shows up as www.domain2.com - this error has
nothing to do with my problem, I just point this out to indicate that
the request does seem to be originating with www.domain2.com but is
being picked up by the default virtual host.

[root@trixbox logs]# more trixbox.domain.com-error_log
[Tue Oct 23 23:21:12 2007] [error] [client 22.43.0.253] File does not
exist: /va
r/www/html/include/css/xoops.css, referer: http://www.domain2.com/

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 05:27:33 von rrothberg

I also meant to point out there is nothing relevant in /etc/trixbox/
httpdconf/* that's included. There is only one file and it just sets
up password protected directories.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 09:05:18 von rrothberg

And one other thing I noticed that might be a clue

[root@trixbox /]# apachectl restart
[Tue Oct 23 23:50:48 2007] [warn] NameVirtualHost *:80 has no
VirtualHosts

I made sure that NameVirtualHost *:80 only appears once.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 09:41:40 von Hans-Peter Sauer

Easy one.

You have this :

NameVirtualHost *:80 (note you have :80 in this)

So your virtual hosts must have the same


DocumentRoot /var/www/html
ServerName trixbox.domain.com
ErrorLog logs/trixbox.domain.com-error_log
CustomLog logs/trixbox.domain.com-access_log common


change to and it will work.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 12:37:07 von rrothberg

Thank you, I looked at these docs
http://httpd.apache.org/docs/2.0/vhosts/
over and over and I simply wasn't seeing my error for
some reason. I ultimately got it to work late last night
but by throwing in an IP address and port on each one.
I never saw my original error, thanks.

On Oct 24, 3:41 am, "Peter" wrote:
> Easy one.
>
> You have this :
>
> NameVirtualHost *:80 (note you have :80 in this)
>
> So your virtual hosts must have the same
>
>
> DocumentRoot /var/www/html
> ServerName trixbox.domain.com
> ErrorLog logs/trixbox.domain.com-error_log
> CustomLog logs/trixbox.domain.com-access_log common
>

>
> change to and it will work.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 13:05:59 von rrothberg

On Oct 23, 11:27 pm, robr wrote:
> I also meant to point out there is nothing relevant in /etc/trixbox/
> httpdconf/* that's included. There is only one file and it just sets
> up password protected directories.

And one other thing I noticed that might be a clue

[root@trixbox /]# apachectl restart
[Tue Oct 23 23:50:48 2007] [warn] NameVirtualHost *:80 has no
VirtualHosts

I made sure that NameVirtualHost *:80 only appears once.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 18:24:06 von rrothberg

On Oct 23, 11:27 pm, robr wrote:
> I also meant to point out there is nothing relevant in /etc/trixbox/
> httpdconf/* that's included. There is only one file and it just sets
> up password protected directories.

And one other thing I noticed that might be a clue

[root@trixbox /]# apachectl restart
[Tue Oct 23 23:50:48 2007] [warn] NameVirtualHost *:80 has no
VirtualHosts

I made sure that NameVirtualHost *:80 only appears once.

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 24.10.2007 21:15:58 von HansH

"robr" schreef in bericht
news:1193198635.097553.23080@e9g2000prf.googlegroups.com...
> On Oct 23, 11:27 pm, robr wrote:
>> I also meant to point out there is nothing relevant in /etc/trixbox/
>> httpdconf/* that's included. There is only one file and it just sets
>> up password protected directories.
>
> And one other thing I noticed that might be a clue
>
> [root@trixbox /]# apachectl restart
> [Tue Oct 23 23:50:48 2007] [warn] NameVirtualHost *:80 has no
> VirtualHosts
I'm suffering the same warning and ignored it for now.
I guess it is a false warming occurring when 'NameVirtualHost *:80' and
'' are not in the same _file_.

> I made sure that NameVirtualHost *:80 only appears once.
A is (included) at least once too?

HansH

Re: problem with virtual named hosts - its always the default virtual site that"s loaded

am 25.10.2007 02:58:04 von rrothberg

On Oct 23, 11:27 pm, robr wrote:
> I also meant to point out there is nothing relevant in /etc/trixbox/
> httpdconf/* that's included. There is only one file and it just sets
> up password protected directories.

And one other thing I noticed that might be a clue

[root@trixbox /]# apachectl restart
[Tue Oct 23 23:50:48 2007] [warn] NameVirtualHost *:80 has no
VirtualHosts

I made sure that NameVirtualHost *:80 only appears once.