|PyApache Home||PyApache Distribution|
The PyApache module embeds the Python interpreter into the Apache server enabling the execution of Python code directly, with a consequent speed-up in server response time. Python scripts executed by an embedded interpreter will run much faster than ordinary scripts since the interpreter need not be launched for every script, requiring only a warm restart. Runs with Python1.X/2.X under Apache 1.3.X/2.0 (configurable).
As with most Apache modules these days, the server does not need to be patched in order to integrate this module; a Makefile script runs Apache's "apxs" utility which compiles and installs PyApache.
A "hello world" minimalist example:
#!/usr/bin/python print "Content-type: text/plain\r\n\r\n" print "Hello world"
"What's the difference between PyApache and mod_python?".
- PyApache embeds a Python interpreter in Apache and that's it. Unlike mod_python, there are no special interface classes, no hooks into the request structure, just native execution of Python code. You can import any of the standard Python library packages or add your own.
[Sunday 18th. January 2004]