开发者

Windows hosts file and IIS binding question

开发者 https://www.devze.com 2022-12-23 17:46 出处:网络
I\'m building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones.

I'm building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones. My workstation has a local SharePoint, and I use it for development. My workstation has a static IP, and is connected to the internet.

When I make a SharePoint site, I want to add a host header, for instance, devbox.com. I do not own this name, nor do I want to. I then add an entry in my hosts file, but when I surf to http://devbox.com:8080, it does not resolve. Do I need to register the name I开发者_运维知识库 want to use, or should this work, i.e., have my hosts file resolve names/IPs first?


It should work. You will need to make sure your website has the right mappings, though. For example, if you want your site to respond to http://devbox.com:8080, you'll need to either set up your website to respond to all IP addresses and port 8080, or to respond to the devbox.com host header and port 8080.

BTW, to test whether your HOSTS file is set up correcly, open up a command line and PING devbox.com. You should see the address resolved to your local machine's IP address. If not, you've done something wrong in how you've set up your HOSTS file... please post the line in the HOSTS file that you're using.

BTW, per my comment below, you should probably use 127.0.0.1 (aka localhost) in your HOSTS file line, rather than your external IP. This will remove the IP address as a potential point of failure (e.g. in case a firewall blocks the traffic)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号