Strange Virtual Hosting results

I am using apache 2.0.40 on Red Hat 9 (Kernel: 2.4.20-28.9) with PHP 4.0 and Colfusion MX 6.1

What is happening is when I refresh one of the websites several times another site comes up which is also being hosted on the same system.

Sometimes when you browse randomly to a hosted website it will display another page. All the images and links are broken because it is displaying the wrong page but with the originally requested URL.......... eg I go to http://www.website1.com but it actually shows the website for http://www.website2.com and the images are broken with a link of http://www.website1.com/images/header_27.gif where that image doesn't exist for website1

An example of one of the VirtualHost entries in the httpd.conf file - they all look like this with the names changed of course.

Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /home/website1/public_html
ServerName www.website1.com
DirectoryIndex index.html index.php index.cfm
HostNameLookups on
ErrorLog /home/website1/logs/error_log
CustomLog /home/website1/logs/access_log common
Options +Indexes
ServerAlias website1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /home/website2/public_html
ServerName www.website2.com
DirectoryIndex index.html index.php index.cfm
HostNameLookups on
ErrorLog /home/website2/logs/error_log
CustomLog /home/website2/logs/access_log common
Options +Indexes
ServerAlias website2.com
</VirtualHost>

I really hope someone can help with this since it is really starting to annoy my clients.

Thanks.
tumekiAsked:
Who is Participating?
 
periwinkleCommented:
Did this always happen, or did it happen after adding a particular virtual host?

index.cfm seems to say that perhaps the problem occurs only with ColdFusion pages?  Does it make a difference if you use a static .html page?
0
 
periwinkleCommented:
Hmmm - that almost sounds like a DNS issue where the secondary server isn't reporting the same IP address as the primary one.  Try going to:

http://www.dnsreport.com

and plugging in the domain names there - any problems reported?
0
 
tumekiAuthor Commented:
Thanks for the idea, but it didn't report anything unusual - a couple of warnings but they were just things like you only have 1 MX record etc.

Have double checked the DNS records on the servers and also the Hosts file and everything appears to be correct.

DNS example:

www.website1.com.   A    1.1.1.1
www.website2.com.   A    1.1.1.1
www.website3.com.   A    1.1.1.1

With the above mentioned VirtualHost records.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
periwinkleCommented:
This is one I haven't heard of before...

What does it say in the access_log and error_log when the wrong page comes up?  

Are you using mod_proxy?

I wonder if the HostNameLookups are causing the problem due to latency issues;  you might try turning that off, and using the logresolve utility instead as needed:

http://httpd.apache.org/docs-2.0/mod/core.html#hostnamelookups
0
 
tumekiAuthor Commented:
Yeah I thought it would be. I only found one other reference to it on the web and that didn't have an answer to the question.

In the access_log and error_log it only seems to complain about "File does nont exist" which is understandable.

No not using mod_proxy and have turned HostNameLookups off and it still seems to be doing the same thing.

A very strange problem.
0
 
tumekiAuthor Commented:
Can example of the problem.......... if you go to http://www.footpower.co.nz/ and refresh the page several times eventually you will see what I am talking about.
0
 
periwinkleCommented:
Oh bizarre!  I see it!
0
 
tumekiAuthor Commented:
And in the error_log file for that website you get.............

[Fri Oct 08 12:42:05 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/button_read_more.gif, referer: http://www.footpower.co.nz/
[Fri Oct 08 12:42:06 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/black_corner_topleft.gif, referer: http://www.footpower.co.nz/
[Fri Oct 08 12:42:06 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/black_bevel_top.gif, referer: http://www.footpower.co.nz/
[Fri Oct 08 12:42:06 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/black_corner_topright.gif, referer: http://www.footpower.co.nz/
[Fri Oct 08 12:42:07 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/black_corner_bottomleft.gif, referer: http://www.footpower.co.nz/

Which was someones attempt just now.
0
 
periwinkleCommented:
What happens if instead of a global like:

<VirtualHost *:80>

you put in the actual IP address?  Might that fix the problem? <<-- clearly grasping at straws.
0
 
periwinkleCommented:
probably mine - first two tuples of the IP address would be 206.105 .

Intriguingly, the error is pointing to the correct directory (I assume) for footpower, but I saw a couple of different sites when the page displayed.

What are the corresponding access_log entries?
0
 
periwinkleCommented:
Hmmm -- could you try a slight variation on your configuration entries:

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.website2.com
ServerAlias website2.com
DocumentRoot /home/website2/public_html
DirectoryIndex index.html index.php index.cfm
HostNameLookups on
ErrorLog /home/website2/logs/error_log
CustomLog /home/website2/logs/access_log common
<Directory /home/website2/public_html>
Options +Indexes
order allow,deny
allow from all
</Directory>
</VirtualHost>

where xxx.xxx.xxx.xxx is the actual IP address?
0
 
tumekiAuthor Commented:
Sorry to say that doesn't seem to have made any difference.

Looking in the error_log file it has......

[Fri Oct 08 13:15:14 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/black_corner_bottomright.gif, referer: http://www.footpower.co.nz/
[Fri Oct 08 13:17:51 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/css/cabletalk.css, referer: http://www.footpower.co.nz/
[Fri Oct 08 13:17:51 2004] [error] [client x.x.x.x] File does not exist: /home/footpower/footpower/images/left_dropfade.gif, referer: http://www.footpower.co.nz/

and in the access_log file it has.........

x.x.x.x - - [08/Oct/2004:13:17:50 +1300] "GET /images/vertical_dotted_line.gif HTTP/1.1" 304 -
x.x.x.x - - [08/Oct/2004:13:17:50 +1300] "GET / HTTP/1.1" 200 14696
x.x.x.x - - [08/Oct/2004:13:17:51 +1300] "GET /css/cabletalk.css HTTP/1.1" 404 1204

Maybe this has something to do with it........... in the /var/log/httpd/error_log I have thousands of these.

[Fri Oct 08 13:12:27 2004] [notice] jrApache[init] JRun 4.0 (Build 63961) Apache 2 module - Oct  8 2004 12:24:06
[Fri Oct 08 13:12:28 2004] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations
[Fri Oct 08 13:14:29 2004] [notice] caught SIGTERM, shutting down
[Fri Oct 08 13:14:31 2004] [notice] jrApache[init] JRun 4.0 (Build 63961) Apache 2 module - Oct  8 2004 12:24:06
[Fri Oct 08 13:14:31 2004] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 08 13:14:31 2004] [notice] Digest: done
[Fri Oct 08 13:14:32 2004] [notice] jrApache[init] JRun 4.0 (Build 63961) Apache 2 module - Oct  8 2004 12:24:06
[Fri Oct 08 13:14:32 2004] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations
[Fri Oct 08 13:16:47 2004] [notice] caught SIGTERM, shutting down
[Fri Oct 08 13:16:48 2004] [notice] jrApache[init] JRun 4.0 (Build 63961) Apache 2 module - Oct  8 2004 12:24:06
[Fri Oct 08 13:16:48 2004] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 08 13:16:48 2004] [notice] Digest: done

0
 
periwinkleCommented:
hmmm - SIGTERM is the signal to shutdown... but it looks like it's just the JRUN module, not Apache itself (although I could be wrong...)
0
 
periwinkleCommented:
Looking at those log entries for the site, it is *definitely* confused about what site it is supposed to be showing!  
0
 
tumekiAuthor Commented:
Could there be something in the conf file that I am missing........... I don't really want to post the whole conf file here.

There has been very little change to the conf file apart from adding some Virtual Hosts and the usual stuff, so don't know what it could be.
0
 
periwinkleCommented:
Is it happening across the board, or only to certain sites?
0
 
tumekiAuthor Commented:
It's happening across the board. This system is hosting about 10 websites.

Also have just noticed on sites that have a home link which points to index.cfm it will cause the problem then as well.

For example: If I go to www.footpower.co.nz surf around the site for a bit and then click on home........ it sometimes brings up another website with the broken links.
0
 
periwinkleCommented:
Found this -- are you using SuSE Linux?

http://archive.apache.org/gnats/8148
0
 
periwinkleCommented:
0
 
periwinkleCommented:
D'oh, you say RedHat.  Here's someone who had the same problem on RedHat:

https://www.redhat.com/archives/valhalla-list/2002-September/msg02711.html
0
 
tumekiAuthor Commented:
Nah using RedHat 9.0

But I think you may have hit the nail on the head with the above "Did this always happen, or did it happen after adding a particular virtual host?"

As a total off chance I removed all the Virtual Hosts and then one by one putting them back on and seeing which one breaks it.

Still doing this now, will let you know how it goes.
0
 
tumekiAuthor Commented:
Thanks so much for all your help........ you got it...... it helps bouncing ideas of people.

It was a particular VirtualHost that was causing problems.

Now I have to work out why it is causing problems.
0
 
tumekiAuthor Commented:
How annoying - I jumped the gun a bit there......... it hasn't made any different :(

Thought it was good when I removed a particular VirtualHost, but leaving it for awhile it has happened again without that VH in place.
0
 
tumekiAuthor Commented:
Ok if anyone gets this same problem check this article out...............

http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20563247.html

It is a ColdFusion specific thing.
0
 
periwinkleCommented:
Oh yahoo!  Is it fixed now?
0
 
periwinkleCommented:
Ah, for posterity:

CFMX is configured to cache pages that are of the same name, even when in a multi-homed environment. This function can be turned off, and is described here:

http://www.macromedia.com/support/coldfusion/ts/documents/tn18258.htm

Good find!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.