locked
Enable Directory Browsing for Port 115 but not 80 RRS feed

  • Question

  • User-445579667 posted

    I've been trying to enable Browsing for my local developement website directory without affecting the equivalent port 80 public facing website. Every time I disable browsing in one the Site it automatically disables the other Site they both Sites have a different and port number. Why can't IIS7 change browsing on a Site dependent basis? Or more importantly if it is possible how can I do it. I read the IIS7 help section and it was Zero assistance.

    http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx

     this screws up my way of programming where I can just go to the browser and just type in: http://hostname:115/ and be able to execute my various asp programs while navigating through the directory. Obviously for the http://www.domain_name.com version of the site i don't want users browsing the directories but just seeing the default document that I've indicated. I found that when I disable default document then browsing is active on both versions of the site:

    http://hostname:115/

    http://www.domain_name.com

     

    Anyone have any thoughts on this?

    Friday, April 9, 2010 4:35 PM

Answers

  • User744767459 posted

    Hi,

    Please check the IIS Manager status bar to see where the Directory Browsing setting stored . It is probably stored in web.config file which resides in your web content folder. In this way, your changes on one site's Directory Browsing feature will be replicated to the other site.

    If this is your case, you can specify the section stored in applicationhost.config file by using Configuration Editor.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, April 14, 2010 6:23 AM

All replies

  • User1073881637 posted

    One idea, have two IIS sites, one on port 80 (which is the www.example.com one) then have another site on 115 pointing to the same location on disk.  The down side is the default document will kick in since that is the way it works.  It makes sense when you disable default document, IIS ignores that and displays the folder structure.   I'm not sure the idea of developing dectly against a live site will meet all your requirements.  I'd suggest having two separate sites.  One DEV and another PROD. 

    One other thing you could look at doing is having URL Rewrite rules, which would do this.   It's a workaround and would meet your needs.  I like the separate IMO, my 2 cents.

    Sunday, April 11, 2010 10:51 PM
  • User-445579667 posted

    Hi Steve,

     

    I probably wasn't clear on how the two websites were set up. I first Site A on port 80 pointing to a specific file folder and made sure to disable folder browsing and enabled default document.  At this point everything worked just fine.

     Then at a later time I defined another Site B this one on port 115 that points to the same folder that houses the production website. What I found is that if I disabled the default document on site B it also disabled the default document on site A.

     Sorry I was unclear about that.

    Monday, April 12, 2010 4:50 PM
  • User744767459 posted

    Hi,

    Please check the IIS Manager status bar to see where the Directory Browsing setting stored . It is probably stored in web.config file which resides in your web content folder. In this way, your changes on one site's Directory Browsing feature will be replicated to the other site.

    If this is your case, you can specify the section stored in applicationhost.config file by using Configuration Editor.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, April 14, 2010 6:23 AM
  • User-445579667 posted

    Thanks for your response sorry it took me a while to get back to you. We had some fires to put out recently and I had to drop that specific issue for a brief period. I'm going to try your recommendation today. I really hope it works!

    Monday, April 26, 2010 12:50 PM
  • User-445579667 posted

    Leo,

     I was able to find the web.config file with no problem in the base directory of my default website. It turns out that I have the development website (the one I want to be able to browse)  looking at the same folder path as the default website. In IIS5 this wasn't a problem I could enable the default document on port 80 and enable directory browsing on port 115 and even though they both looked at the exact same directory path, anonymous users always ended up executing the default document and local developers always ended up being able to browse to the programs they wanted to work on.

    How can I duplicate this feature in IIS7. I don't want to create two separate folders areas on disk and then try and maintain the most current programs in both of these directories.

    Monday, April 26, 2010 1:45 PM
  • User744767459 posted

    Hi,

    As the development website has the same folder path as the default website, the configuration section stored in web.config will be replicated to all the sites pointed this folder. With IIS5, this configuration stored in Metabase under corresponding keys.

    You can enable the directory browsing for the specified site in applicationhost .config by using <location/> tag. This also can be done via appcmd command:

    C:\Windows\System32\Inetsrv> appcmd.exe set config "your site's name" -section:system.webServer/directoryBrowse /enabled:"True" /commit:apphost

    For more information, please refer to:

    Deep Dive into IIS 7.0 Configuration
    http://learn.iis.net/page.aspx/127/deep-dive-into-iis-70-configuration/

    If you have any problem, please let me know. Thanks.

    Monday, April 26, 2010 8:57 PM
  • User-445579667 posted

    Hi thanks for your quick response I appreciate it.


    below are the paths showing in IIS7 for the two websites I'm currently working on. (desired functionality in parenthesis)

    VFSAILING\Sites\VF Sailing (active site: default document enabled and directory browsing disabled)
    VFSAILING\Sites\VF Sailing Develop (developer site: default document disabled, directory browsing enabled)

    both of the above web sites point to this physical path "C:\VF_Hosted_Websites\SailingServices"

    so would the proper code with location tags be this:

    <location path="VFSAILING/Sites/VF Sailing">
      <system.webServer>
        <defaultDocument enabled="true"/>
        <directoryBrowse enabled="false"/>
      </system.webServer>
    </location>

    <location path="VFSAILING/Sites/VF Sailing Develop">
      <system.webServer>
        <defaultDocument enabled="false"/>
        <directoryBrowse enabled="true"/>
      </system.webServer>
    </location>

    I only found the applicationhost.config file in the following directory "C:\inetpub\history" why isn't it located in the base directory of the default web site "C:\VF_Hosted_Websites\SailingServices" like the web.config file was? where should I create the applicationhost.config file? Can i just put the location tag code in it or do I have to put a lot of other stuff to?

    It seems like the IIS7 administrator is being asked to dig a lot deeper to do the most basic things in web site management. I hope the next version of IIS7 doesn't require the administrator to start learning and writing .net code as well. I'm sorry I'm venting but it does seem like a pain given that the administrators of today in our poor economy now have to be the network, archive, storage, O/S and web site administrators. So you can't really expect them to learn each new version of a basic windows feature in much greater detail it mulitiplies the difficulty logarithmically.

    Tuesday, April 27, 2010 10:01 AM
  • User744767459 posted

    Hi,

    ApplicationHost.config is the root file of the IIS 7.0 new configuration system, it is available in C:\windows\system32\inetsrv when IIS web server is installed.

    We can manager IIS through multiple ways. In this case, I'd recommend you adjust the directory browsing setting by using Configuration Editor, it will generate the <location/> tag automatically for you. To use the Configuration Editor, you can follow the steps below:

    1. Install IIS Administration Pack(only IIS7.0 on Windows Server 2008/Windows Vista needed).
    2.Open IIS Manager, high-light VF Sailing Develop site on the left Connection pane.
    3.Click Configuration Editor icon on the home pane.
    4.Select "system.webServer/directoryBrowse" in the Section dropdown list.
    5.Select "Applicationhost.config<location path...>" in the From dropdown list, set enabled=True, Apply.

    If you have any comments, please feel free to let me know. Thanks.

    Tuesday, April 27, 2010 10:02 PM
  • User-445579667 posted

    Leo,

     I'm going to install the IIS Administration Pack and give it a try.

     I'll let you know how it works.

    doug

    Wednesday, April 28, 2010 4:00 PM
  • User-445579667 posted

    After installing IIS7 Admin Pack, I went ahead and followed your instructions.

    I got to the point where after selecting ApplicationHost.config <location path='VF Sailing Dev (From dropdown list)

    I saw a heading that said Deepest Path: MACHINE/WEBROOT/APPHOST

    enabled=False (already) but in fact the actual VF Sailing Develop site had the directory browse set to true and I had been using it successfully which makes me think that either the Configuration Editor is looking at a different file than the one actually be used by the active VF Sailing Develop site or it always pops up with that False value in place.

    Please see the link with IIS7 Editor Configurator screen shot. http://75.149.181.173/IIS7/IIS7_ConfigurationEditor.jpg

    Please see the link with IIS7 Regular Panel screen shot. http://75.149.181.173/IIS7/IIS7_RegularPanel.jpg 

    Wednesday, April 28, 2010 5:09 PM
  • User-445579667 posted

    Leo,

     I tried to send you two links but a message came up after hitting the post button that says it may have to be approved or something like that.

    I wanted to send you two screenshot jpg's one of IIS7 regular panel and one of the IIS7 configuration editor panel so you could see that one shows that Directory Browse is enabled the other shows it isn't. It seems to me that if they were looking at the same xxx.config file shouldn't they be in agreement?

     

    BTW I was able to install and run the IIS7 Admin Pack and run it no problem.

    Wednesday, April 28, 2010 5:15 PM
  • User744767459 posted

    Hi,

    Sorry, my mistake. I forgot to mention that we need to remove the <directoryBrowse /> section in web.config file manually. Then adjust the settings for both sites by using Configuration Editor. In this way, they will looking at different location tags in Applicationhost.config file.

    If anything is unclear, please feel free to let me know.

    Wednesday, April 28, 2010 8:43 PM
  • User-445579667 posted
    Ok, I'll give that a try.  Yes I'm still unclear about one matter. I stopped my default website as soon as I got into IIS7 over a year ago. Because I always add my own website names and folder paths which are never located on the C Drive. So what I'm not clear about is this, like I told you before I found many instances of the applicationhost.config file in C:\inetpub\history. Each file has a different date on it.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>So I'm thinking that there should be at least one other of these applicationhost.config files somewhere. But if what you saying is that the IIS7 configuration editor looks at this file then I'm ok. Now I'm wondering if I need to remove the Browse Direct> from the web.config in the base directory we were talking about or do I need to remove the Browse Direct> from all the different web.config files?<o:p></o:p>

    doug

    Thursday, April 29, 2010 2:47 PM
  • User744767459 posted

    Hi,

    For your information, IIS will automatically make history snapshots of ApplicationHost.config each time a change is detected, enabling you to easily restore to a prior version.  By default, IIS checks for a new version every 2 mins, and will keep 10 prior versions of the file.  IIS7 stores these snapshots in the %systemdrive%\inetpub\history folder by default. The ApplicationHost.config file being used located in \windows\system32\inetsrv\config directory.

    In this case, as configuration in the root config file will be overwritten by the same configuration in sub web.config file(here is the web.config file in  "C:\VF_Hosted_Websites\SailingServices" ), so we need to remove the <Browse Direct> in this web content folder.

    Thursday, April 29, 2010 9:31 PM
  • User-445579667 posted

    Hi,

     Ok great information. I will now inspect that the ApplicationHost.config file is currently in my \windows\system32\inetsrv\config directory. Ok I did find the config files there just like you said.

    Ok I'm going to remove the  <Browse Direct> from web.config in "C:\VF_Hosted_Websites\SailingServices" ).

    I'm going to make a backup of the web.config file first.

     So I take that what will happen is once I remove the Browse Direct entry from web.config it will be snapshot and the change will now occur in the ApplicationHost.config file. So once I start seeing the Browse Direct appearing in the ApplicationHost.config file I'll either use the configuration editor inside IIS7 or I'll use Notepad to find the entry and make an additional copy of the entry  so we have one pointing to each of the websites.

    Friday, April 30, 2010 3:07 PM
  • User-445579667 posted

    Leo, I noticed something I accidentally removed the Direct Browse tab from the web.config in VF Sailing website base folder. So I opened up the configuration editor in IIS7 for each of the websites that we've been discussing

    I checked the VFSailing website and found that the system.webServer/directoryBrowse said enabled False in both the web.config & applicationhost.config files. This makes sense since I never meant to activate the DirectoryBrowse feature for this website

    Then I checked the VFSailing Develop website and found that the system.webServer/directoryBrowse said enabled False for the ApplicationHost.config file but it was enabled True in the web.config file. So if I remove it from the web.config file it should be false in both files then I should use the configuration editor to go into the ApplicationHost.config file and set enabled to true for the VF Sailing Develop website. do I have a proper understanding?

    Friday, April 30, 2010 3:44 PM
  • User-445579667 posted

    Leo,

    It worked! I found the entry below in the ApplicationHost.config file after making the changes you suggested. I noticed that even though the configuration editor said that the system.webServer/directoryBrowse said enabled in the pointer to the web.config file, when I inspected the web.config file in the VF Sailing Develop base folder it still didn't have an entry for the DirectoryBrowse feature but now the ApplicationHost.config file did. So I think I'm good to go. Next thing I have to figure out is how to add security certificate to IIS7 webserver :-}

     

    <location path="VF Sailing">
            <system.webServer>
                <security>
                    <authentication>
                        <basicAuthentication enabled="false" />
                        <anonymousAuthentication enabled="true" />
                    </authentication>
                </security>
                <asp appAllowClientDebug="true" enableParentPaths="true" />
            </system.webServer>
        </location>
        <location path="VF Sailing Develop">
            <system.webServer>
                <asp enableParentPaths="true" />
                <directoryBrowse enabled="true" />
            </system.webServer>
        </location>

    Friday, April 30, 2010 4:10 PM
  • User1073881637 posted

    Next thing I have to figure out is how to add security certificate to IIS7 webserver :-}

     

    http://learn.iis.net/page.aspx/144/how-to-setup-ssl-on-iis-7/

    Friday, April 30, 2010 9:28 PM
  • User-445579667 posted

    Steve,

     thanks I read up on SSL security certificates in IIS7 from the link you provided.

     doug

    Friday, April 30, 2010 10:14 PM
  • User-445579667 posted

    Hi Steve,

    I went into my IIS7 Feature panel after selecting the website I wanted to add a server certificate to. Then I looked for (but couldn't find) the Server Certificates icon. So I couldn't click on it. I tried to add this feature using the Add Feature in Control Panel\Programs and Features area. So how do I find the Server Certificates icon or add it to my IIS7 Features Pane?

    Monday, May 3, 2010 2:31 PM
  • User-445579667 posted

    I ended up finding the Server Certificates on the IIS7 Servers Home Page. So I'm now just going to add my server certificate like I did when I was working with my older windows 2003 Server.  I'll let you know if I get stuck on.

    Monday, May 3, 2010 4:18 PM