Before we start the installation of IIS there are a few things we need to do. One of them is to secure the operating system (OS). That means we need a firewall, antivirus software and update the OS. The system I am using when writing this article is already behind a hardware firewall, but for additional security (and to show the reader) the built-in firewall is enabled as well. A very important notice is that you should not open up any ports in the firewall, not even port 80, before the installation. Although IIS 6.0 is locked down by default, and no known security issues impacts IIS during installation (when writing this) it is wise to first properly configure IIS and then publish it.
Follow these steps to enable the firewall:
- Click "Start", "Control Panel" and then "Windows Firewall"
- If you are asked to start the "Windows Firewall/Internet Connection Sharing" service, do so.
- When you see the Windows Firewall dialog, select "On".
- Click on the Exceptions tab and make sure that no ports are open (at least no ports related to IIS, you may have other ports for other applications opened during the installation of IIS)
- Also check the Advanced tab, and the Settings button for "Network Connection Settings"
- Click Ok
Once the firewall is enabled, it is time to visit Windows Update and get the latest updates.
- Click "Start" and then "Windows Update"
- Follow the instructions
The last step in this section is to install and/or update an antivirus program. Do note that the antivirus software should be designed to be used on servers. Antivirus software designed for home users will not install on a server edition of Windows, or may not work well with IIS.
The installation
IIS can be installed in two ways, either by using the "Manage Your Server" wizard, or by using "Add/Remove Windows Components". In this article, I will show you how to use "Manage Your Server".
- Start "Manage Your Server" by clicking on "Start" -> "Administrative Tools" -> "Manage Your Server"
- When you see the "Manage Your Server" screen, click on "Add or remove a role".
You will now see a screen telling you what steps you should have completed before continuing.
If you are asked to unblock the "Configure Your Server Wizard" program, you can select to keep blocking it; it will not impact the installation of IIS.
- On the "Server Role" screen select "Application Server" and click "Next".
The next step is to enable ASP.NET. You can also enable FrontPage Server Extensions if you want. This is useful if you will use for example Visual Studio to publish your website. This article does however not cover FrontPage Server Extensions.
- Select "Enable ASP.NET" and click "Next"
A summary will be presented to you, and the installation will start after you click Next.
You may be asked for the Windows Server 2003 CD during the installation, so keep it nearby.
When the installation has finished, click the "Finish" button.
Post-installation
Once IIS is installed, you will probably want to check if it is running and working as expected. To do so, we can simply browse to http://localhost/ on the machine itself. Localhost refers to the local machine, and can only be used on the machine itself. It cannot be used to access other machines.
If you do this using Internet Explorer you will see an "Under Construction" page. This indicates that IIS is installed and can process requests. It also means that we have not yet created a default page for our website.
A "Default Page" is a page that will be served when no file name is specified. To create a default page for the root of your website, you first need to create the page (using for example notepad.exe) and save it to the website's root folder. By default, the website's root folder is C:\Inetpub\wwwroot. A website's root folder can be modified at any time using IIS Manager.
IIS Manager is used to configure IIS. To start IIS Manager follow these steps:
- Click "Start" -> "Administrative Tools" -> "Internet Information Services (IIS) Manager"
So what we need to do is create a file Default.htm, and place it in the C:\Inetpub\wwwroot folder. Or...we do not need to do this. We can, as I said earlier, change the home directory to something else, and we can also give the default document any other name as long as we add it to the list of "Default Documents". But to keep this simple, the default location and name is used.
Simple does not always equal secure. It is recommended to move the website's root to a non-system drive, for example D:. This adds an extra layer of security, but using the C: drive is in no way insecure.
You can use your favorite text editor to create a HTML file and save it to C:\inetpub\wwwroot (make sure you don't get the extension .htm.txt if you use a text editor), or you can use the Default.htm file in the ZIP-package you can download at the bottom of this article. Once this file is placed in the home directory, and you browse to http://localhost/ you will see the content of the default document.
So now we have a default document. The goal of this article was however to get the server to serve static pages, ASP and ASP.NET. Static pages and ASP.NET should work at this moment (IIS serves static pages by default, and ASP.NET was enabled during the installation). But just to make sure that it works, browse to http://localhost/default.htm.
To test ASP.NET, either create a simple "Hello World" ASP.NET file, or use the one supplied in the ZIP-package available for this article. Remember to keep the file simple when testing if ASP.NET is working on the server. If you used the file from the ZIP-package, placed it in C:\inetpub\wwwroot and then browsed to it you should see a "Hello World" message, which indicates that ASP.NET is working on the server.
Read this article for more info: http://www.gafvert.info/iis/article/install_iis_6.htm