Muhammad Adeel Zahid
Muhammad Adeel Zahid

Reputation: 17794

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. 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

enter image description here

Only thing i have done differently is to use netsh>advfirewall>firewall context because it was telling me that netsh firewall is deprecated. I used following command to allow port 80 through firewall

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

<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. 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. 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. i also allowed port 80 through firewall but the whole thing does not seem to work for me. Any ideas?

Upvotes: 1

Views: 9142

Answers (1)

vikomall
vikomall

Reputation: 17539

Are you starting iis express from command line or using WebMatrix?

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'

  2. run following command

    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. URL reservation command should like below

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

Upvotes: 4

Related Questions