zoukankan      html  css  js  c++  java
  • 【先定一个小目标】Asp.net Core 在IIS上的托管运行

    1.安装 .NET Core Framework

      下载.net core地址:官网地址

    2.Install IIS

    在控制面板->程序与功能-》Internet Infomation Services

    3.站点部署

      实例: https://github.com/aspnet/mvc

      在IIS管理器,新建站点->物理路径Path:为项目的根目录。

     网站绑定:

      在host文件中添加127.0.0.1 mvcsanbox.cn,刷新dns缓存:cmd->ipconfig /flushdns

      设置主机域名为:mvcsanbox.cn 端口:80

         

    4.安装 .net Core Windows Server Hosting

         下载地址: .NET Core Windows Server Hosting

    5.设置网站的web.config

    复制代码
    <?xml version="1.0"?>
    <configuration>
      <system.webServer>
        <directoryBrowse enabled="true"/>
        <handlers>
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
        </handlers>
        <!--<aspNetCore processPath="C:Program Filesdotnetdotnet.exe" arguments=".AspNetCoreSampleForNano.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false" />-->
     <aspNetCore processPath=".inDebug
    et451win7-x64MvcSandbox.exe" arguments=""   stdoutLogEnabled="true" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false" /> 
    </system.webServer>
    </configuration>
    复制代码

    参数说明:

    
    
    AttributeDescription
    processPath

    Required string attribute.

    Path to the executable that will launch a process listening for HTTP requests. Relative paths are supported. If the path begins with '.', the path is considered to be relative to the site root.

    There is no default value.

    arguments

    Optional string attribute.

    Arguments to the executable specified in processPath.

    The default value is an empty string.

    startupTimeLimit

    Optional integer attribute.

    Duration in seconds that the module will wait for the executable to start a process listening on the port. If this time limit is exceeded, the module will kill the process. The module will attempt to launch the process again when it receives a new request and will continue to attempt to restart the process on subsequent incoming requests unless the application fails to start rapidFailsPerMinute number of times in the last rolling minute.

    The default value is 120.

    shutdownTimeLimit

    Optional integer attribute.

    Duration in seconds for which the module will wait for the executable to gracefully shutdown when theapp_offline.htm file is detected.

    The default value is 10.

    rapidFailsPerMinute

    Optional integer attribute.

    Specifies the number of times the process specified in processPath is allowed to crash per minute. If this limit is exceeded, the module will stop launching the process for the remainder of the minute.

    The default value is 10.

    requestTimeout

    Optional timespan attribute.

    Specifies the duration for which the ASP.NET Core Module will wait for a response from the process listening on %ASPNETCORE_PORT%.

    The default value is "00:02:00".

    stdoutLogEnabled

    Optional Boolean attribute.

    If true, stdout and stderr for the process specified in processPath will be redirected to the file specified in stdoutLogFile.

    The default value is false.

    stdoutLogFile

    Optional string attribute.

    Specifies the relative or absolute file path for which stdout and stderr from the process specified inprocessPath will be logged. Relative paths are relative to the root of the site. Any path starting with '.' will be relative to the site root and all other paths will be treated as absolute paths. A timestamp and the file extension will automatically be added to the filename provided. Any folders provided in the path must exist in order for the module to create the log file.

    The default value is aspnetcore-stdout.

    forwardWindowsAuthToken true or false.

     

    If true, the token will be forwarded to the child process listening on %ASPNETCORE_PORT% as a header 'MS-ASPNETCORE-WINAUTHTOKEN' per request. It is the responsibility of that process to call CloseHandle on this token per request.

    The default value is false.

    disableStartUpErrorPage true or false.

     

    If true, the 502.5 - Process Failure page will be suppressed, and the 502 status code page configured in your web.config will take precedence.+

    The default value is false.

    
    

     参考地址:

    https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#common-errors

    https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#iis-configuration

    https://docs.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module

  • 相关阅读:
    为VMware虚拟机内安装的Ubuntu 16.04设置静态IP地址
    WPF入门教程系列二十三——DataGrid示例(三)
    WPF入门教程系列二十一——DataGrid示例(二)
    Google Nexus 5X刷机并root
    web调用摄像头拍照
    导出SQL SERVER 数据字典语句
    树莓派安装.Net Core3.1
    使用Open Live Writer写博客
    EFCore的外键级联删除导致的【可能会导致循环或多重级联路径】
    重新装Mysql数据的恢复办法,还原data文件夹下数据库
  • 原文地址:https://www.cnblogs.com/CrazyAnts/p/6322723.html
Copyright © 2011-2022 走看看