Apache Trac的内部服务器错误:“0”;ModuleNotFoundError:没有名为';trac&x27&引用;

Apache Trac的内部服务器错误:“0”;ModuleNotFoundError:没有名为';trac&x27&引用;,apache,error-handling,httpd.conf,internal-server-error,trac,Apache,Error Handling,Httpd.conf,Internal Server Error,Trac,我正在新的RHEL 8服务器上安装Trac,在httpd错误日志中发现一个内部服务器错误: ModuleNotFoundError: No module named 'trac' 我试着用 journal -xe | grep httpd (也为trac和apache添加了灰色)-并且在那里也显示了零错误信息 httpd正常启动,无误 Trac被配置为使用wsgi,它不是具有内置服务器的独立版本。apachehttpd应该支持错误处理 以下是httpd trac.conf文件: WSGIS

我正在新的RHEL 8服务器上安装Trac,在httpd错误日志中发现一个内部服务器错误:

ModuleNotFoundError: No module named 'trac'
我试着用

journal -xe | grep httpd 
(也为tracapache添加了灰色)-并且在那里也显示了零错误信息

httpd
正常启动,无误

Trac被配置为使用wsgi,它不是具有内置服务器的独立版本。apachehttpd应该支持错误处理

以下是httpd trac.conf文件:

WSGIScriptAlias /trac /data/www/virtualhosts/trac/cgi-bin/trac.wsgi
 
<Location "/trac/login">
  AuthType Basic
  AuthName "Issue Tracker"
  AuthUserFile /data/www/virtualhosts/trac/conf/trac.htpasswd
  Require valid-user
</Location>
 
 
<Directory /data/www/virtualhosts/trac/cgi-bin>
    WSGIApplicationGroup %{GLOBAL}
    # For Apache 2.2
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>
    # For Apache 2.4
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
</Directory>
python版本

[user@box] # python --version
Python 2.7.17 
我不明白为什么我不能在屏幕上显示任何错误信息,或者最好是写入日志文件。此服务器不是生产服务器,所以我现在可以在屏幕上显示内容


非常感谢任何帮助

问题可能是
cgi-bin
目录或其父目录上的权限

trac admin
deploy
命令将为您创建一个
trac.wsgi
,但是您需要在您的环境目录之外进行部署,否则,您将得到以下错误:

Error: Resources cannot be deployed to a target directory that is equal to or below the source directory '/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/htdocs'.

Please choose a different target directory and try again.
如果您的环境是
/data/www/virtualhosts/trac
,请运行:

$ trac-admin /data/www/virtualhosts/trac deploy /data/www/virtualhosts/www

然后将virtualhosts文件指向
/data/www/virtualhosts/www/cgi-bin/trac.wsgi

我会尝试运行以验证您的trac安装。此外,请检查对
trac.wsgi
的权限,并可能共享您的Apache站点文件内容。trac.wsgi是否应为可执行文件?目前,644tracd从命令行启动时没有错误,但我无法测试,因为我的组织在网络级别阻止了端口8080,
trac.wsgi
需要由Apache执行。将trac.wsgi设置为可执行,重新启动的httpd仍然获得
modulenofounderror:没有名为“trac”的模块
继续获取
[5月3日星期一17:59:34.043574 2021][wsgi:error][pid 250003:tid 139841006806784][客户端IP:16389]ModuleNotFoundError:在应用上述命令并重新启动httpd后,没有名为“trac”的模块。
系统路径Python 3而不是Python 2上的默认Python吗?检查
Python--version
Python--version
Python 2.7.17问题在于Python路径。另外,我认为您的trac.wsgi需要
!/path/to/Python
at顶部。哪个python的输出是什么?Trac安装在哪里?python-c导入Trac是否成功?
哪个python
/usr/bin/python.Trac安装到
/data/www/virtualhosts/Trac/
$ trac-admin /data/www/virtualhosts/trac deploy /data/www/virtualhosts/www