只需将一个新网站添加到您的服务器并为其提供一个空白主机标头。这意味着,它将接受所有指向服务器 IP 地址并且不与另一个 Web 关联的主机头(域,还有 localhost 等)。通常默认 web 的文件夹是“Inetpub\wwwroot”,所以设置 whis 文件夹为“本地路径”。
There is only one problem. Websites in IIS have a unique identification number. Some tools or application may want the "Default Web Site" to be W3SVC/1 which is the default ID. So, instead of following what I proposed above, there is another option. Use the adsutil script.
Make sure that there isn't a W3SVC/1 already there (you'll never know). In a command-line prompt go to the
Inetpub\AdminScripts
folder and execute this:
cscript adsutil.vbs enum w3svc/1
If it comes back with "path requested could not be found" there is a problem. Do the following:
cscript adsutil.vbs enum w3svc
You should get: w3svc/Info w3svc/Filters and at least one w3svc/NUMBER where the NUMBER is what you need.
To find your new default web site number will take some looking up. Search using this:
cscript adsutil.vbs enum w3svc/###
putting the numbers you saw in the list.
Create the new W3SVC/1:
cscript adsutil.vbs create_vserv W3SVC/1
Copy it
cscript adsutil.vbs copy W3SVC/### W3SVC/1
Set it
cscript adsutil.vbs set w3svc/1/ServerComment "Default Web Site"
只需将一个新网站添加到您的服务器并为其提供一个空白主机标头。这意味着,它将接受所有指向服务器 IP 地址并且不与另一个 Web 关联的主机头(域,还有 localhost 等)。通常默认 web 的文件夹是“Inetpub\wwwroot”,所以设置 whis 文件夹为“本地路径”。
There is only one problem. Websites in IIS have a unique identification number. Some tools or application may want the "Default Web Site" to be W3SVC/1 which is the default ID. So, instead of following what I proposed above, there is another option. Use the
adsutil
script.Make sure that there isn't a W3SVC/1 already there (you'll never know). In a command-line prompt go to the
folder and execute this:
If it comes back with "path requested could not be found" there is a problem. Do the following:
You should get: w3svc/Info w3svc/Filters and at least one w3svc/NUMBER where the NUMBER is what you need.
To find your new default web site number will take some looking up. Search using this:
putting the numbers you saw in the list.
Create the new W3SVC/1:
Copy it
Set it
可以在这里找到一个可能的解决方案:http ://www.gafvert.info/iis/article/create_default_website.htm