Welcome Guest Search | Active Topics | Log In | Register

How to: Login failed for user 'IIS APPPOOL\DefaultAppPool'. (Windows 7) Options · View
AdmOd
#1 Posted : Monday, January 12, 2009 12:07:44 AM
Rank: มือพระกาฬ

Groups: Member

Joined: 9/14/2008
Posts: 12
Location: Home

เป็นปัญหาที่ผมพบเจอใน Windows 7 เผื่อใครเจอจะได้ลองเอาไปใช้กัน

Server Error in '/' Application.

Cannot open database "<Database Name>" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.

(เดาว่า) เกิดจาก IIS ทำการติดต่อไปยัง Sql Server ผ่าน Windows Authentcation ไม่ผ่าน

จากบรรทัด "IIS APPPOOL\DefaultAppPool" เลยเดาว่าน่าจะเป็นที่ DefaultAppPool ของ Site ตัวที่ใช้


กด Advance มาดู AppPool ตรงนี้

วิธีแก้ที่ผมใช้ก็คือ ไปเปลี่ยน Identity Account ให้แก่ IIS ใหม่ โดยเข้าไปที่เมนู Advanced Settings... ของ  AppPool ที่ใช้งาน

แล้วก็ไปเปลี่ยน Identity ใหม่

เปลี่ยนจาก ApplicationPoolIdentity เป็น LocalSystem

 

ปัญหาที่ผมเจอเกิดเฉพาะเมื่อ IIS มีการติดต่อเข้าไปยัง SQL Server โดยที่ตัว Management อื่นๆ หรือการติดต่อด้วยวิธีอื่นๆยังใช้งานได้ปรกติ

ปล. ไม่รับรองความปลอดภัยของระบบ
ปล2. อ้างอิง Windows 7 Build 7000

ทดลองระบบติดตามรถเมล์ (ชมวีดีโอแนะนำในหน้า "เกี่ยวกับเรา")
http://bustracker.codetoday.net/
Andy
#2 Posted : Tuesday, April 26, 2011 9:17:17 PM
Rank: มือฝึกหัด

Groups: Member

Joined: 4/26/2011
Posts: 1
This solution is nonsense because it shows a clear lack of understanding in the security model. You are putting your customer or company at risk by setting up LocalSystem and allowing your application pool to have more file system and execution privileges than it needs (if you are doing this in a development environment for sake of troubleshooting, then disregard).

The recommended Microsoft solution is to create a separate account. However, if your solution is small, you can instead add the 'IIS APPPOOL\DefaultAppPool' user as a database user in your SQL instance, then providing the proper 'User Mappings' to the databases you need the DefaultAppPool user to access. You may not necessarily be able to search for this user, but you can still enter it in the 'Login name' field in the "Login - New" window as "IIS APPPOOL\DefaultAppPool" (without the quotes).

Follow this link as a reference and pay attention to the last post: http://social.msdn.micro...-4a71-a448-3e3eef9ee404/
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Creative Commons License
CodeToday.NET is licensed under a Creative Commons Attribution-Noncommercial 3.0 Thailand License.
Based on a work at www.CodeToday.net.