How to configure the Python CGI Environment in different operating systems

Source: Internet
Author: User

We will introduce how to configure the Python CGI Environment in different operating systems. I believe most developers are eager to master this application technology. Next, let's take a look at the specific application methods.

  • Detailed description of the correct Python case
  • How to automatically download Python files
  • Tips for reading input values from Python
  • In-depth discussion on the correct application of the Python ConfigParser Module
  • How to Use Python to decrypt the basic VBS application code

CGI stands for the COMMON Gateway Interface (Public Gateway Interface), which describes the Interface specifications between the Web server and Web programs, allowing users to execute Web programs through the Web server, and return the result to the browser through the Web server.

The main difference with traditional programs is that the input and output are different. The input of traditional desktop programs mostly comes from the keyboard, the standard input of the Python CGI program is obtained by environment variables and materials in special formats. The standard output of traditional programs is displayed on the console screen, the CGI program generates HTML content or information that can be received by other browsers to the Web server, and then the Web server returns the information to the browser.

Configure the Python CGI Environment on Windows 98

1. Install pws

2. Install Python

3rd, run regedit.exe

4. The key to accessing the Registry (Script_Map) is as follows:

 
 
  1. HKEY_LOCAL_MACHINE  
  2. System  
  3. CurrentControlSet  
  4. Services  
  5. W3Svc  
  6. Parameters  
  7. Script_Map 

5. Create a New String Value ". cgi" for Script_Map"

6. assign a value for ". cgi" "C:" python "python-u % s"

7. Restart your computer

After the above steps, you have configured the python cgi Environment on Windows 98.

Now you can put the python script with the extension. cgi in the relevant directory (such as cgi-bin) and execute it in the browser.

Configure the Python CGI Environment on IIS in Windows 2000

1. Start --> program --> Management --> Internet service management;

2. Choose site> Properties> WWW Service> Edit> Home directory> Configuration> application ing;

3. Click "add" to bring up a dialog box;

4. Fill in C: "Python24" python.exe-u "% s" "% s" in the "executable" text box, and fill in the "extension" text box. cgi: click "OK. You can also configure it in the registry like Windows 98.

Configure the Python CGI Environment on IIS in Windows 2003

It is basically the same as that on Windows 2000, but because Windows 2003 IIS6 has strict permission control, you must set additional security-related environments and open the CGI program permission, all unknown CGI extensions must be "Allowed" in the Internet Information Service (IIS) manager.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.