Showing posts with label iis7. Show all posts
Showing posts with label iis7. Show all posts

Saturday, February 13, 2010

IIS7 Publish Problems with Database

So after testing your website on Visual Studio and made sure everything is working fine, especially database connections, you now published your new site on IIS7 and to your surprise connections don't work as you've set. Try these following steps..

Open IIS by going to Control Panel > Administrative Tools > Internet Information Services (IIS) Manager. On the left menu, click on Application Pools.


Click on DefaultAppPool and then Advanced Settings...


Click on the Identity selector under Process Model.



Change it to LocalSystem and click Ok.


Now try running your website again and it should have no more connection problems.


-k

Monday, January 25, 2010

Login failed for user 'NT AUTHORITY\IUSR'

If you encountered this error while running your published website or web service in IIS7:

Message: Sys.WebForms.PageRequestManagerServerErrorException: Cannot open database "[DB_NAME]" requested by the login. The login failed.

Just follow these simple steps to solve the problem.

1. Open SQL Server Management Studio.



2. On the left menu, expand Security then Logins. Check if 'NT AUTHORITY\IUSR' exists. If not then that is the cause of the problem.




3. Right-click on Logins then click New Login...



4. On the General page, click Search...



5. On the next popup window, click Advanced...



6. Then on the following window, click Find Now and find IUSR on the Search Results. Then click OK.



7. Back on the left menu, you'll now see the 'NT AUTHORITY\IUSR' user. Right click on it and click Properties.




8. On the Server Roles page, check on sysadmin.



9. Then on the User Mapping page check on the database name you need access to; and below that on the database role membership make sure to also check on db_owner then click OK.






...And that's a wrap, you shouldn't be seeing the login failed error now.



-k