Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a site set up in IIS, and I have a virtual directory that should only be available to localhost.

In IIS6, this was trivial to set up.

However, those property sheets are gone in IIS7 and I cannot find a corresponding setting. RequestFiltering and denyURLSequence isn't right, because that doesn't have an attribute for IP, at least, not that I could find.

Thanks!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You need IIS module called "IP and Domain Restrictions" (bundled with IIS) .. or grab improved version: Dynamic IP Restrictions.

Once installed configure to block all IPs except selected (should be no problems at all -- very easy GUI).

share|improve this answer

You can include the following code block inside your web.config file of the virtual directory to restrict access only to localhost.

<system.webServer>
        <security>
            <ipSecurity allowUnlisted="false">
                <add ipAddress="127.0.0.1" allowed="true" />
            </ipSecurity>
        </security>
</system.webServer>

If you already have the system.webServer block, then you need to add only the security block.

share|improve this answer
1  
You would still have to make sure that the IP and Domain Restrictions module is installed in IIS for that to work. –  vcsjones Jul 26 '11 at 0:28
    
Thanks sparx. I tried this, but it seemed as if IIS wasn't picking up on the existence of the file. In fact, I had changed several things in applicationHosts.config as well and those changes weren't noticed, either. I have feature delegation turned on (I think), so no idea what was going on. –  marc esher Jul 26 '11 at 11:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.