ITKeyword,专注技术干货聚合推荐

注册 | 登录

解决iis 7.5 - Unable to access an asp.net website in the local network

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址https://www.aliyun.com/1111/home

推荐:解决错误:ASP.NET Error: Failed to access IIS metabase

解决错误:ASP.NET Error: Failed to access IIS metabase 今天重新装了系统,然后重新安装了vs2005,突然记起忘记安装iis了。并且出现了如下错误 //以下是错误信

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>
asp.net iis-7.5
|
  this question
edited Oct 2 '14 at 21:53 asked Oct 2 '14 at 15:55 Sarvavyapi 392 1 12 23

 | 

2 Answers
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

推荐:ASP.NET的IIS配置

1.5.2 在IIS上配置ASP.NET 在服务器上部署ASP.NET网站时,需要.NET的运行环境.NET Framework。.NET Framework类似于Java的JDK,包含有.NET程序运行环境和命令行

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


|
  this answer
answered Oct 2 '14 at 16:17 user2148906 21 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 2 '14 at 21:45      I think you are using IIS Express not IIS conventional please refer stackoverflow.com/questions/3313616/… for express –  user2148906 Oct 3 '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 3 '14 at 17:01

 |  解决方法

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.


|
  this answer
answered Oct 3 '14 at 17:27 Sarvavyapi 392 1 12 23

 | 

推荐:ASP.NET Error: Failed to access IIS metabase

//以下是错误信息------------------------------- ASP.NET Error: Failed to access IIS metabase This error showed up prior


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。