我正在尝试在Apache 2.4.25下运行WSGI mod上的Turbogears2应用程序:

我的虚拟主机似乎没问题:/etc/apache2/sites-available/site.conf

<VirtualHost *:80>

        ServerName www.site.com
        #ServerAdmin "Charlie ROOT"

        # ISTC is the only application on this server, thus will be served from /
        WSGIScriptAlias / /usr/local/lib/python2.7/dist-packages/site.egg/apache/app.wsgi

        # Have apache serving static content directly (not through WSGI)
        Alias /img /usr/local/lib/python2.7/dist-packages/site.egg/ehp/public/img
        Alias /css /usr/local/lib/python2.7/dist-packages/site.egg/ehp/public/css
        Alias /js /usr/local/lib/python2.7/dist-packages/site.egg/ehp/public/js

        # Execution is "daemon mode"
        WSGIProcessGroup www.site.com
        WSGIDaemonProcess www.site.com user=www-data group=www-data threads=4 python-path=/usr/local/lib/python2.7/dist-packages

我的文件/etc/apache2/apache.conf似乎也包含了严格的政策:

<Directory / >
        Require all granted
</Directory>

所以这给我一个内部服务器错误...

我检查了Apache var / log / error.log:

mod_wsgi (pid=15064): Target WSGI script '/usr/local/lib/python2.7/dist-packages/site.egg/apache/app.wsgi' cannot be loaded as Python module

mod_wsgi (pid=15064): Exception occurred processing WSGI script '/usr/local/lib/python2.7/dist-packages/site.egg/apache/app.wsgi'.

Traceback (most recent call last):
.
................
........................................
.......................................
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve
         raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'who_ldap>=3.2.2' distribution was not found and is required by site

我只是成功重新安装“who_ldap-3.2.2.tar.gz”模块,所以我不明白......这是一个python路径问题吗?怎么纠正呢?