如何在本地IIS 7.0中托管Asp站点? [英] How Can I Host Asp Site In Local IIS 7.0?

查看:60
本文介绍了如何在本地IIS 7.0中托管Asp站点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个asp站点。我想在我的本地IIS中托管该站点。下面是我要遵循的步骤:

1.发布站点

2.打开IIS 7.0。右键单击新 - >添加网站

3.选择我发布的路径。然后确定。



但是当我尝试浏览时会出现以下错误。



 HTTP错误500.19  - 内部服务器错误< br /> 
无法访问请求的页面,因为页面的相关配置数据是无效。





配置来源
-1:
0:





读取Web服务器或Web应用程序的配置文件时出现此错误。在某些情况下,事件日志可能包含有关导致此错误的原因的更多信息。



这是我第一次在IIS托管。可能是什么原因 ?如何解决这个问题?



以下是我的webconfig文件

<! -

更多信息关于如何配置ASP.NET应用程序,请访问

http://go.microsoft.com/fwlink/?LinkId=169433

- >



< configuration> 
< connectionstrings>
< add name = ApplicationServices >
connectionString = data source =。\SQLEXPRESS; Integrated Security = SSPI; AttachDBFilename = | DataDirectory | \ aspnetdb.mdf; User Instance = true
providerName = System.Data.SqlClient />
< / add > < / connectionstrings >

< system.web>
< compilation debug = true targetframework = 4.0 />


< authentication mode = Forms >
< forms loginUrl = 〜/ Account / Login.aspx timeout = 2880 />
< / 身份验证 >

< membership>
< providers>
< clear />
< add name = AspNetSqlMembershipProvider type = System.Web.Security.SqlMembershipProvider connectionstringname = ApplicationServices >
enablePasswordRetrieval = < span class =code-string> false enablePasswordReset = true requiresQuestionAndAnswer = false requiresUniqueEmail = false
maxInvalidPasswordAttempts = 5 minRequiredPasswordLength = 6 mi nRequiredNonalphanumericCharacters = 0 passwordAttemptWindow = 10
applicationName = / />
< / add > < / 提供商 >
< / 会员 >

< profile>
< providers>
< clear />
< add name = AspNetSqlProfileProvider type = System.Web.Profile.SqlProfileProvider connectionstringname = ApplicationServices applicationname = / />
< / 提供商 >
< / 个人资料 >

< rolemanager enabled = false >
< providers>
< clear />
< add name = AspNetSqlRoleProvider type = System.Web.Security.SqlRoleProvider connectionstringname = ApplicationServices applicationname = / />
< add name = AspNetWindowsTokenRoleProvider type = System.Web.Security.WindowsTokenRoleProvider applicationname = / />
< / 提供商 >
< / rolemanager >

< / system.web >

< system.webserver>
< modules runallmanagedmodulesforallrequests = true />
< / system.webserver >
< / 配置 >





我这里没有做任何改动。

解决方案

您可以将您的网站作为应用程序添加到默认网站。


授予默认用户权限,并应将应用程序池标识设置为默认用户,然后将其


1。打开控制面板

2.点击程序链接(不卸载程序)

3.点击打开/关闭Windows功能链接

4.在弹出窗口中找到Internet信息服务IIS并展开其节点

5.展开万维网服务节点

6.展开应用程序开发功能节点

7.选中ASP.NET复选框

8.然后单击确定按钮

现在你将在IIS管理器上看到Asp.net帐户,默认情况下您会看到IIS帐户现在您应该将asp.net网站从我的文档移动到IIS有权访问它的另一个地方(到您计算机上的任何分区)现在从IIS管理器浏览您的网站,它应该可以工作。


I have created one asp site.I want to host the site in my local IIS.Below are the steps i am following:
1. Publish the site
2. Open IIS 7.0.Right click new -> add web site
3. Selecting my published path.Then ok.

But when i try to browse am getting below error.

HTTP Error 500.19 - Internal Server Error<br />
The requested page cannot be accessed because the related configuration data for the page is invalid.



Config Source
   -1:
    0:



This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.

This is the first time am hosting in IIS. What could be the reason ? How to fix this?

Below is my webconfig file
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

<configuration>
  <connectionstrings>
    <add name="ApplicationServices">
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </add></connectionstrings>

  <system.web>
    <compilation debug="true" targetframework="4.0" />


    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication>

    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionstringname="ApplicationServices">
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </add></providers>
    </membership>

    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="ApplicationServices" applicationname="/" />
      </providers>
    </profile>

    <rolemanager enabled="false">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionstringname="ApplicationServices" applicationname="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationname="/" />
      </providers>
    </rolemanager>

  </system.web>

  <system.webserver>
     <modules runallmanagedmodulesforallrequests="true" />
  </system.webserver>
</configuration>



I didn't do any changes here.

解决方案

You can add your website in Default Web Site as a application.


Make it permissions to default user and should set application pool identity to default user then its


1. Open control panel
2. Click on" program" link (not uninstall programs)
3. Click" turn windows features on/off" link
4. locate" Internet Information services IIS" in the pop up window and expand its node
5. Expand the" World Wide Web Service" node
6. Expand "Application Development Features" node
7. check the check box of"ASP.NET"
8. Then click ok button
Now you will see the Asp.net account on the IIS manager and by default you see IIS account Now you should move you asp.net website from "my document" to another place the IIS have permission to access it (to any partition on your computer) Now browse your website from IIS manager and it should work.


这篇关于如何在本地IIS 7.0中托管Asp站点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆