1.安装Python2.4.2
2.下载quixote包,运行setup.py install.
quixote将被拷贝到python的site-package目录下。
3.Windows下直接安装,如果是Linux:上传Apache2源码到redhat.
命令行下:
./configure
./make
./make install
4.配置httpd.conf:
增加:
LoadModule python_module modules/mod_python.so
<Directory "D:/Program Files/Apache Group/Apache2/py">
#这里一定是绝对路径
SetHandler python-program
PythonHandler quixote.server.mod_python_handler
PythonOption quixote-publisher-factory quixote.demo.create_publisher
PythonInterpreter quixote.demo
PythonDebug On
</Directory>
访问:http://localhost:8080/py/demo.py/
实际上其中py后边的/a/可以是任何其他东东,只要不要加,即使没有存在于/py目录下
这样子跑起来的是Quixote的Demo,与设置的其他无关。
2.下载quixote包,运行setup.py install.
quixote将被拷贝到python的site-package目录下。
3.Windows下直接安装,如果是Linux:上传Apache2源码到redhat.
命令行下:
./configure
./make
./make install
4.配置httpd.conf:
增加:
LoadModule python_module modules/mod_python.so
<Directory "D:/Program Files/Apache Group/Apache2/py">
#这里一定是绝对路径
SetHandler python-program
PythonHandler quixote.server.mod_python_handler
PythonOption quixote-publisher-factory quixote.demo.create_publisher
PythonInterpreter quixote.demo
PythonDebug On
</Directory>
访问:http://localhost:8080/py/demo.py/
实际上其中py后边的/a/可以是任何其他东东,只要不要加,即使没有存在于/py目录下
这样子跑起来的是Quixote的Demo,与设置的其他无关。
Hello, world!
To understand what's going on here, be sure to read the doc/demo.txt
file included with Quixote.
Here are some features of this demo:
- simple: A Python function that generates a very simple document.
- plain: A Python function that generates a plain text document.
- error: A Python function that raises an exception.
- publish_error: A Python function that raises a
PublishError
exception. This exception will be caught by a_q_exception_handler
method. - dumpreq: Print out the contents of the HTTPRequest object.
- css: The stylesheet for this document.
- extras/: Demos of some of Quixote's more adva