LoadModule python_module extramodules/mod_python.so # NOTE: # If you get something like this in the log: # [error] (28)No space left on device: mod_python: Failed to create global mutex 145 of 256 # increase the values like this: # echo "300 90000 100 150" > /proc/sys/kernel/sem # # Mod_python is a module that embeds the Python language interpreter # within the server, allowing Apache handlers to be written in Python. # # This will cause files beneath /var/www/html with the extension .spam # to be handled by the Python script /var/www/html/eggs.py # # # # AddHandler python-program .spam # # PythonHandler eggs # # This will cause all requests to the /python hierarchy of your # webserver to be handled by the python script /path/to/myhandler.py # # # SetHandler python-program # PythonPath "sys.path + ['/path/to']" # PythonHandler myhandler # # This will cause all requests to the /python hierarchy of your # webserver to be handled by mod_python's Publisher handler # (see http://localhost/manual/mod/mod_python/hand-pub.html) # # # SetHandler python-program # PythonHandler mod_python.publisher # # This will cause all requests to *.psp under the /python hierarchy of your # webserver to be handled by mod_python's PSP handler # (see http://localhost/manual/mod/mod_python/hand-psp.html) # Another nice introduction can be found on # http://www.onlamp.com/pub/a/python/2004/02/26/python_server_pages.html # # # AddHandler mod_python .psp # PythonHandler mod_python.psp # # # If you need to debug, uncomment the following line # #PythonDebug On # # If you wan to see the generated python source, enable debug # # and uncomment the following line. # #AddHandler mod_python .psp_ #