0

I have an asp.net site which I am not able to access from either within or outside the network. I am able to access it only from my machine, from where I am running the site. Firewall is managed by a software called Eset and only when I disable it, does the site even open on my local system. I have punched a hole in the firewall for the port used by the site, inspite of which I am not able to access the site from another machine. There is a port forwarding rule in the router as well, which redirects traffic to my machine.

I followed the instructions here and here, which did not help.

Please let me know how I can make this work?

Edit 1: Contents of the IISExpress/config/applicationhost.config file.

<site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/">
        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation=":8080:localhost" />
    </bindings>
</site>
<!--site name="WebSite2" id="2" serverAutoStart="true">
    <application path="/">
        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite2" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation=":8080:192.168.1.12" />
    </bindings>
</site-->
<site name="DataArchive" id="3">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="D:\Main\Work\SOURCE\WORKING\eMote\MicroFrameworkPK_v4_3\APPS\DataArchive\DataArchive" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:64068:localhost" />
    </bindings>
</site>
Community
  • 1
  • 1
Sarvavyapi
  • 810
  • 3
  • 23
  • 35

3 Answers3

2

First: check your local (developer) machine:

you should have configured your site in your IIS Server, not only in a temporary visual studio (simulated iis), be sure you could enter to your site with a browser with a url like this.

http://localhost/yoursite       (yoursite should be configured on iis administrator)

(if problems check how to configure IIS)

Second check your local ip address now try with your local ip in your local machine, so view your local ip with IPCONFIG command in CMD window and try this: replace "localhost" with "your ip address" like this

http://192.168.1.15/yoursite

(if problems check your configuration in IIS, rare problems here)

Third if both previuos steps works try the same url address inside your local network from a computer in the same segment of the network with the same Url

http://192.168.1.15/yoursite

(if problems check WINDOWS FIREWALL, check ESET firewall, Check if there another firewalls, check router configurations, eliminate ip forwardings in your routers)

Fourth Configure public IP to your local IP if last step works, and you want to view your page from external machine, you should point the public ip from your router to your local server ip, try this its the most simple way

configure DMZ in your router, forwarding all ports to your local machine.

if your public ip is 200.105.210.190 configure a DMZ forwarding all ports to your local ip 192.168.1.15

so all the world can access to your machine with the following url

http://200.105.210.190/yoursite

if problems check router configuration. public IP should be configured to the router local ip should be an static ip

Mike
  • 91
  • 1
  • 2
  • Thanks. First step works. But the second step does not work (with the IP address). I have added the contents of applicationhost.config file to my question. – Sarvavyapi Oct 02 '14 at 21:45
  • I think you are using IIS Express not IIS conventional please refer http://stackoverflow.com/questions/3313616/iis-express-enable-external-request for express – Mike Oct 03 '14 at 15:37
  • Thanks. I was able to fix the issue. I will post it as an answer (it was more complicated than what I had imagined) – Sarvavyapi Oct 03 '14 at 17:01
1

This is what I did to fix the issue. I am a newbie in this and did not know that I needed to install/configure the IIS web server. I was under the impression that the IIS server local to visual studio would take care of my needs of accessing the site from within and outside the network.

  1. I followed this tutorial (install IIS on windows 7) to install the IIS server.
  2. I then published the site from visual studio (I watched this video).
  3. Observed that I was able to access the site as

http://localhost/home/index

but not as

http://192.168.1.x/home/index. 

Found out that I had to configure the host header. This SO question and this link helped me do that.

  1. But still I was not able to access the site with my local IP address and I was not even able to start the site from IIS manager (even after assigning a new port). I restarted my machine and upon bringing up the project on visual studio, came across this message - "The url is configured to use iis express as the web server but the url is currently configured on the local iis server". So, I disabled the local IIS server on visual studio by following this question.

  2. While trying to bring up the project on visual studio again, this message popped up - "asp.net 4.5 has not been registered on the web server. you need to manually configure". Followed this SO question and this site to fix the issue. This is the command that I ran:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i

  3. After this, I configured the bindings for my site on IIS manager to use my local IP address. Restarting the site after this change, I was able to access the site with localhost, my local IP address and the external IP address as well.

Community
  • 1
  • 1
Sarvavyapi
  • 810
  • 3
  • 23
  • 35
0

I followed this great HOWTO from Ben Scott in order to host a website on a standalone instance of IIS Express. As I'm serving externally and therefore running IISExpress.exe as administrator, you don't register a URL in the Access Control List (thanks for the link to Trevor Elliot's answer - top tip!)

Tim Tyler
  • 2,380
  • 2
  • 16
  • 13