简体   繁体   中英

IIS 7 Windows Server 2008 password protect

Generally speaking I am PHP developer working on Apache. I have however taken on new site, that is built in ASP.net(VB) and is obviously running on IIS. I have set up a subdomain, and I wanting to password protect this domain, so only myself and people I allow will be able to access the domain.

Normally on apache I could do this sort of thing with a .htaccess and .htpassword file. I know that I could make .htaccess work on IIS but I do not to have to fight to make something work, when I am sure that someone will be able to tell that is a built in way in IIS to do this.

Could someone shed any light on how to lock my website down, so I can create a username and password so I can lock my domain down while in beta?

FYI, though not a direct correlation, the .htaccess equivalent in IIS is your web.Config file.

To get this working, you'll need to enable Windows Authentication in your Web.Config.

<authentication mode="Windows">

And you can set who's authorized like this.

<configuration>
  <system.web>
    <authorization>
      <allow roles="domainname\Managers" />
      <allow users="domainname\user1,domainname\user2,domainname\user3" />
    </authorization>
  </system.web>
</configuration>

Here's a more detailed instruction , as well as here and here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM