Configuring IIS

The process of configuring IIS is simple. Before you do anything, you must ensure that Python is installed on the IIS server, and the Active Scripting engine is registered, as we discuss previously in this chapter. There is nothing Python-specific that needs to be configured within IIS; all you need to do is tell IIS where to find your scripts. Do this with the following process:

  1. Start the Internet Service Manager on the machine where IIS is installed.

  2. Locate and select the default web server entry under your ASP server.

  3. Select Action New Virtual Directory. The New Virtual Directory Wizard begins.

  4. Enter PythonTest as the alias that accesses the virtual directory and select Next.

  5. You are then prompted to enter the physical path of the directory containing the content. Enter the name of the directory where your test or sample .asp files are located and select Next.

  6. You are then prompted for the permissions for the new directory. The default options are acceptable, so you can select Finish.

The ISM should then look something like Figure 21.1.

Internet Service Manager after creating the new directory
Figure 21.1. Internet Service Manager after creating the new directory

Let’s now execute the sample script. The simplest thing is to test your script by running Internet Explorer on the same machine as the server. If you enter a URL, http://localhost/PythonTest/ServerSample.asp, it executes the ServerSample.asp file from the physical ...

Get Python Programming On Win32 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.