A348 Setting Up the IIS Web Server - The Basics

Modified

IIS is the Web server for XP and Windows. Web server installation and administration is relatively simple, mainly setting up directories accessible to the Internet.

http://localhost
    http://localhost/A348/guru.htm

Exercise 1 - Testing IIS

The machines in LF-105 and LF-111 already have IIS installed. Do the following to setup the Web server and test:

  1. Login with administrator privileges
  2. Create a directory using Windows Explorer on: C:\A348
  3. Start | Run | Control | Administrative Tools | Internet Information Services
  4. Expand local computer, Web Sites, and Default Web Site.
  5. Right click on Default Web Site.
  6. New | Virtual Directory
    • Alias: A348
    • Directory: C:\A348
    • Execute (including scripts) and Browse

     

  7. Depending upon your configuration of operating systems and Access versions, the following may be necessary when ASP script fail when accessing database:

    Change A348 Application Protection as a work-around associated with using Access databases and ASP:

    • Right click on A348
    • Select Properties
      • Change Application Protection to: Low(IIS Process)
      • Click OK
    • Stop and start IIS by:
      • Right click on Default Web Site
      • Stop
      • Right click on Default Web Site
      • Start

       

  8. Copy and paste the following client-side HTML to the file named HelloWorld.htm:
    <SCRIPT LANGUAGE="JavaScript"> 
        for(i=0; i<10; i++) {
             document.write("<h1>Hello World " + i + " times");
        }
    </Script>
  9. Test by entering in the browser address:
  10. http://localhost/A348/HelloWorld.htm
  11. Verify that the server machine is accessible over the Internet.
    • Find out what the local machine's IP is entering at the COMMAND prompt: ipconfig /all.
    • Using a browser, test by: http://Machine's IP Number/A348/HelloWorld.htm
    • Using a browser on another machine, try opening on your server machine by: http://Machine's IP Number/A348/HelloWorld.htm

 

Server program execution

IIS requires that the virtual directory where the server program resides have execute privileges and the Launch IIS Process Account have sufficient privileges.

  • Login with administrator privileges
  • Create a directory using Windows Explorer on: C:\A348
  • Start | Run | Control  | Administrative Tools | Internet Information Services
  • Expand local computer and Web Sites.
  • Right click on Default Web Site and open the Properties editor.
  • Click on Home Directory tab.
  • Set Local Path to C:\inetpub\wwwroot
  • Click Configuration button.
  • Click App Mappings tab then Add button.
  • Enter:
    • Executeable: C:\Perl\bin\perl.exe %s %s
    • Extension: .pl
  • Click OK to back out of menus.
  • Locate the perl.exe interpreter using Find. It is probably located as Perl\bin\perl.exe
  • Open Windows Explorer and point to the perl.exe file.
  • Tools | Folder Options | File Types
  • Look for a .pl extension in the list of files types, if not found, continue.
  • Click New and enter .pl as the File Extension.
  • Click Change | Other...
  • Locate and click on perl.exe
  • Open | OK | Close

Exercise 2 - Testing IIS Scripts

Verify that the server will execute server-side scripts from the A348 directory:

  1. Login with administrator privileges
  2. Create a directory using Windows Explorer on: C:\A348\ASP
  3. Copy and paste the following ASP script to the file named HelloWorld.asp:
    <%@ LANGUAGE = JScript %>

    <%
            for(i=0; i<10; i++) {
    %> 

                 <h1>Hello World <%= i %> times

    <%
           }
    %>
  4. Test by entering in the browser address:
  5. http://localhost/A348/ASP/HelloWorld.asp

 

Adding Secure Access to the Server

The following restricts access to virtual directories by the Integrated Windows Authentication, a secure login method. Only those users or groups explicitly listed will be able to access the directory over the Internet.

Disable Simple File Sharing

Disabling Simple File Sharing is necessary in order to enable the creation of Access Control Lists for shared disks and folders:

  1. Click Start | My Computer | Tools | Folder Options | View.
  2. Scroll to the bottom of the list of advanced settings and un-check Use Simple File Sharing (Recommended).
  3. Click OK.

Create User Accounts

There are a couple of ways to create user accounts, but let's start simply by clicking Start | Control Panel | User Accounts.

You'll see all of the existing accounts on the computer.

Click Create a new account, and enter the new user's name.

Click Next, and choose the account type. This determines (rather simplistically) which group the user will be placed in. There's generally no good reason to grant remote users Computer administrator privileges, so select Limited, and then click Create Account. The new account appears in the User Accounts window.
 

Create Passwords

By default, Windows XP will not permit a network user to access the XP machine using an account set up without a password.

In Control Panel | User Accounts, click the desired account, and then click Create a password. Enter the password, and then enter it again to confirm it. Enter a password hint if you'd like – a user who forgets the password can look at the hint at the logon screen as a memory aid. Then click Create Password to make it take effect.

Define Virtual Drive Access

  1. Locate the folder of the virtual drive defined for IIS.
  2. Right click | Sharing and Security | Security
  3. Add the names of users (or group) that should be given access to the folder. Set the permissions for each user (group).
  4. Click Advanced and uncheck the Inherit from parent .... This will restrict access to only those users (groups) explicitly listed.

Define Database Directory Access

The database directory must be accessible by IIS and the program updating the database.

  1. Locate the folder of the database.
  2. Right click | Sharing and Security | Security
  3. Add the names of users (or group) that should be given access to the database folder. Set the permissions for each user (group) to FULL.
  4. Add the name of the IIS Guest account, IUSR_machinename and set the permissions to FULL.

Authentication Method

By default IIS allows anyone to access the virtual drive as an anonymous user.

  1. Start | Run | Control | Administrative Tools | Internet Information Services
  2. Expand local computer, Web Sites, and Default Web Site.
  3. Right click on the virtual directory | Properties | Directory Security | Edit 
  4. Only Integrated Windows authentication should be checked.