How To Set Up IIS Webserver
There is no webserver without a database.
- For MSSQL disable
Auto Close
. Go to DatabaseProperties > Options > Automatic
. What happens is the db won´t go to sleep. This setting should be default for MSSQL 2017.
- IIS should be able to connect to a db. You might use
NT AUTHORITY\NETWORK SERVICE
orNT AUTHORITY\SYSTEM
but these accounts are too powerful and you shouldn´t use them. Instead useIIS APPPool
identity. OpenMicrosoft SQL Management Studio > Object Explorer > Security > Logins
. Every db has its ownSecurity
folder but its missingLogins
folder so stay at the highest level.
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.
Where does AppPool identity comes from? When you create an IIS website it automatically creates an AppPool.