我正在使用mod_wsgi在Apache2上部署我的web.py应用程序。

这是我的virt_host文件,

WSGIPythonPath /home/ubuntu/plotwatt/libplotwatt:/home/ubuntu/plotwatt/pwstage/src

<VirtualHost *:20108>
ServerAdmin gslabrails.dev.plotwatt.com

DocumentRoot /var/www
WSGIScriptAlias / /var/www/currentcost/server.py
WSGIDaemonProcess currentcost user=ubuntu group=ubuntu processes=5 threads=3
WSGIProcessGroup currentcost
WSGIApplicationGroup %{GLOBAL}
AddType text/html .py

<Directory /var/www/currentcost/>
    Order deny,allow
    Allow from all
</Directory>

ErrorLog /var/log/apache2/currentcost_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/currentcost_access.log combined

</VirtualHost>

我已经给出了指向WSGIPythonPath中名为redisStage的库的路径。但是,这似乎对我不起作用。我的配置有误吗?
我无法将WSGIPythonPath指令放入VitualHost指令中。
一定是什么原因?

最佳答案

根据the docs,在使用守护程序模式时不能使用WSGIPythonPath。使用WSGIDaemonProcess directive的“python-path”选项代替。

关于python - WSGIPythonPath无法正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12931013/

10-11 15:28