Steps required to build a Python Web environment (1)

Source: Internet
Author: User

Before we build a Python Web environment, most people use PHP for the Web server environment, but currently some projects need to use python third-party libraries, but I hope this service is implemented in the form of Web. If you don't have a better solution, try setting up a Python Web environment!

  • The built-in code generator of Boost. Python is Pyste.
  • Which libraries should be linked when Python is embedded in c?
  • Python scripts and C ++ programs call each other
  • Introduction to the powerful functions of the Python standard library
  • Simple Procedure for generating dll-independent exe using Python

Because the project requirements have very simple web service requirements and do not involve complex web page and session processing, I checked the web page and found that mod_python is the easiest method. Basically, it is a combination of Apache + Python + mod_python. mod_python is a bridge between Apache and Python.

Installation steps:

Installation notes: mod_python has strict requirements on apache and python versions, so you need to find the correct version during installation. I installed mod_python-3.3.1.win32-py2.5-Apache2.2, corresponding python version is 2.5, Apache version is 2.2.

1. Install python2.5.x

Download python from the python website. I downloaded version 2.5.4. The default settings are used for installation. No need to make changes.

2. install Apache Server

Download the version from the apache website. I downloaded the version Apache2.2.14. The installation is basically a default setting. One step is to enter the domain name and administrator information, just enter one. Another step is to select the owner or only the current user. You can select either of them. The two are the differences between ports.

After the installation is complete, choose Start> Apache HTTP Server 2.2> Control Apache Server> Start Apache in Console. Start Apache Server. Then, test in the browser. Http: // localhost: port 8080 varies according to your choice). If everything is normal, It Works appears.

3. Install mod_python

Download mod_python. The installation location of python is automatically detected during installation. However, you must manually select the installation location of apache. Select the apache2 layer. My computer is D: \ Program Files \ Apache Software Foundation \ Apache2.2 ). mod_python adds some libraries under the lib directory of python and the mod_python.so library under the modules directory of Apache.


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.