Shortcuts

IIS 7: InetPub Location

This is probably been asked before, but I've looked through the FAQ's, searched and browsed all the forums and couldn't find what I was looking for.

Is there any way at all to customize the default location of the web root with all of its corresponding directories?

IIS 7 (like previous versions) defaults to creating the directories as C:\Inetpub\... I'd like to move these to a different drive. In IIS 6, one could simply edit the metabase. In prior versions, it was even more simple.

I apologize if I'm beating a dead horse, but this is a must-have feature that I was really hoping would be implemented this time around.

Re: IIS 7: InetPub Location

Thanks, Thomas, for your quick response! Is there any way to move or change the rest of the directories? For example, I'd like to move the entire Inetpub directory to a different partition and rename a few of the sub-directories inside the Inetpub directory.
(I realize I should have said that from the beginning and I apologize.)

Re: IIS 7: InetPub Location

Well, Thomas already told you the way to do it. what you should do is:
a) copy entire inetput or your web files to the new drive/partition, etc
b) then use the command syntax shown above to change it
c) test it and make sure it is working
d) delete the old inetpub/etc at source disk drive.

Re: IIS 7: InetPub Location

Thanks for your response, Bernard. I figured out how to adjust the default web site's location. That's configurable via the IIS manager. What I was trying to figure out was how to modify the "default" location of the the Inetpub folder's subdirectories.
Those being "custerr", "logs", "temp", etc.

I found the entries in "applicationHost.config" and imagine I can just edit those entries, but I was wondering: Is there any possibility in the foreseeable future that a snap-in or module might be added to manipulate these via the IIS manager?

Re: IIS 7: InetPub Location

If your request would be a common ask we would implement this feature in a heartbeat. It's the first time that I hear this request though.

Don't get me wrong, moving the content directory to a different drive (%systemdrive%\inetpub\wwwroot) is a very common request. The reason we don't do it by default is that during IIS setup we can't be sure that there is another partition and that customers
want their content directory there. We can't show UI during setup because customers are even more annoyed about that (i.e. when you go to lunch and kick off an Windows install and expect it to be done when you come back. Instead you see a dialog box that asks
you for a path).

Moving all of inetpub is not very common though. There is an relatively easy way however. You can xcopy %systemdrive%\inetpub\ to a different partition and then open %windir%\system32\inetsrv\applicationhost.config.

Search for all instances of inetpub and replace the path with your new path.

It gets a bit harder with schema defaults. These are config entries that are used when not specified in the configuration file (applicationhost.config). The schema defaults are in %windir%\system32\inetsrv\config\iis_schema.xml.

You can also search for inetpub in there. Changing IIS_SCHEMA.XML won't work because it is system-file protected. You have to make an explicit configuration entry that gets written to applicationhost.config. Here a couple of examples:

How to change the path for the ASP template cache directory default:
%windir%\system32\inetsrv\appcmd set config -section:asp -diskTemplateCacheDirectory:<your new dir>

How to change the default for logfiles:
%windir%\system32\inetsrv\appcmd set config -section:sites -siteDefaults.logfile.directory:<your new directory>

How to change the default for failedRequestLogs:
%windir%\system32\inetsrv\appcmd set config -section:sites -siteDefaults.traceFailedRequestsLogging.directory:<your new directory>

or for the compression cache directory:
%windir%\system32\inetsrv\appcmd set config -section:sites -httpCompression -directory:<your new dir>

Re: IIS 7: InetPub Location

So using the %systemdrive% installation path does makes sense in the way you've pointed out. I can see how having to ask for the path in the midst of installing windows would be a major headache.

As far as the applicationhost.config goes, I did some more poking around and do see how it works and how easy it is to manipulate it. What I am wondering is, if you add or remove components later on, doesn't this over ride any modifications you've made?
For example, if I dhave the Custom Errors module installed and modify the entry, then reinstall it, won't it overwrite my values with those from the IIS_SCHEMA.XML? If that's the case, I suppose making a backup of a customized version is quite simple, but
I found out that certain modules won't install correctly if the directories aren't there. I can't remember which one it was, but one of them gave me an error because I'd removed its default directory. Restoring the directory made it install OK.

I guess I'd like to see, at some point in the future, a tool like IIS 6's Metabase Explorer that allows for direct manipulation of the applicationhost.config file. I realize that some sections are editable via the IIS Manager and there's add-in tools, like
the Logging UI (that doesn't ship with Vista *snicker*), but some kind full editor would be great.

Thanks for your responses. It's greatly appreciated. And I can't thank you and your team enough for the improvements made to IIS 7.0. I've been using IIS since NT and have been bouncing back and forth between it and Apache. With the extensibility of IIS
7.0, Apache just became obsolete.

Re: IIS 7: InetPub Location

thanks for the nice feedback. I don't think we override settings in applicationhost.config with default settings. It's worth a try though. I don't know why you would want metabase explorer? Just open applicationhost.config and you are ready to go. If you
are scared to screw something up you can just make a file backup of applicationhost.config and you simply copy it back if you made a mistake. You can also use %windir%\system32\inetsrv\appcmd add backup <name of your choice> to make a backup.

Re: IIS 7: InetPub Location

I'll have to test it out. What I'm afraid of is if, say I were to uninstall a module after changing a path, that it will remove that section. And then if that module were reinstalled, the default setting would be written.

I didn't mean Metabase Explorer, persay. Just a tool that would give us a GUI for editing the sections. Sort of like how the IIS Manager does. A snap-in to the IIS Manager for editing that file as part of "power toys" or a "tool kit" would be VERY nice.
:)

For now, I'll stick to manual editing and see how it works. Thanks, again!

Re: IIS 7: InetPub Location

Yep. Basically just an interface in which one can directly edit the values of the properties in the admin/apphost config files. Perhaps something available as a snap-in or something. It may seem like a silly request, but it'd be a life saver for those administrators
who aren't that hip on XML. It'd also simplify things for those of us who are. :)

Re: IIS 7: InetPub Location

thomad

Storm,

If your request would be a common ask we would implement this feature in a heartbeat. It's the first time that I hear this request though.

Don't get me wrong, moving the content directory to a different drive (%systemdrive%\inetpub\wwwroot) is a very common request. The reason we don't do it by default is that during IIS setup we can't be sure that there is another partition and that customers
want their content directory there. We can't show UI during setup because customers are even more annoyed about that (i.e. when you go to lunch and kick off an Windows install and expect it to be done when you come back. Instead you see a dialog box that asks
you for a path).

Moving all of inetpub is not very common though. There is an relatively easy way however. You can xcopy %systemdrive%\inetpub\ to a different partition and then open %windir%\system32\inetsrv\applicationhost.config.

You know, maybe this is not a common request because this forum is closed to anonymous posts and because it doesn't use the passport authentication like the technet communities and so it is a pain for people to post here.

But I'm annoyed enough that I joined.

I guess I don't understand enough about IIS 7 to understand why it is ok that we can't do with it what we did with the last version. I guess I don't feel like I should have to. I thought an upgrade was supposed to add functionality, not take it away. Of
course we can't just choose not to upgrade, because support goes away.

Anyway, here is another person making the request. If you google, or "live search" the rest of the internet, you will find others asking the same thing. Please Microsoft, put out a patch or a hotfix or at least a KB article that supports installing IIS
7 on a different drive. Failing that give us the official script to move C:\inetpub and make sure it actually works when we patch and apply service packs. I'm so tired of trying to learn how to keep our environment up and running on Microsoft products based
on the grapevine.

Re: IIS 7: InetPub Location

I have to completely agree with swgarasu. My company recently started integrating iis7 on 2008. From searching the net and this site I see many users that, like us, their company policy requires the inetpub directories to be located off
the OS volume. Our strategy and the strategy of many others has been to seperate as much application I/O from the OS drive as much as possible. I have noticed that the blogged fixes and scripts posted by Thomad, while operational as far as IIS7 is concerned,
has broken our third party backup software (EMC Networker) in that somehow VSS is looking for the original install location and this kicks an error that the VSS system writer has failed. This suggests that there is still a config or association that is telling
VSS that the default path for inetpub is on C:\ (we've moved to D:\). This also concerns me that VSS is not handling the new path correctly and we may not be able to restore based off of this. We're also left wondering if more will break down the road as
updates are applied.

IIS by now should allow for specifying a new default path during setup, or allow for migrating to a new default path post-install. This just makes sense and should be configurable from a snap-in. For all the new snap-in capability, it's starting to feel
like just as much xml editing, scripting, and CLI config has been additionally necessary to deploy several components of 2008.

Re: IIS 7: InetPub Location- VSS Writer issue!!!

We could copy a dummy folder back to the original location to fool the vss writer. We had to abandon EMC networker for our backup solution though, it would not restore IIS correctly. Our version is outdated though. We ended up using Windows server backup to
a proxy server and used networker to backup the image files created by Windows server backup.

Re: IIS 7: InetPub Location

Seems that I forgot to set the pathftproot and pathwwwroot locations in the script.I updated the script and you should be able to download the updated version from my blog (http://blogs.iis.net/thomad).

The installpath is not changed. It's just the content that can be moved off the system partition.

Re: IIS 7: InetPub Location

Another here who is sufficiently astonished/annoyed by this to sign up to this site!

I cannot believe that the post on this forum was the first/only time Microsoft heard of this requirement. Every client I've worked with over the past 5 years installed IIS on a non-OS drive, it's just standard practice, you must know this?

I'm deploying IIS7 for the first time at the moment. Using a script found on a forum is not going to cut it for my client... I'd say this is an absolutely 100% essential requirement for MS to fix pronto.

Re: IIS 7: InetPub Location

Mmm... we need to be more specific here. the non-IIS binaries can be customize during setup (unattended/scripting/etc), however the core binaries/config are in %systemdrive%. and yes - during manual setup - IIS should prompt for the default website/log/etc
location, it would benefits a lot of users, me included, coz for now - we do custom package for IIS and deploy website/log/etc to non-OS drive.

Re: IIS 7: InetPub Location

This is most likely an "uncommon feature request", due to this ability always being there. I, like 1000's of other dev's and admins, prefer to put our data directories on another partition. I've been doing this with IIS installs since 1999. Even a program as
complex as SQL server 2008 allows you to specify another partition/location for a data directory during the install process. How can this not be a simple screen with 2 radio buttons? (Like a: default inetpub location / b: specify inetpub location).

While creating the developer VM we intend to use for our next gen, i found this shortcoming. I cannot believe how hard it is to move the inetpub location now. In IIS 6, this was right click, edit, ok..

Re: IIS 7: InetPub Location

I just wanted to add my voice as another person that would love there to be a built in option which allows you to choose which drive to install to. With IIS 6 this was incredibly easy by performing an unattended install. My company like many others has audit
requirements which forbid us from placing web content on the system drive. Initially I was running the moveIIS7root script on our servers, but I have since stopped using it due to fears that we would run into issues down the line with 3rd party apps. I'm not
even asking for a UI option that allows you to choose a drive. If there was a way to script the install to a different drive like we could with IIS 6 then I think it would make everyone happy.

Re: IIS 7: InetPub Location

The current IIS 7 unattended config file not really support this yet. It covers only what components need to be install. So i'm afraid after the unattended install, you still to run the custom script like discussed in this thread to do post migration configuration.
would be nice to have this feature add in.

Re: IIS 7: InetPub Location- VSS Writer issue!!!

We're having the same isse with the VSS system writers, this time with the latest version of IBM Tivoli Storage Manager Backup-Archive client, on windows 2008 servers where the inetpub folder under IIS has been moved from the C: drive.

Re: IIS 7: InetPub Location- VSS Writer issue!!!

Just want to add another voice to this issue. The lack of support for installing to different drives is disconcerting. I moved everything to a new server so that I could take advantage of IIS 7 features, but this basic failing bars me from exploring any of
its purported improvements.

Re: IIS 7: InetPub Location- VSS Writer issue!!!

My 2 cents - Need to improve unattended install from IIS product team.
However, if 3rd party apps failed to so called 'integrated' with the changes in IIS 7, IMHO - you should bug the apps product owner/vendor. this is beyond IIS scope for integration.

Re: IIS 7

Using the script I found that you can delete the entire inetpub directory but this one file lags behind in the custerr folder called 500-100.asp and I can't find anything anywhere about how/if it needs to be remapped like all the other custom error pages.
Other than that the rest works great and have even converted it all over to a PoSH module we deploy over AD to push out the change. Is there an appcmd for the 500-100.asp page?

Re: IIS 7

500-100.asp doesn't exist in custom error page of IIS 7. this is old IIS 6 implementation, are you still using it ? the default custom error page doesn't work with substatus code, you do need it in detailed error msgs/etc. Read more - http://learn.iis.net/page.aspx/267/how-to-use-http-detailed-errors-in-iis-70/

Sir PoSHaLot

Using the script I found that you can delete the entire inetpub directory but this one file lags behind in the custerr folder called 500-100.asp and I can't find anything anywhere about how/if it needs to be remapped like all the other custom error pages.
Other than that the rest works great and have even converted it all over to a PoSH module we deploy over AD to push out the change. Is there an appcmd for the 500-100.asp page?

Re: IIS 7: InetPub Location

Thomad, I have been working with IIS since version 2 and we have always placed the Inetpub on an alternate drive to separate it from the OS for a number of reasons. One being it is a "Best Practice" recommended by Microsoft. I have been searching the Internet
for a few days now trying to find a single, proven way of doing this. I have seen suggestions from "Just move it to the alternate drive" to " Run this BAT file and it will take care of everything" to "Run AppCmd and it will take care if it". I find it very
dissapointing that the vendor of the product does not provide a method of selecting an alternate location during the install process and does not provide a single, proven method of doing the relocation after the install considering that it recommends separating
the web data from the OS.