配置Apache+mod_py+quixote

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,与设置的其他无关。

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
  •  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值