Recipe12.1.Installing IIS


Recipe 12.1. Installing IIS

Problem

You want to install IIS on a Windows Server 2003 computer.

Solution

Using a graphical user interface

To manually install IIS on a computer that already has Windows Server 2003 installed, do the following:

  1. From the Start menu, select Manage Your Server.

  2. Click Add or remove a role.

  3. Click Next to detect your network connection.

  4. Select the Application Server (IIS, ASP.NET) role and click Next.

  5. If desired, select options to install FrontPage Server Extensions and enable ASP.NET and click Next.

  6. Click Next and insert your Windows Server 2003 product CD when prompted or browse to a network distribution point where the Windows Server 2003 installation files are located.

  7. Click Finish when the install is completed.

To install additional IIS components (listed under the Discussion section), do the following:

  1. From the Control Panel, open the Add or Remove Programs applet.

  2. Click Add/Remove Windows Components.

  3. Select Application Server and click Details.

  4. Select the additional components you want to install (more components can be found by selecting Internet Information Services and clicking Details).

  5. Click OK as many times as needed, insert your Windows Server 2003 product CD when prompted or browse to a network distribution point where the Windows Server 2003 installation files are located.

  6. Click Finish when the install is completed.

To perform an unattended install of IIS on a computer with no operating system:

  1. Insert the Windows Server 2003 product CD into a Windows XP or Windows Server 2003 computer.

  2. When the splash screen appears, click Perform additional tasks.

  3. Click Browse this CD.

  4. Double-click the Support folder and double-click Tools.

  5. Double-click Deploy.cab to open the compressed folder.

  6. Right-click on setupmgr.exe and select Extract.

  7. Specify a location such as Desktop to extract Setup Manager to and click Extract.

  8. Close the Deploy.cab window and click Exit to close the splash screen.

  9. Double-click on setupmgr.exe to start Setup Manager and click Next.

  10. Select Create new to create a new answer file and click Next.

  11. Select Unattended Setup to create an unattend.txt file for unattended installation and click Next.

  12. Select the edition of Windows Server 2003 you plan to install and click Next.

  13. Select Fully Automated and click Next.

  14. Continue through the wizard to create an answer file named unattend.txt.

  15. Open your answer file using Notepad.

  16. Add the following section to your answer file to install core IIS components and the WWW service:

    [Components] iis_common = ON iis_doc = ON iis_www = ON iis_inetmgr = ON

  17. You can optionally add the following section to your answer file to customize your IIS configuration:

    [InternetServer] SvcManualStart = www PathWWWRoot = C:\webstuff

  18. Save the changes and use your answer file to perform an unattended installation of Windows Server 2003 using winnt32.exe with the /unattend option.

By renaming your answer file to winnt.sif, you can perform an automated installation directly from the product CD.


Using a command-line interface

The following command performs an unattended install of IIS on a computer on which Windows Server 2003 is already installed, using an answer file that includes only the [Components] and [InternetServer] sections described in the previous section:

> sysocmgr /i:sysoc.inf /u:<PathToAnswerFile>

For example, if your answer file is named iis_install.txt, is located in the root directory of C: drive, and contains the following entries:

[Components] iis_common = ON iis_doc = ON iis_www = ON iis_inetmgr = ON     [InternetServer] SvcManualStart = www PathWWWRoot = C:\webstuff

Then you can install IIS using this command:

> sysocmgr /i:sysoc.inf /u:C:\iis_install.txt

Using VBScript

Unfortunately, there are no scripting interfaces for installing IIS. However, you can run the sysocmgr command from the previous section directly within a batch script (.bat extension) or using the WScript.Shell Run method within VBScript.

' This code simulates the same steps from the command-line solution. ' First, an answer file is created containing the parameters to install ' IIS. Then the sysocmgr command is invoked to perform the installation. strFile = "c:\iis_install.txt"     constForWriting = 2 set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile(strFile, constForWriting, True) objFile.WriteLine("[Components]") objFile.WriteLine("iis_common = ON") objFile.WriteLine("iis_doc = ON") objFile.WriteLine("iis_www = ON") objFile.WriteLine("iis_inetmgr = ON") objFile.WriteLine("") objFile.WriteLine("[InternetServer]") objFile.WriteLine("SvcManualStart = www") objFile.WriteLine("PathWWWRoot = C:\webstuff") objFile.Close     set objWshShell = WScript.CreateObject("WScript.Shell") intRC = objWshShell.Run("sysocmgr /i:%windir%\inf\sysoc.inf /u:" & _                         strFile, 0, TRUE) if intRC <> 0 then    WScript.Echo "Error returned from sysocmgr command: " & intRC else    WScript.Echo "IIS installed" end if

Discussion

Table 12-2 describes some of the IIS components that you can install by adding entries to the [Components] section of your answer file.

Table 12-2. IIS components

Entry

Description

iis_asp

Active Server Pages component

iis_common

Common files needed by other IIS components

iis_doc

IIS documentation

iis_ftp

FTP service

iis_inetmgr

Internet Services Manager snap-in for the MMC

iis_www

WWW service

fp_extensions

FrontPage Server Extensions

aspnet

ASP.NET component


For additional IIS components you can install, see the Ref.chm help file in the \Support\Tools\Deploy.cab folder on your Windows Server 2003 product CD.

Table 12-3 contains some of the entries you can include in the [InternetServer] section of your answer file.

Table 12-3. IIS unattended configuration options

Entry

Description

Values

PathWWWRoot

Location of home directory for Default Web Site

Specify absolute path to directory (enclose in quotes if path includes spaces)

PathFTPRoot

Location of home directory for Default FTP Site

Specify absolute path to directory (enclose in quotes if path includes spaces)

SvcManualStart

WWW and/or FTP services are stopped and set to Manual after installing IIS

WWW | FTP | WWW,FTP


Note that the entries in the [InternetServer] section require corresponding entries in the [Components] section. For example, if you include an entry for PathWWWRoot in the [InternetServer] section, you must include iis_common, iis_inetmgr, and iis_www in the [Components] section as well. For more information on the entries in these two sections, see the Ref.chm help file.

Don't install IIS on a domain controller unless you have no other option. Installing IIS on a domain controller can significantly increase the attack surface of the domain controller and potentially expose your Active Directory accounts database to malicious attack. For more information, see TechNet Webcast: Successfully Running IIS on a Domain ControllerLevel 200 found at http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032245355&Culture=en-US.


See Also

MS KB 323438 (HOW TO: Use Setup Manager to Create an Answer File in Windows Server 2003), MS KB 309506 (How To Perform an Unattended Installation of IIS 6.0), and MS KB 222444 (How to Add or Remove Windows Components with Sysocmgr.exe)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net