View previous topic :: View next topic |
Author |
Message |
frameRATE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1247903464180027e8bf83.gif)
Joined: 28 Apr 2003 Posts: 386 Location: Orange County California
|
Posted: Wed Jan 07, 2009 1:40 am Post subject: Interesting Apache Virtual Host Issue |
|
|
So I just set my old gentoo server back up after a move across the country. A friend noticed that my virtual hosts weren't working after I upgraded my packages and he was right. I lost the config files! Oops. So I reset up my vhosts.d/ directory and found an interesting problem.
My main website is: www.framerate.info
My virtually hosted website: www.wrperformance.com
The former just loads a single "credits.png". The latter loads a logo, an address and a phone number.
If you load up the main site it works just fine. Loading the vhost site will load correct the first time, when you refresh it'll load the framerate.info (but from the virtual hosts's path! so the image will appear broken) and refreshing again will show it again correctly. This will continue every time you refresh the page.
Getting even stranger, you'll notice that this behavior happens in Internet Explorer 7/8. It happens in Google Chrome (both on windows). It DOES NOT happen on Safari (OSX) or Firefox3 (windows).
This made me think it was a caching problem, but watching access_log and error_log is *is* in fact requesting the wrong files from certain browsers, and not from others. I was under the impression that all the browsers sent the same HTTP request but I am apparently mistaken.
00_default_vhost.conf
Code: | # Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
# Use name-based virtual hosting.
NameVirtualHost *:80
# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
ServerName framerate.info
ServerAlias www.framerate.info framerate.info
Include /etc/apache2/vhosts.d/default_vhost.include
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
</IfDefine>
# vim: ts=4 filetype=apache
|
wr.conf
Code: | <IfDefine DEFAULT_VHOST>
<VirtualHost *:80>
ServerName wrperformance
ServerAlias www.wrperformance.com wrperformance.com
Include /etc/apache2/vhosts.d/default_vhost.include
DocumentRoot "/var/www/localhost/htdocs/_hosted/wrperformance"
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
</IfDefine>
|
Anything else I can provide to help figure this out.
Also to be noted, the server is behind a router that does port forwarding for port 80 straight to this box, but I do not suspect that it will have anything to do with this issue since the root framerate.info works just fine.
Thanks guys! _________________
Linux User | 364705
howto install coldfusion mx 7 under gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Wed Jan 07, 2009 10:25 am Post subject: |
|
|
As far as I have understood ServerName should be equal to a real host name. It's no longer a simple name. It's used to determine the virtual host from the browser's query string. Use ServerAlias'es for additional host names. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
frameRATE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1247903464180027e8bf83.gif)
Joined: 28 Apr 2003 Posts: 386 Location: Orange County California
|
Posted: Wed Jan 07, 2009 5:55 pm Post subject: |
|
|
Updated to ".com" in wr.conf and same behavior.
I really can't figure out why it would switch which site to display when refreshed and ONLY on 2/4 browsers!
HALP! _________________
Linux User | 364705
howto install coldfusion mx 7 under gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Thu Jan 08, 2009 8:38 am Post subject: |
|
|
I think it's probably because some browsers do resolve and qualify an unqualified hostname before they send the request. But I've just tried www.framerate.info and framerate.info in MSIE7 and the problem you described doesn't seem to happen. I don't have MSIE8 so it's all I can do ATM. BTW you didn't tell your version of Apache... _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
frameRATE Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1247903464180027e8bf83.gif)
Joined: 28 Apr 2003 Posts: 386 Location: Orange County California
|
Posted: Thu Jan 08, 2009 5:01 pm Post subject: |
|
|
VinzC wrote: | I think it's probably because some browsers do resolve and qualify an unqualified hostname before they send the request. But I've just tried www.framerate.info and framerate.info in MSIE7 and the problem you described doesn't seem to happen. I don't have MSIE8 so it's all I can do ATM. BTW you didn't tell your version of Apache... |
framerate.info works fine... with or without www.
the problem is wrperformance.com (which is the first virtual host). framerate.info is the default site, it works fine. But wrperformance.com will load fine the first time, and then framerate.info will load when you refresh wrperformance.com, then alternate every refresh when loading wrperformance.com
My apache is whatever the latest version in portage is, it was updated 2 days ago. _________________
Linux User | 364705
howto install coldfusion mx 7 under gentoo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cach0rr0 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/14936637654ee19d6630f96.gif)
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Fri Jan 09, 2009 1:10 pm Post subject: |
|
|
possible to do a packet capture?
vhost routing is contingent upon the presence of a "Host:" header IIRC
is it possible this isnt being sent? If so, be a bug in the browser. Not likely, but worth investigating. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|