- Create a directory where you deploy the MVC files, named "AppFoo". Note that the configuration file
web.config
will be shared between all of the sites, you'll have to load per-site configuration at on-demand runtime by looking at the Host
HTTP header or other binding information.
- Create each website in IIS and get it to use the the application directory you created. Ideally each website runs under its own application pool with its own user-account, all of the user-accounts will have access to AppFoo directory.
- Create a new directory somewhere, e.g. under
C:Inetpubsites
named WebsiteA
, WebsiteB
, etc. Each folder re-sets the NTFS permission ACLs that only allows each website's application pool user access. Inside these create folders called "Content", "Views" and "Logs"
- For each website in IIS (I assume you're using the root) set up a Virtual Directory called "Content" and "Views" (which is how I assume you have set-up your MVC applications), map these to subdirectories of the folders you created in Step 3.
- For each website, go to the Logging page and set the log-path to the
Logs
directory you created for the site in step 3.
Note that this plan is based on the assumption that MVC evaluates IIS virtual directories in its VirtualPathProvider. If not then you'll have to roll your own VirtualPathProvider to load per-website content, again, on a per-hostname basis.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…