Đây là một trong những phần quan trọng nhất khi triển khai Sitecore trên môi trường local, QA, UAT hoặc Production.
Một solution Sitecore thường có 3 site chạy trên IIS:
| Vai trò | Tên mặc định | Mục đích |
|---|---|---|
| CM (Content Management) | sc.dev.local |
Dành cho marketer, editor tạo content |
| CD (Content Delivery) | sc.cd.dev.local |
Dành cho visitor truy cập website |
| Identity Server | identityserver.dev.local |
Xác thực user (Sitecore Identity) |
CM và CD đều chạy code Sitecore nhưng cấu hình khác nhau.
Identity Server là một project riêng.
Windows + R → inetmgr
Site name: sc.dev.local
Physical path: thư mục cài đặt Sitecore
Ví dụ: C:\inetpub\wwwroot\sc.dev.local
Binding:
Type: http
Hostname: sc.dev.local
Port: 80
Mở Notepad (Run as Admin)
Trong thư mục Sitecore CM:
web.configKhông cần chỉnh nhiều, nhưng cần kiểm tra:
Chỉ bật debug ở local CM, không bật ở CD.
App_Config\Include\Z.Sitecore.Environment.config (tự tạo)CD không chạy Sitecore admin, không dùng Experience Editor, không dùng Indexing UI.
Trong CD thêm cấu hình:
Project identityserver cũng tạo website riêng trên IIS.
identityServerAuthority trong Sitecore.Owin.Authentication.IdentityServer.config
Sitecore 10+: .NET Framework 4.7.2
Managed pipeline: Integrated
Nên set:
Và
Application Pool → Advanced → Idle Time-out = 0
Để tránh Web App tự tắt.
Sitecore cần quyền:
Modify cho các folder:
/App_Data
/sitecore modules
/temp
/upload
/logs
Gán quyền cho user IIS_IUSRS hoặc ApplicationPoolIdentity.
CD environments thường cần rewrite để SEO-friendly URLs.
Ví dụ rewrite bỏ .aspx:
Hoặc redirect HTTP → HTTPS.
Thêm rewrite rule:
Để không bị route sai.
→ Sai syntax XML trong config
→ Thiếu module IIS (.NET Extensibility, ISAPI, ASP.NET)
→ App pool bị recycle (Idle timeout)
→ Chưa đúng host
→ Sai binding
→ Chưa publish content lên CD
→ Sai config IdentityServer.Authority
→ HTTPS chưa bật
Tạo CM site
Binding: sc.dev.local
Test vào /sitecore/login
Tạo CD site
Binding: sc.cd.dev.local
Disable admin UI
Kiểm tra website hiển thị OK
Tạo Identity Server
Binding: identityserver.dev.local
Chạy Sitecore CM → Kiểm tra redirect sang Identity Server → Login thành công.