Install and Configure IIS 7 on Server Core

by IIS Team


Server Core, the minimal server installation option for Windows Server® 2008, is available in Standard, Enterprise, and Datacenter editions. Server Core supports a subset of the server roles available in full installations of the operating system, including the Internet Information Services 7 and above (IIS 7 and above) Web server. In a Server Core installation, only the services, roles, and features required for an installed role are installed.

Running IIS on Server Core provides a modular, customizable Web server on a thin server operating system. This makes it ideal for appliance-like environments, Web farm front-end servers and Web sites, or applications that require minimal maintenance.

With the addition of the Microsoft® .NET Framework to Server Core in Windows Server® 2008 R2, the Server Core installation option becomes even more appealing for those who want to use a very small footprint server for hosting their applications. Availability of the .NET Framework provides:

  • Microsoft® ASP.NET support.
    With Windows Server 2008 R2, Server Core can be used to host ASP.NET applications.
  • IIS Remote Management.
    Server Core does not provide any user interface other than the command-line interface. With the Windows Server 2008 R2 Server Core option, it is possible use IIS Manager for Remote Administration to connect to IIS and perform all management tasks from within the familiar user interface (UI) of IIS Manager.
  • Windows PowerShell™.
    The Windows Server 2008 R2 Server Core option includes the IIS Windows PowerShell snap-in (also available with other installation options of Windows Server 2008 R2).

Install Server Core

To install IIS on an installed and configured Server Core installation of Windows Server 2008, you must have an administrator user account and password for the server running the Server Core installation.

  1. Server Core is set up like a typical Windows Server 2008 server, except the "Server Core Installation" option is selected. The Server Core then forces a change in the administrator password.

    Figure 1: Select Server Core option
  2. Next, verify the NIC and IPConfig (not necessary if there is a Dynamic Host Configuration Protocol [DHCP] server running on the network). To fix an IP address, type the following:

    netsh interface ipv4 set address name="Local Area Connection" source=static address=<IPADDRESS> mask=<> gateway=<GatewayIP>
  3. To add a Domain Name System (DNS) server entry, type:

    netsh interface ipv4 add dnsserver name="Local Area Connection" address=<IPAddress of DNS>
  4. To find the computer name, type:

  5. To change the computer name type:

    netdom renamecomputer <Current Computer name> /NewName:<NewComputerName>
  6. Reboot with the command:

    shutdown /r /t 0
  7. To join the domain, type:

    netdom join <ComputerName> /domain:<DomainName> /Userd:<UserName> /passwordd: *
  8. Reboot with the command:

    shutdown /r /t 0
  9. To prevent a later setup error in MySQL, open an exception for MySQL:

    netsh firewall add portopening tcp 3306 "MySQL"
  10. Reboot with the command:

    shutdown /r /t 0
  11. Next, activate Server Core.

    • Use the following command if connected to the Internet:

      slmgr.vbs –ato
    • If not connected to the Internet, use phone activation.
      Type one of the following:

      slmgr.vbs –dti

    (This displays the installation identification to be given to Microsoft.)


    (This activates the server using the confirmation ID given by Microsoft.)

For more information on the initial setup tasks such as managing the Windows® Firewall and configuring for automatic updates, see Making Sense of Server Core. Also see the Server Core Installation Option Getting Started Guide.

After the Server Core installation is complete and the server is configured, you can install one or more server roles. The Server Core installation of Windows Server 2008 supports the following server roles:

  • Active Directory® Domain Services
  • Active Directory Lightweight Domain Services
  • DHCP Server
  • DNS Server
  • File Services
  • Media Services
  • Print Services
  • Hyper-V™
  • Web Services (IIS) (Limited)
  • Web Server (IIS)

Install IIS

See Install IIS 7.5 on Windows Server 2008 R2 using a Server Core installation for detailed instructions. Note that the full IIS installation, which installs all available feature packages for Server Core. If there are feature packages you do not need, you should edit the script to install only the packages you require. The default IIS installation installs a minimal set of available feature packages.

If you want to install IIS components that rely on the .NET Framework, you must first install the .NET Framework. The components that rely on the .NET Framework will not be installed if the .NET Framework is not already installed.

To use a script to install the .NET Framework and the full IIS 7.5 installation on Server Core, type the following command into a script:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell;NetFx2-ServerCore;NetFx2-ServerCore-WOW64

To use a script for the full IIS 7.5 installation on Server Core, type the following command into a script:

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;WAS-WindowsActivationService;WAS-ProcessModel;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-ASPNET;IIS-NetFxExtensibility;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-ManagementService;MicrosoftWindowsPowerShell

To use a script for the default installation on Server Core, type the following command into a script:

start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI</samp>

See IIS 7.0 on Server Core and Installing IIS 7.0 on Server Core for more information about installing IIS 7.0.

Install Roles and Services

  1. Use the command oclist to list the available and installed roles and services on the server. The oclist command also renders component dependencies.

    Figure 2: Output of oclist command

    In the figure above, the oclist output shows that IIS-FTPExtensibility is dependent on IIS-FTPSvc. To install IIS-FTPExtensibility, it is first necessary to install IIS-FTPSvc.

  2. Use the ocsetup command to install and uninstall individual roles and services.
  3. Next,run oclist | more to verify which IIS components have been installed.

Install the .NET Framework

If you plan to use ASP.NET or IIS Remote Management then it is necessary to install .NET Framework first. To install it use the following commands:

start /w ocsetup NetFx2-ServerCore   
start /w ocsetup NetFx2-ServerCore-WOW64

Install ASP.NET

  1. Install ASP.NET by running the following commands (in order):

    start /w ocsetup WAS-NetFxEnvironment
    start /w ocsetup IIS-ISAPIExtensions
    start /w ocsetup IIS-ISAPIFilter
    start /w ocsetup IIS-NetFxExtensibility
    start /w ocsetup IIS-ASPNET

Install Windows PowerShell and IIS Snap-In

  1. Install Windows PowerShell by running the following command:

    start /w ocsetup MicrosoftWindowsPowerShell
  2. Next, start Windows PowerShell with the following command:


    You should see a PowerShell prompt.

  3. In order to enable the IIS snap-in, you must change the script execution policy by running this command:

    Set-ExecutionPolicy RemoteSigned
  4. Restart PowerShell for the policy changes to take effect. After restarting PowerShell, import the IIS snap-in:

    import-module WebAdministration
  5. You can obtain the list of available IIS cmdlets by typing:

    get-command –pssnapin WebAdministration

Refer to Managing IIS with IIS 7.0 PowerShell Snap-in and Managing IIS with the IIS 7.0 PowerShell Snap-in for more information.

For information about Windows PowerShell on Server Core, see Dmitry's PowerBlog: PowerShell and Beyond.

Enable IIS Remote Management

Because Windows Server 2008 R2 Server Core does not have a graphical user interface (GUI), the command prompt must be used for administrative tasks. It may be more convenient to manage Server Core from another computer using IIS remote management.

The IIS Manager for Remote Administration:

  • Remotely manages IIS from Windows® 7, Windows Vista®, Windows® XP, and Windows Server® 2003.
  • Connects directly to a Web server, Web site, or Web application.
  • Installs even when IIS is not installed on the local computer.
  • Allows multiple simultaneous connections.
  • Supports delegated administration to Web sites and Web applications, so owners can connect to and manage their own site directly.
  • Is a familiar and easy-to-use administration tool.
  • Supports HTTP over Secure Sockets Layer (SSL) for more secure management.
  • Automatically downloads features to the local IIS Manager for Remote Administration console to match features newly installed on the remote Web server.

For more information, see IIS Manager for Remote Administration and Remote Administration for IIS Manager.

  1. By default, Remote Desktop is not enabled on the Server Core. Install the IIS remote management service by using the following command:

    start /w ocsetup IIS-ManagementService
  2. Enable remote management with the following command:

    reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server ^
    /v EnableRemoteManagement /t REG_DWORD /d 1
  3. Start the management service by typing:

    net start wmsvc
  4. Connect to the IIS on the Server Core from a remote machine by using IIS Manager for Remote Administration.

To uninstall the Web Server (IIS) role, use the following command:

start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel