I have a windows 2003 "web edition" dedicated server leased from fasthosts.
I would like to store some asp includes in a specific location on the server that can be called by different domains.
Is this possible?
You can create a virtual directory in each sites config pointing to the directory with the code in question. You just need to make sure the anon web user for the domain has read and exec perm on the virtual directory's physical location.
Oops,........I made a mistake typing the folder trees in the last post. Unfortunately I can't correct it because I'm out of the 15 minute time limit allowed to change things, so here is the "correct" message:
Thanks for this................can you expand a bit.........
I'm unsure how to create a virtual directory in the relavant sites pointing to the code.
(say) I have the include file called "include_hallo.asp" located on the server at d:\home\Brian\acme.com\htdocs\global_includes\include_hallo.asp
and I want to call it to
how should I do that...............
Also, if I'm on the right track, and from a security point of view, should I locate the directory that holds the include files: ("global_includes") higher up the folder tree than "Brian\acme.com\htdocs\
Not sure if I understand what you are trying to do. You can create an includes folder like \Brian\Includes and put all include asp pages in there and you can create a virtual directory called global_includes in the root of your web site and you can reference all your include asp page and you can reference all includes asp pages ..\global_includes\whatever.asp on your web pages.
Well, you can create a virtual directory on those 40 servers and you can point that virutal directory as a UNC path to that central server. so you can create a generic account that only has read share and read folder access to that server and use that credential in the virtual directory.
However, this is not a good practice. If that one central server goes down, then all your other 40 servers can go down as well. You can actually write a script or automate to deploy files to those 40 servers as this is probably a better, more reliable way to do things.
I'm obviously not explaining properly. Sorry folks.
plumsauce: Thanks for this but I am not looking for a solution to dates etc. I was using this as an example of a reason for needing to call 'asp includes' from differnet domains.
Kang: thank you for your interest but I don't have 40 servers. I have 1 server with 40 domains.... (fred.com / joe.com / brian.com / george.com / etc.)
All domains (clients websites) are hosted on the same server and I want to have an include (let's call it copyrightdate.asp) that is located in one domain and that any other domain on the server can call.
Let's say the include is here: MyServer/htdocs/joe.com/includes/copyrightdate.asp)
I want the domain george.com to be able to call it as an include.
To clarify my question, both domains are on the same server but I can't call a file across the domains.
In other words, I can call the file with no problem in the normal way thus:
copyrightdate.asp is placed it under a folder called "includes" inside the domain www.joe.com:
In www.joe.com/default.asp I put the code <!--#include file="includes/copyrightdate.asp" -->
Everything is OK
This comes back to making a virtual directory. You'll need to create a virtual directory called "includes" in the root of www.george.com web site. And that "includes" path should point to the exact path where that asp file is kept.
Or you can move the includes folder for example, to D:\inetpub\includes and create a virtual directory called "includes" in the root of all your 40 web sites and point it to that exact path.