Administering IIS7 on Server Core Installations of Windows Server 2008

 

As you may have seen from TechEd 2007 announcements and recent Bill Staples’ (IIS Product Unit Manager) blog, IIS7 is now supported on Server Core installation option of Windows Server 2008. We are hoping to address customer requests by offering low footprint server solution in web space which comes with certain advantages (i.e. lower disk space requirement and memory utilization, reduced attack surface and less servicing needs). We, IIS product team, are very excited to take this forward step and offering our customers next generation web server product in Server Core.

Server Core installations on Windows Server 2008 comes with certain differences than regular Windows Server 2008 OS installations. In a nutshell, .Net framework is not available (hence no ASP.Net) and there is no windows shell so GUI administration tools are not available. As a note, availability and support of .Net framework on Server Core installation option is being discussed so there is no final answer on that as of this date yet.

The purpose of this blog is to help out for those who need to administer IIS7 on Server Core installations using command-line utilities/options. Without further delay, let’s start our Server Core How-to Q&A. First section will include IIS7 deployment and configuration on server core installations. Second section will contain general tips for Windows OS administration tasks.

Part1: IIS Deployment and Configuration Tips

Q1. How to install IIS7 on Server Core?

A. You can use pkgmgr.exe command line tool option to install IIS7 on your Server core box.

For default IIS install option, you can type following on the command-window:

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

 

For Full IIS install option, you can type following in command-line:

start /w pkgmgr /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;IIS-FTPPublishingService;IIS-FTPServer;WAS-WindowsActivationService;WAS-ProcessModel

Notes:

1.       To uninstall IIS, you can pass “/uu:” instead of “/iu:” for the commands mentioned above (Ex. Start /w pkgmgr /uu:IIS-WebServerRole….).

2.       For more information on pkgmgr.exe, please click on the link.

 

Q2. Which features of IIS7 are not available on Server Core installation option of Windows Server 2008?

A. Following features are not available as installation options on Server Core:

·         IIS-ASPNET

·         IIS-NetFxExtensibility

·         IIS-ManagementConsole

·         IIS-ManagementService

·         IIS-LegacySnapIn

·         IIS-FTPManagement

·         WAS-NetFxEnvironment

·         WAS-ConfigurationAPI

 

Q3. How to install Classic ASP on Server Core?

A. Type following pkgmgr.exe command to install Classic ASP along with features for Static Content Web Server on Server Core machine.

Start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASP;IIS-ISAPIExtensions;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Security;IIS-RequestFiltering;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;WAS-WindowsActivationService;WAS-ProcessModel 
Q4. How to install PHP on Server Core?

A. Steps to install and configure PHP on Server Core is as follows:

1.                         Unzip the content of PHP download from http://www.php.net/downloads.php#v5 to a file share. As a note, since Server Core does not have browser support, it is recommended to download the PHP content on a file share where browser access is available.

2.                         Create a %SystemDrive%\PHP directory on Server Core machine and xcopy the content of the folder from the file share above onto %SystemDrive%\PHP folder on local machine.

3.                         Copy the %SystemDrive%\PHP\PHP.INI-Recommended file as %SystemDrive%\PHP\PHP.INI.

 

Q5. How to install and configure Fast-CGI support on the IIS Server?

A.  After completing the steps on installing PHP on Q4, please follow the steps below to install Fast-CGI and configure it.

Step 1. Please use following command-line to install IIS features for FastCGI along with features for Static Content Web Server:

Start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-CGI;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Security;IIS-RequestFiltering;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;WAS-WindowsActivationService;WAS-ProcessModel

Note: Alternatively, you can choose to install Full IIS option indicated in Q1. Default IIS install option does not contain FastCGI installation.

Step 2. Create the PHP/FastCGI handler mapping from command line by typing following two appcmd.exe commands:

> AppCmd set config /section:system.webServer/fastCGI /+[fullPath='d:\php\php-cgi.exe']

> AppCmd set config /section:system.webServer/handlers /+[name='PHP-FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='d:\php\php-cgi.exe',resourceType='Either']

Notes:

1.       AppCmd.exe is a new command-line administration tool that ships with IIS7. AppCmd.exe can be found at %WinDir%\System32\InetSrv directory. For more information on AppCmd command-line tool, please click on the link.

2.       Depends on PHP installation location described in Q3, paths to executables on the hard disk may require updates. All appcmd example commands above assume that PHP installation is in D:\PHP folder. 

 

Q6.  How to detect which IIS7 features are installed on Server Core?

A. Please open registry editor by typing regedit.exe on command window and then navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\InetSTP\Components container. All installed IIS7 features will have an entry with DWORD value of 0x00000001. 

Part 2: Server Core Administration Tips:

This section includes a few command line utilities and commands to perform common tasks/actions on command-line.

Q1. How to start a command window on Server Core installation?

A. Click Ctrl+Alt+Del and then choose “Start Task Manager”. On Task Manager window, click File and choose “New Task (Run…)” option on the menu. Type cmd.exe on Create New Task window and hit ok.

Q2. How to enable Remote Desktop for Server Core installed box?

A. If you plan to access from another Windows Server 2008 or Vista machine, please execute this from command-line:

Cscript %windir%\system32\SCRegEdit.wsf /ar 0

Otherwise if you plan to access from a machine which has earlier version of Windows OS (i.e. Windows XP), please execute following:

Cscript %windir%\system32\SCRegEdit.wsf /ar 0               

Cscript %windir%\system32\SCRegEdit.wsf /cs 0

Q3. How to change administrator password?

A. Type “Net user administrator *” on command-window. When asked, please type new password for administrator user.

Q4. How to add a user to local administrators group?

A. Net localgroup Administrators /add <domain>\<username>

 

Q5. How to change machine name?

A.  If machine is in a workgroup then please type following in command window:

                Netdom renamecomputer <currentcomputername> /NewName:<new computer name>

Otherwise, if machine is a member of a domain then please type following in command window:

                Netdom renamecomputer <currentcomputername> /NewName:<new computer name> /userd:<domain>\<username> /password:*

Q6. How to join a machine to domain?

A. Type following on command-window:

                Netdom join %computername% /domain:<domain> /userd:<domain>\<username> /password:*

Q7. How to remove a machine from domain?

A. Netdom remove

Q8. How to disable firewall?

A. netsh firewall set opmode disable

Q9. How to restart a Server Core Machine?

A. shutdown /r

Q10. How to install updates?

A. wusa <update_package_name>.msu /quiet

Q11. How to access event logs?

A. Enumerate event log names by typing "Wevutil el". In order to see/query events in particular log, please type "Wevtutil qe <event log name>".

 

 

 

21 Comments

  • Cool stuff - in question 10, could it quite possibly be "quiet" instead?

  • Thanks. Good catch. I corrected the typo.

  • How to ensure that ASP .NET is installed properly although registy shows ASP under HKEY_LOCAL_MACHINE\Software\Microsoft\InetSTP\Components?

  • Hi Sangram,

    ASP.Net is not supported on ServerCore as of this date. The ASP registry entry is for classic ASP support on Server Core installations. Hope this helps.

  • I cannot believe it, no plans for .NET framework: AWESOME! YES!

    If you guys could only get the footprint down to under 32MB on core install that would be even more cool.

    Please, please, please make this OS the fastest and thinnest by default.

    No WMI either please.

    No junk that isn't required, so we have an answer to Linux.

    No RPC or AD or shell junk that blocks the entire box. Or a CD-ROM or floppy disk hang Windows is famous for. No Name Resolution by default would be GREAT!

    We only need the fastest TCP/IP and HTTP stack on the planet (and lowest latency otherwise what's it the point).

    Cheers.

  • That's great :-/ So ASP.NET (which is primary Microsoft developer platform for web) is not available on Server Core and PHP is...

  • really cool stuff!

  • This info is very good. Thanks for your works :)

  • This is not easy. I try few times but it isn't working:((

  • Win serv PHP and mysql?:)

  • Hi.

    I installed exchange 2007 on windows 2008. First time, running OWA on Default Wab Site. However next time stop OWA and Virtual Directory (Owa,Exchage,Exadmin,Exchweb,Public) this virtual directory when click, I see error.

    Errors fallowing;

    "could not find a part of the path '\\.\BackofficeStorage"

    "could not find a part of the path '\\.\BackofficeStorage\domainname\MBX"

    "could not find a part of the path '\\.\BackofficeStorage\domainname\Public"

    I remove IIS and install IIS, but i see same error.

    I remove Exchange 2007 and install Exchange 2007, but i see same error.

    Help me please. Thanks

  • thx great article!!!

  • good work! tahanks for help.

  • Nice Post! I also wrote an article on IIS 7 a few months back.

    Installing IIS 7.0 on Server 2008 from command line
    http://blogs.iis.net/metegokt/archive/2007/06/26/administering-iis7-on-server-core-installations-of-windows-server-2008.aspx

  • I think you meant ""Wevtutil" instead of "Wevutil" on Q11.

  • Here is a missing portion from the IIS7+Server Core combo

    How to configure SSL on IIS7 under Windows 2008 Server Core
    http://www.awesomeideas.net/post/2008/05/18/How-to-configure-SSL-on-IIS7-under-Windows-2008-Server-Core.aspx

  • Hi,

    I have created an MSI package to do Unattended Installation for IIS.
    Nature of my Package :
    It place the XML file in the c drive and call the package manager for installation.

    When you uninstall the MSI package it will call the Package manager for IIS Uninstallation.

    Now my question is that : After I installed My MSI Package, I want to lockdown the option to manually remove the IIS from Windows Server Manager Role, how do I do that...?

    Thanks
    Surendar

  • HINT: user far manager to perform basic file operations. it hepls you A LOT and it's console based.
    http://www.farmanager.com/download.php

  • Hello,

    I found this information http://www.iis.net/getstarted/ASP.NETandPHPSupport
    Where ASP.NET is supportable.

    Can you please clarify this information:
    ... IIS7 integrates the ASP.NET runtime within the core Web server, providing a unified request processing pipeline that is exposed to both native and managed modules...

    Thanks.

  • hi i am installing my web application on windows server 2008
    with iis7
    now i am running it successfully with my windows "administrator" user and with other windows user "sqluser"
    my web.config is installed in "c:\inetpub\wwwroot\mysite\"
    now i have a windows application(myExe) that uses my web.config
    i can read my web.config through my windows application (myExe) with below code -

    -------
    imports system.web.configuration
    ...
    ...
    Dim webStr As Configuration.Configuration=WebConfigurationManager.OpenWebConfiguration("/mysite")
    dim webConnStr as string=webStr.ConnectionStrings.ConnectionStrings("Connstr").connectionString
    --------------------

    this will fetch my connection string from administrator a/c but with other windows a/c, this application is not able to fetch connection string

    while other a/c able to run same web application (mySite)

    can anyone tell me what is the problem and how to rectify it on windows server 2008 or iis manager or something

  • Very good compilation of all useful tasks.

Comments have been disabled for this content.