码迷,mamicode.com
首页 > 其他好文 > 详细

Publishing to IIS 发布到IIS

时间:2016-01-11 13:52:30      阅读:380      评论:0      收藏:0      [点我收藏+]

标签:

原文:https://docs.asp.net/en/latest/publishing/iis.html

发布到IIS

Publishing to IIS

By Rick Anderson and Luke Latham

Install the HTTP Platform Handler

If you need to enable IIS, see IIS server configuration.

Create Data Protection Registry Hive

To persist Data Protection keys you must create registry hives for each application pool to store the keys. You should use the Provisioning PowerShell script for each application pool you will be hosting ASP.NET 5 applications under.

For web farm scenarios developers can configure their applications to use a UNC path to store the data protection key ring. By default this does not encrypt the key ring. You can deploy an x509 certificate to each machine and use that to encrypt the keyring. See the configuration APIs for more details.

Publish from Visual Studio

  1. Create an ASP.NET 5 app. In this sample, I’ll create an MVC 6 app using the Web Site template under ASP.NET 5 Preview Templates.
  2. In Solution Explorer, right-click the project and select Publish.
技术分享
  1. In the Publish Web dialog, on the Profile tab, select File System.
技术分享
  1. Enter a profile name. Click Next.
  2. On the Connection tab, you can change the publishing target path from the default..\..\artifacts\bin\WebApp9\Release\Publish folder. Click Next.
  3. On the Settings tab, you can select the configuration, target DNX version, and publish options. Click Next.

The Preview tab shows you the publish path (by default, the same directory as the ”.sln” solution file).

Deploy to IIS server

  1. Navigate to the publish folder (..\..\artifacts\bin\WebApp9\Release\Publish folder in this sample).
  2. Copy the approot and wwwroot directories to the target IIS server. Note: MSDeploy is the recommended mechanism for deployment, but you can use Xcopy, Robocopy or another approach. For information on using Web Deploy see Publishing to IIS with Web Deploy using Visual Studio 2015.
  3. In IIS Manager, create a new web site and set the physical path to wwwroot. You can click onBrowse *.80(http) to see your deployed app in the browser. Note: The HTTP Platform Handler currently requires this work-around to support apps. If you get an HTTP error, see IIS server configuration.
技术分享

IIS server configuration

  1. Enable the Web Server (IIS) server role. In client operating systems (Windows 7 through Windows 10) select Control Panel > Programs > Programs and Features > Turn Windows features on or off, and then select Internet Information Services.
技术分享
  1. On the Role Services step, remove any items you don’t need. The defaults are shown below.
技术分享
  1. Unlock the configuration section.

    • Launch IIS Manager and select the server in the Connections pane on the left (see image below).
    • Double-click Configuration Editor.
    • In the Section drop-down, select system.webServer/handlers, and then click Unlock Section.
技术分享技术分享
  • Set the application pool to No Managed Code. ASP.NET 5 runs in a separate process and manages the runtime.
技术分享

Supported operating systems

The following operations systems are supported:

  • Windows 7 and newer
  • Windows 2008 R2 and newer

Common errors

The following is not a complete list of errors. Should you encounter an error not listed here, please leave a detailed error message in the DISQUS section below along with the reason for the error and how you fixed it.

  • HTTP 500.19 : ** This configuration section cannot be used at this path.**

  • HTTP 500.19 : The requested page cannot be accessed because the related configuration data for the page is invalid.

  • The IIS 7.0 CoreWebEngine and W3SVC features must be installed to use the Microsoft HTTP Platform Handler 1.x.

  • HTTP 502.3 Bad Gateway

  • HTTP 500.21 Internal Server Error.

Publishing to IIS 发布到IIS

标签:

原文地址:http://www.cnblogs.com/zjneter/p/5120700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!