How To Set Up IIS Webserver

There is no webserver without a database.

  1. For MSSQL disable Auto Close. Go to Database Properties > Options > Automatic. What happens is the db won´t go to sleep. This setting should be default for MSSQL 2017.

alt

  1. IIS should be able to connect to a db. You might use NT AUTHORITY\NETWORK SERVICE or NT AUTHORITY\SYSTEM but these accounts are too powerful and you shouldn´t use them. Instead use IIS APPPool identity. Open Microsoft SQL Management Studio > Object Explorer > Security > Logins. Every db has its own Security folder but its missing Logins folder so stay at the highest level.

alt

Select New Login... from context menu. Insert login name ie IIS APPPOOL\MyAppPoolName. Do not use Search button! It won´t work as AppPool identity is virtual. MSSQL cannot find it. Select User Mapping and then click ok.

alt

Where does AppPool identity comes from? When you create an IIS website it automatically creates an AppPool.