Link to home
Start Free TrialLog in
Avatar of Grover McBroom
Grover McBroom

asked on

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:

C:\inetpub\wwwroot\site1\news\article1.cfm
C:\inetpub\wwwroot\site2\news\article1.cfm
C:\inetpub\wwwroot\site3\news\article1.cfm

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.
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

How are the website IP Bindings configured?

User generated image
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)

Dan
Avatar of Grover McBroom
Grover McBroom

ASKER

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            www.site1.com      80         xxx.125.56.132       (empty)
http                site1.com       80        xxx.125.56.132             (empty)
 
http     www.site2.com              80        xxx.125.56.130             (empty)
http               site2.com              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?
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            www.site1.com      80         xxx.125.56.132       (empty)
 http                site1.com       80        xxx.125.56.132             (empty)

The site binding should look like so:


Type        Host Name              Port     IP Address            Binding Information
 http         www.site1.com      80         xxx.125.56.132       (empty)
 http         www.site2.com      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?

Dan
SOLUTION
Avatar of Grover McBroom
Grover McBroom

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Found solution myself.