iis core windows

Установить роль IIS (WEB Server)

Обычный сайт

  1. ПКМ по серверу -> “Add Website …”
    1. Site Name -> имя для администрирования (название файла .conf в apache2)
    2. Physical Path -> где находится сайт
    3. Hostname -> URI сайта (test.skill39)

Удаленная настройка Windows Server CORE

  1. Установить ISS -> Mangement Servic или:
install-windowsfeature web-server Web-Mgmt-Service -IncludeManagementTools
  1. regedit -> HEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WebManagment\Server -> EnableRemoteManagment поставить 1
  2. Set-Service WMSVC -StartupType Automatic
  3. start-service WMSVC
  4. Сертификаты

Доступ только с определенных ip

install-windowsfeature Web-ip-Security -IncludeManagementTools
 
Если Gui то Web-Server (IIS) -> Web Server -> Security -> IP and Domain Restrictions
  1. IP Address and Domain Restrictions -> Edit Feature Settings
  2. Access for unspecified client -> Deny # Запрещаем клиентов по умолчанию
  3. Add Allow Entry… -> добавляем IP или range

Аутентификация

  1. Установить роль Security -> Windows Authentication и URL Authentication
  2. Зайти в настройки сайта
    1. Authentication
    2. Выключить Anonymous Authentication
    3. Включить Windows Authentication

Несколько доменных имен

Если несколько Common Name Если через ASN то не надо

  1. нужно в bind указать Require Server Name Indication (SNI)

Необычный порт

Нужно разрешит в firewall иначе не робит ну и в bindings другой порт задать

New-NetFirewallRule -Name "IIS-8080" -DisplayName "IIS Port 8080" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8080

Какой-то старый вариант

  1. Установить ISS -> Mangement Servic
  2. regedit -> HEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WebManagment\Server -> EnableRemoteManagment поставить 1
  3. Set-Service WMSVC -StartupType Automatic
  4. start-service WMSVC
    • Добавление сертификаты в доверенные certutil -addstore "My" [ПУТЬ К СЕРТИФИКАТУ]
    • Добавление личного сертификата certutil -p password -importPFX My c:\cert.pfx
    • копирование сертификатов с шары copy \\172.28.16.2\share\*
    • firewall: netsh advfirewall firewall add rule name="IIS Management" dir=in action=allow service=WMSVC