Viewing my IIS hosted site on other machines on my network

前端 未结 11 1587
情话喂你
情话喂你 2020-12-02 05:59

At home I have a simple network setup containing 2 machines.

On one machine i have a site hosted with IIS7. Rather than the standard localhost/index.htm

相关标签:
11条回答
  • 2020-12-02 06:20

    In addition to modifying your firewall, don't forget to add port binding too!

    Open $(SolutionDir)\.vs\config\applicationHost.config and find binding definitions, should be something like this

    <sites>
        <site name="Samples.Html5.Web" id="1">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\Git\Samples.Html5.Web" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:63000:localhost" />
            </bindings>
        </site>
        ...
    </sites>
    

    Just add extra lines to reflect your machine IP and designated port

    <bindings>
        <binding protocol="http" bindingInformation="*:63000:localhost" />
        <binding protocol="http" bindingInformation="*:63000:10.0.0.201" />
    </bindings>
    

    Source: https://blog.falafel.com/expose-iis-express-site-local-network/

    0 讨论(0)
  • 2020-12-02 06:22

    Open firewall settings. Then search for something like - Allow program or feature to allow through firewall. If in the list World Wide Web services (HTTP) is unchecked, check it and restart the system.

    Our machine is all set to accept inbound requests.

    0 讨论(0)
  • 2020-12-02 06:23

    After installing antivirus I faced this issue and I noticed that my firewall automatically set as on, Now I just set firewall off and it solved my issue. Hope it will help someone :)

    0 讨论(0)
  • 2020-12-02 06:25

    Very Late Answer but I will highlight some point as I had to deal with it years ago setting up my IIS site across network

    1. Both your machines should be connected to the same network (same wireless network is fine)
    2. Access your remote machine via IP 168.192.x.x or via http://his-pc-name (do not forget the http part)
    3. This will server the default IIS page on the remote machine (same that is served through localhost). If you want to server another site, [you have to make that default] first1.

    Make sure your IIS is working fine on remote machine by checking localhost which should served the default site. Also make sure your firewall is configured to allow connection via port 80 or you can just disable firewall for the time being for testing purposes.

    0 讨论(0)
  • 2020-12-02 06:30

    127.0.0.1 always points to localhost. On your home network you should have an IP address assigned by your internet router (dsl/cablemodem/whatever). You need to bind your website to this address. You should then be able to use the machine name to get to the website, but I would recommend actually editing the hosts file of the client computer in question to point a specific name at that computer. The hosts file can be found at c:\windows\system32\drivers\etc\hosts (use notepad) and the entry would look like:

    192.168.1.1     mycomputername
    
    0 讨论(0)
提交回复
热议问题