我有一个这样做的WSGI应用程序:
p = Popen(["which", "java"], stdout=PIPE).stdout.readlines()
返回空。我的WSGI配置是:
<VirtualHost *:80>
ServerAdmin my@myserver.com
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between other python apps).
WSGIDaemonProcess formshare python-path=/opt/formshare display-name=formshare processes=2 threads=15
WSGIScriptAlias /formshare /opt/formshare/src/formshare/extras/wsgi/formshare.wsgi process-group=formshare application-group=%{GLOBAL}
<Location "/formshare">
WSGIProcessGroup formshare
</Location>
#Output any errors and messages to these files
ErrorLog /var/log/httpd/formshare.error.log
CustomLog /var/log/httpd/formshare.custom.log combined
</VirtualHost>
知道为什么吗?我已经尝试了不同的WSGI版本和WSGIRestrictStdout Off,但似乎没有任何工作。
这里的问题是我用su(我使用slackware)启动Apache,并且在su下java不可用。如果我用root登录并启动apache,那么一切都很好。