mod-wsgi &阿帕奇金字塔(pylonsproject)

发布于 2024-11-15 09:25:18 字数 777 浏览 2 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月依秋水 2024-11-22 09:25:18

有关如何通过 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文