IIS hosting
This article outlines the process of deploying an identity server on IIS, offering a clear roadmap from publishing your application to troubleshooting common issues. The guide is divided into several chapters for easy navigation.
Deploying an identity server on IIS can streamline your authentication process for web applications. This guide provides detailed steps for deploying the server, ensuring your environment is correctly configured and any issues are promptly addressed. For further technical details, visiting official documentation such as MSDN is recommended.
Publishing the Identity Server
Begin by publishing your identity server. Open a command prompt and execute the following command:
dotnet publish
Make sure to note the output path where the files are published, as this will be needed later when setting up your IIS site.
Configuring the web.config file
If the published output does not include a web.config
file, you need to create one.
This configuration file is essential for directing IIS on how to handle the application. A sample web.config
file should look similar to the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="dotnet" arguments=".\IdserverIIS.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
</system.webServer>
</configuration>
This configuration tells IIS to use the ASP.NET Core module to process incoming requests and correctly locate your application assembly.
Installing the .NET CORE Hosting bundle
Ensure that the .NET Core Hosting Bundle is installed on your server. This bundle is critical for hosting ASP.NET Core applications on IIS. If it is not already installed, download and install it from the provided link.
Creating the IIS Site
With the application published and the necessary files in place, proceed to configure IIS:
- Open the IIS Manager
- Create a new website, ensuring that the physical path points to the output directory obtained during the publishing step.
This setup prepares your identity server for incoming requests.