Skip to content
October 28, 2011 / windperson

設定IIS Express可供遠端IP存取

Visual Studio內建的Visual Studio Development Server無法提供非本機端(網址非localhost)的服務,預設IIS Express也是如此;不過可以修改,如下方法。

  1. 開啓有系統管理者權限的命令列視窗,執行
    • Windows XP:
      httpcfg set urlacl /u http://*:%5B埠號%5D/ /a D:(A;;GX;;;WD)
    • Windows Vista or 7:
      netsh http add urlacl url=http://*:[埠號]/ user=everyone
  2. 修改IIS Express的application host.config設定檔,將原本該站台的
    <binding protocol=“http” bindingInformation=“:[埠號]:localhost” />
    改成
    <binding protocol=“http” bindingInformation=“*:[埠號]:” />

之後要恢復原始狀態時,執行以下命令

  • Windows XP:
    httpcfg delete urlacl /u http://*:[埠號]/
  • Windows Vista or 7:
    netsh http delete urlacl url=http://*:[埠號]/

並且記得將IIS Express的applicationhost.config設定檔內先前修改的部分改回去。

reference: http://learn.iis.net/page.aspx/1005/handling-url-binding-failures-in-iis-express/

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: