Page 1 of 1

[SOLVED] VirtualHosts not working even though they load fine

Posted: 2012/03/28 09:05:27
by cbach
HI,

I have been trying to solve this for a couple of days now, and I'm really at a loss here.

[b]General information[/b]
[quote]
# uname -a
Linux web07.hostingpool.net 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

# apachectl -v
Server version: Apache/2.2.3
Server built: Feb 23 2012 21:16:56

Just to make this is not the source of the problem
# sestatus
SELinux status: disabled
[/quote]

[b]httpd.conf snips[/b]
[quote]
Listen *:80

ServerName web07.hostingpool.net:80


Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all


LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
#LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%v %l %h %u %t \"%r\" %>s %b" comonvhost
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log comonvhost

NameVirtualHost *:80


DocumentRoot /var/www/html
ServerName web07


Include conf.d/*.conf
#Include conf.d/*.vhb
#Include conf.d/with-wx3-witout-wx3/*.vhb
Include conf.d/hostfiles/*.conf
[/quote]

[b]apachectl -S Hostfiles loaded[/b]
[quote]
# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server web07 (/etc/httpd/conf/httpd.conf:986)
port 80 namevhost web07 (/etc/httpd/conf/httpd.conf:986)

port 80 namevhost www.domain.tld (/etc/httpd/conf.d/hostfiles/domain.tld.conf:1)

Syntax OK

[b]domain.tld.conf[/b]

DocumentRoot /var/www/html/server/domain.tld
ServerName www.domain.tld
ServerAlias www.domain.tld

AllowOverride All
Options +Includes
Options FollowSymLinks


[/quote]

[b]access and error log information[/b]
[quote]
# tail -f /var/log/httpd/access_log /var/log/httpd/error_log
==> /var/log/httpd/access_log /var/log/httpd/error_log <==
[Wed Mar 28 10:52:40 2012] [error] [client 87.49.141.210] File does not exist: /var/www/html/favicon.ico
[/quote]

I have added the domain www.domain.tld to my local hosts file, and it resolves to the correct public IP.
The thing that really gets my attention is that apache doesn't log the VirtualHost' name in the access_log.
All I get is the default "Hello world!" page.

I have used the above configuration many times on other *nix'es before.

Am I missing something obvious?

[SOLVED] Re: VirtualHosts not working even though they load fine

Posted: 2012/03/28 12:08:05
by cbach
Server is behind a MS TMG Forefront thingy, seems like clearing proxy cache solved it.

Re: [SOLVED] Re: VirtualHosts not working even though they load fine

Posted: 2012/03/28 23:58:43
by pschaff
Thanks for reporting back. Marking this thread [SOLVED] for posterity.