如何将http:// localhost:8080映射到iis7中的http:// mysites? [英] How do i map http://localhost:8080 to http://mysites in iis7?
问题描述
基本上我希望能够输入 http:// mysites 并向我展示我的本地人,而不是输入 http:// localhost:8080 / ?
Basically i want to be able to type in http://mysites and it show me my localsite rather than typing in http://localhost:8080/?
我打算这样做它有点像 http:// localhost:8181 到 http:// mysites2
I intend to do it a few times like http://localhost:8181 to http://mysites2
我以为你可以通过主机文件来做到这一点?
I thought you could do it via hosts file?
这是我机器上的所有地方
This is all localy on my machine
推荐答案
如前所述,您可以编辑hosts文件(或更新本地DNS)服务器),以便名称指向所需的IP地址。有些浏览器在名称中没有DOT时会遇到问题,因此您可能需要执行类似 mysites.local
或 mysites.ivor
As stated before, you can edit the hosts file (or update a local DNS server), so that the names point to the desired ip addresses. Some browsers have trouble with cookies when there's no DOT in the name, so you may want to do something like mysites.local
or mysites.ivor
如果在端口80上运行其他东西,则必须配置该服务器以代理对IIS的请求(在端口80上)。如果你不能在端口80上运行任何东西,你可以配置名称,但你仍然需要最后的端口。
If there's something else running on port 80, You have to configure that server to proxy the requests to IIS (on port 80). If you can't run anything on port 80, you can configure the names, but you'll still need the port at the end.
如果只有IIS正在运行,您可以使用虚拟主机进行设置。您将端口80上的IP地址绑定添加到您指定的DNS名称。只要它们具有不同的主机名,您就可以在一个端口上运行它们。
If only IIS is running, you can set this up by using virtual hosts. You add a binding to the IP address, on port 80, to the DNS name you specified. You can run them all on one port as long as they have different host names.
这篇关于如何将http:// localhost:8080映射到iis7中的http:// mysites?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!