Community Tutorials Windows Server كيفية إعداد خادم الويب IIS على Windows Server
كيفية إعداد خادم الويب IIS على Windows Server
WINDOWS SERVER

كيفية إعداد خادم الويب IIS على Windows Server

SKYLINE Knowledge Base
Photo by Windows on Unsplash

دليل عملي خطوة بخطوة لـ كيفية إعداد خادم الويب IIS على Windows Server. أوامر مختبرة في الإنتاج، متطلبات مسبقة، تحقق نهائي وروابط لمواضيع ذات صلة.

IIS هو خادم الويب من مايكروسوفت — مدمج في كل SKU من Windows Server، متكامل مع مصادقة Windows و AD، والإجابة الصحيحة لاستضافة تطبيقات .NET. هذا الدليل يثبته، ينشئ موقعًا ثابتًا، ويضيف ربط HTTPS بشهادة Let's Encrypt عبر win-acme.

المتطلبات المسبقة

  • Windows Server 2019/2022 مع PowerShell كمسؤول.
  • سجل DNS يشير إلى الخادم.

الخطوة 1: ثبّت دور IIS

Install-WindowsFeature -Name Web-Server, Web-Common-Http, Web-Static-Content, `
                              Web-Default-Doc, Web-Http-Logging, Web-Mgmt-Console `
                       -IncludeManagementTools

لتطبيقات .NET:

Install-WindowsFeature -Name Web-Asp-Net45, Web-Net-Ext45, Web-ISAPI-Ext, Web-ISAPI-Filter

الخطوة 2: تحقق

Get-Service W3SVC, WAS
Invoke-WebRequest http://localhost/ -UseBasicParsing | Select-Object StatusCode

الخطوة 3: إنشاء موقع

New-Item -Path "D:\Sites\example.sa" -ItemType Directory -Force
Set-Content -Path "D:\Sites\example.sa\index.html" `
            -Value '<h1>Hello from SKYLINE</h1>'

Import-Module WebAdministration
New-WebAppPool -Name "example.sa"
New-Website -Name "example.sa" `
            -HostHeader "example.sa" `
            -PhysicalPath "D:\Sites\example.sa" `
            -ApplicationPool "example.sa" `
            -Port 80

الخطوة 4: افتح جدار الحماية

Get-NetFirewallRule -DisplayGroup "World Wide Web Services (HTTP)" | Enable-NetFirewallRule
Get-NetFirewallRule -DisplayGroup "Secure World Wide Web Services (HTTPS)" | Enable-NetFirewallRule

الخطوة 5: TLS مع win-acme

$ver = "v2.2.9.1701"
Invoke-WebRequest "https://github.com/win-acme/win-acme/releases/download/$ver/win-acme.$ver.x64.trimmed.zip" `
                  -OutFile "$env:TEMP\wacs.zip"
Expand-Archive "$env:TEMP\wacs.zip" -DestinationPath "C:\Tools\win-acme" -Force
cd C:\Tools\win-acme
.\wacs.exe

الخطوة 6: شدّ الإعدادات

Set-WebConfigurationProperty -Filter "/system.webServer/directoryBrowse" `
                             -Name "enabled" -Value "false" -PSPath "IIS:\Sites\example.sa"

Set-WebConfigurationProperty -Filter "/system.webServer/security/requestFiltering" `
                             -Name "removeServerHeader" -Value "True" `
                             -PSPath "IIS:\Sites\example.sa"

التحقق

Invoke-WebRequest "https://example.sa/" -UseBasicParsing
Get-WebBinding | Format-Table
Get-Website | Format-Table Name, State, PhysicalPath

الخاتمة

IIS مناسب للمواقع الثابتة و تطبيقات .NET وبوابات الإنترانت. لأحمال إنتاج غير .NET، استخدمه كوكيل عكسي عبر ARR.

الخطوات التالية

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship Windows Server for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.