mod-wsgi &阿帕奇金字塔(pylonsproject)
我在 apache+mod-wsgi 下运行金字塔网站时遇到问题。问题是我无法告诉 apache 哪个 python 解释器最适合它所服务的站点。我有几个虚拟环境,我想使用那些 python 解释器。
我将此代码添加到我的 apache 配置中:
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=karantan group=karantan processes=1 threads=4 python- path=/home/karantan/pyramid1.0/bin/python
WSGIScriptAlias /myapp /home/karantan/myproject/pyramid.wsgi
<Directory /home/karantan/myproject>
WSGIProcessGroup pyramid
Order allow,deny
Allow from all
</Directory>
还有一个名为 WSGIPythonHome 的参数,它告诉 apache 哪个解释器是正确的,但我不能将其放入此配置中,因为它是全局变量(或类似的东西......)
所以如何在apache下使用虚拟环境运行金字塔网站?
如上所述,我的主要问题(我认为)是 apache 总是使用默认系统 python 解释器(/usr/bin/python)运行金字塔。我如何告诉 apache 它必须从 virtualenv 中获取一个。???
i have a problem with running pyramid site under apache+mod-wsgi. the problem is that i can't tell apache which python interpretor is the right one for the site it serve. i have several virtual environments and i would like to take those python interpretors.
i added this code to my apache config:
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=karantan group=karantan processes=1 threads=4 python- path=/home/karantan/pyramid1.0/bin/python
WSGIScriptAlias /myapp /home/karantan/myproject/pyramid.wsgi
<Directory /home/karantan/myproject>
WSGIProcessGroup pyramid
Order allow,deny
Allow from all
</Directory>
there is also a parameter called WSGIPythonHome that tells apache which interpretor is the right one but i can't put it in this config because it is global variable (or something like that...)
so how do i run pyramid site with virtual environment under apache?
as stated above my main problem (i think) is that apache always runs pyramid with default system python interpretor (/usr/bin/python). how do i tell apache that it must take the one from the virtualenv.???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有关如何通过 mod_wsgi 使用虚拟环境的文档,请访问:
http://code.google .com/p/modwsgi/wiki/VirtualEnvironments
Documentation explaining how to use virtual environments with mod_wsgi can be found at:
http://code.google.com/p/modwsgi/wiki/VirtualEnvironments