mod_python

from Wikipedia, the free encyclopedia

mod_python is a module for the Apache HTTP server that integrates the Python programming language into the web server. The aim was to replace the “ Common Gateway Interface ” (CGI) for executing Python scripts . The main advantage is the faster execution. Mod_python was not further developed between 2007 and the beginning of 2013; However, a new version was then released on November 13, 2013. A conceptual further development of mod_python is mod_wsgi . Another method to accelerate CGI is " FastCGI ".

functionality

With CGI programs, a new process is started on the server for each request , which calls the interpreter of the language, which in turn interprets the desired script and then executes it. This procedure is not fast enough on sites with many visitors per time unit. Therefore, the language is embedded directly in the web server. The interpreter runs all the time. This is exactly why “mod_python” - and comparable modules for other programming languages ​​- was developed.

advantages

  • There is no need to start the interpreter.
  • Since the process does not end after a client request has been processed, permanent data - such as B. Database connections - are canceled for subsequent inquiries and do not have to be re-initialized for each inquiry.
  • Since "mod_python" modules are integrated directly into the web server, everything can be done that otherwise modules written in the more complex C language can be done: implementation of protocols other than HTTP , filtering of the request and the response, determination of the data format, etc.

disadvantage

  • The start-up configuration is still a bit more complicated to accomplish than the use of the mostly preconfigured CGI alternative.
  • Since the scripts are embedded directly in the server, they are executed with the more extensive rights of the server process. In order to avoid security gaps, the administrator has to configure the server correctly (this applies to all programming languages ​​that are embedded directly in the web server and has nothing to do with Python).

history

The first version of "mod_python" was released in 2000 by Gregory Trubetskoy . Since 2002 "mod_python" has been an official project of the Apache Software Foundation . Development was suspended between 2007 and 2013, but the new version 3.5.0, which uses Python 3 for the first time, was released on November 13, 2013.

Web links

Individual evidence

  1. a b http://www.modpython.org