Cross contaminating files and websites on same network.

I'm not talking about Cross-Contamination script but something  totally different.

Files on one site are being shown on a totally different site (on the same sever but differently defined IIS sites), from separate directories, causing confusion and lots of trouble.

We have a dozen sites defined in IIS 8.5 and using ColdFusion 11.

Some of the sites are similar and use the same folder and file names.  Each defined site in IIS8.5 has a different home directory off C:\inetpub\wwwroot.   All files for each site resides in separate folders so I don't understand why one site would be displaying files from another website. Example:


The directory "news" and it's file: article1.cfm reside off the root for each site, as you can see. All sites are on the same network and the same server, same Windows Server 2012r2.

However, each article1.cfm is a page that contains different content on each site, and of course, different domain names so it's embarrassing to have one site show the contents of the other site to our viewers. I realize I need to keep the content separate but the sites are so similar that it's easy and convenient to use the same cf code from one to another.

To sort of solve and keep one site from using the same files, I'm forced to change the news folder names AND the article1.cfm names of each page.

I've even made certain that the file link on each site where there  is a  problem, using the full domain name and the file path. But that does  not help at all.  And CACHE is turned off.

All sites share some of the same SQL 2008 R2 databases.

Or create a mapping in CF Administrator and mark code for every instance so there is no cross site contamination. I also try to keep the default document different for each site's home page.

But that's a lot of work and I'm hoping ColdFusion has a better and more efficient method of keeping each site separate, even when they have identical folder  names and files, and that someone will point this out and how to  implement it.

So, not sure if this is a CF or an IIS problem.  Also wondering why this happens when each site points to a totally different and separate path.
Grover McBroomAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
How are the website IP Bindings configured?

Multiple sites hosted on IIS
1. Are you using "All Unassigned" like the default web site uses (*:http)?
2. Are you using 1 IP to host multiple sites?
3. Are you using a dedicated IP for each website? (as in the image above)

Grover McBroomAuthor Commented:
Dan - Good question. I should have mentioned this.

For the sites mentioned, we are using two separate static ip's. The bindings for each use both full domain names such as:

Type      Host Name              Port     IP Address            Binding Information
http        80         xxx.125.56.132       (empty)
http             80        xxx.125.56.132             (empty)
http              80        xxx.125.56.130             (empty)
http                   80        xxx.125.56.130       (empty)

The ip addresses above are just examples, not ours. We are never using "All Unassigned". Our DNS "A" records use the same example, pointing to the fullly qualified domain name, that is, hostname and the domain name are both pointing to the server ip address. We purposefully used two different ip addresses on these two sites so they would also be seen as two separate identities to the public.

Some of the other domains are using the same ip but rely, I guess, on the binding name to keep them separate. I'd had first thought this might have indicated the root of the problem except for the above example using two different domains on the same subnet, still demonstrating the main problem. So, that should not be the problem.

Regardless, each site points to a different folder but may use a COPY of the same files and file names. If I change the file names, usually this solves the problem so that may be some clue.

Or I can fix some of this by using CF mapping to define the site root such as the following in CF Admin Mappings:

Logical Path      Directory Path
/Site1            C:/inetpub/wwwroot/site1/
/Site2            C:/inetpub/wwwroot/site2/

Then use Site1 or Site2 at the front of the path for any file in my html code.  

Does this help you any?
Dan McFaddenSystems EngineerCommented:
OK, it does help.

First off, you only need a single binding for port 80.  There is no reason to configure the bindings like this:

Type      Host Name              Port     IP Address            Binding Information
 http        80         xxx.125.56.132       (empty)
 http             80        xxx.125.56.132             (empty)

The site binding should look like so:

Type        Host Name              Port     IP Address            Binding Information
 http      80         xxx.125.56.132       (empty)
 http      80         xxx.125.56.130       (empty)

You need a corresponding "www" A Record in the DNS zone.  If you wish to handle HTTP requests without the "www" I recommend using the URL Rewrite module.

As long as both site a specifically configured to point to their own content root directory, then I believe the issue is in the code, not the IIS config.

You mentioned that the sites "share" a database... to do mean they use the same schema/tables in a database or do you mean they use the same database server with different databases on the server?

Since you stated that you are just duplicating/copying code over from 1 site to another (a normal process) are you sure you updated the necessary code or code configuration to pull data from the proper database?

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Grover McBroomAuthor Commented:
Dan - Most sites use the same database, same tables, same data.  Can that cause a problem? We absolutely need to use the same databases, same data where the sites are so similar. It would be far too prohibitive place the same data is separate databases.

We had no problem we could not fix with CF8 and Win Server 2003.

If this is a problem, would you explain why?

And what do you think of using CF Admin MAPPING to force the pull from a specific siteroot?

DNS does have an A record for www, for all sites. We don't have a problem at all accessing the domains with our without the subdomain.
Dan McFaddenSystems EngineerCommented:
So, if there is a single database server with a single database (schema, tables, etc...) being used by multiple separate websites running the same CF code, how does a site determine what content is appropriate to display on its pages?

This sounds to me more like a CF/code issue than an IIS configuration issue.

According to CF docs, a admin mapping is to allow CF to access content from outside the defined site root.  So I'm not sure that will make things any better.

Grover McBroomAuthor Commented:
Not following you Dan. Perhaps I need to make this clearer.

We use one machine operating Win2012 as the OS with one instance of SQL 2008 R2 server with a couple dozen databases.

There are a dozen or so IIS sites on that same machine, each IIS site has its own folder under the webroot path. Copies of the same code are being used usually with the same file name but those files are all separate, that is, they are not being shared.  The only sharing is that the data is pulled from the same database table.

For the live of me, if modern technology cannot handle such a simple idea then I need to find a different job.  But I don't believe it. We ran the same sites on Win2003 and CF8 with no problem at all.

I've found that CF Mapping does not do much to help here, that is, to stop one site attempting to run with the same file from a different site, different folder and different ip address.

The only way I can stop this for sure it to be sure that each SITE uses a unique default document on the site root and that ANY .cfm file within that default document has a unique name. That stops the problem right in its tracks.

So, we've done this, made unique default document names and so don't have the problem.

What remains is the academic question as to why a separate site will attempt to use a file from another site when they are only the same name and stored in the same place off the root. That I'd like to know so we can close this question. If you have no idea then we'll still find a way to close this with some points to you for staying with the idea at least.

I just simply do not buy the idea or hint (if I have your msg correctly), that two sites cannot share the same database without the symptom I've seen.

So, again for those who may experience the same problem, define a unique root default document for each site, which may be standard and obvious to others, but certainly not to everyone.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Grover McBroomAuthor Commented:
Found solution myself.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

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.