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>".
Comments