在Python 2.7.11, ModWSGI 4.4.6和Apache 2.4.20的WSGI下运行Popen返回空



我有一个这样做的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,那么一切都很好。

最新更新