简体   繁体   English

配置IIS Express以使用http和https的默认端口进行调试

[英]Configuring IIS Express to use default ports for http and https for debugging

I have followed scot's article on how to enable default ports (80 and 443) for http and https respectively. 我已经关注了苏格兰文章中关于如何分别为http和https启用默认端口(80和443) 的文章 I have followed each step to the letter and in the end IIS express sytem tray shows me that site is running on following urls 我已经按照每一步跟踪信件,最后IIS express sytem托盘显示我的网站正在运行以下网址

在此输入图像描述

Only thing i have done differently is to use netsh>advfirewall>firewall context because it was telling me that netsh firewall is deprecated. 我唯一不同的是使用netsh>advfirewall>firewall上下文,因为它告诉我netsh firewall已被弃用。 I used following command to allow port 80 through firewall 我使用以下命令允许端口80通过防火墙

netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80 

Here is the relevant site section from applicationhost.config file of IIS Express 以下是IIS Express的applicationhost.config文件中的相关站点部分

<site name="SSLTest" id="4">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="G:\Adeel\SSLTest\SSLTest" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:51518:localhost" />
                    <binding protocol="https" bindingInformation="*:44301:localhost" />
                    <binding protocol="http" bindingInformation="*:80:mhlabs" />
                  <binding protocol="https" bindingInformation="*:443:mhlabs" />
                </bindings>
            </site>

Edit: The problem is that when i browse to http:/mhlabs or https:/mhlabs it does not work. 编辑:问题是,当我浏览到http:/ mhlabs或https:/ mhlabs时,它不起作用。 I get not found page of the browser. 我找不到浏览器的页面。 how can i get around that. 我怎么能绕过那个。
Edit2: Ok, as a first step, i would like to forget ssl and just reserve a url for test-one on port 80 and run my site on this url. 编辑2:好的,作为第一步,我想忘记ssl并在端口80上保留测试一个网址,并在此网址上运行我的网站。 The logical steps that come to mind is that i reserve a url using netsh http add urlacl url=http://test-one:80/ user=everyone and add this entry in bindings section of applicationhost.config file. 我想到的逻辑步骤是我使用netsh http add urlacl url=http://test-one:80/ user=everyone保留一个url,并在applicationhost.config文件的bindings部分添加此条目。 i also allowed port 80 through firewall but the whole thing does not seem to work for me. 我还允许端口80通过防火墙,但整件事似乎对我没用。 Any ideas? 有任何想法吗?

Are you starting iis express from command line or using WebMatrix? 您是从命令行还是使用WebMatrix启动iis express?

If you are not starting it from command line, try following steps and see if there are any binding errors. 如果您不是从命令行启动它,请尝试执行以下步骤,看看是否存在任何绑定错误。

  1. start command prompt, goto iis express installation folder '%programfiles%\\iis express' 启动命令提示符,转到iis express安装文件夹'%programfiles%\\ iis express'

  2. run following command 运行以下命令

    iisexpress.exe /site:SSLTest iisexpress.exe / site:SSLTest

  3. If there are any bindings registration failure, you would see some error message. 如果有任何绑定注册失败,您会看到一些错误消息。 If there is any error for 'mhlabs' binding registration, make sure your URL reservation is correct. 如果'mhlabs'绑定注册有任何错误,请确保您的URL保留正确。 URL reservation command should like below URL预留命令应如下所示

    netsh http add urlacl url=http://mhlabs:80/ user=everyone netsh http add urlacl url = http:// mhlabs:80 / user = everyone

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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