[SOLVED] VirtualHosts not working even though they load fine

Support for the other architectures (X86_64, IA-64, and PowerPC)
cbach
Posts: 7
Joined: 2011/01/11 14:06:58

[SOLVED] VirtualHosts not working even though they load fine

Postby cbach » 2012/03/28 09:05:27

HI,

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

General information
# 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


httpd.conf snips
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


apachectl -S Hostfiles loaded
# 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

domain.tld.conf

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

AllowOverride All
Options +Includes
Options FollowSymLinks




access and error log information
# tail -f /var/log/httpd/access_log /var/log/httpd/error_log
==> /var/log/httpd/access_log <==
web07 - 87.49.141.210 - [28/Mar/2012:10:52:40 +0200] "GET / HTTP/1.1" 304 -
web07 - 87.49.141.210 - [28/Mar/2012:10:52:40 +0200] "GET /favicon.ico HTTP/1.1" 404 295

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


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?

cbach
Posts: 7
Joined: 2011/01/11 14:06:58

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

Postby cbach » 2012/03/28 12:08:05

Server is behind a MS TMG Forefront thingy, seems like clearing proxy cache solved it.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

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

Postby pschaff » 2012/03/28 23:58:43

Thanks for reporting back. Marking this thread [SOLVED] for posterity.