作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在虚拟环境中,我在python2.7
内部有一个名为lib
的文件夹。
在阅读了六篇教程之后,我无法弄清楚我想把WSGIPythonPath指向什么。我见过一些指向site-packages
的指针,但有些却是用冒号:
分隔的列表。
Syntax error on line 1019 of /etc/httpd/conf/httpd.conf:
WSGIPythonPath cannot occur within <VirtualHost> section
最佳答案
您收到错误消息是因为 VirtualHost 上下文内无法使用 WSGIPythonPath 指令。您必须在主Apache配置文件中声明它。如果仍要指向VirtualHost上下文中的virtualenv中的目录,请改用 WSGIDaemonProcess 伪指令,它具有python-path选项供您声明相关的python目录。
例如:您的虚拟主机配置文件应如下所示:
<VirtualHost *:80>
ServerName example.com
CustomLog logs/example.com-access_log common
ErrorLog logs/example.com-error_log
WSGIDaemonProcess example.com python-path=/virtualenvpathto/site-packages:/pathto/exampleprojecthome
WSGIProcessGroup example.com
...
</VirtualHost>
关于python - WSGIPythonPath应该在我的virtualenv中指向何处?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27832777/
我正在使用 mod_wsgi 在 Apache2 上部署我的 web.py 应用程序。 这是我的 virt_host 文件, WSGIPythonPath /home/ubuntu/plotwatt/
Windows 8.1 x64 - Python 3.4.1 (pyzo_distro-2014a.win64) - Apache httpd-2.4.10-win64 - mod_wsgi-3.5.
我是一名优秀的程序员,十分优秀!