我遵循了以下步骤
python2.7 ./setup.py install安装。这是centos 6 64位上python的altinstall。trac-admin operationalintelligence initenv上创建存储库我启用了selinux并运行了chcon -R -t httpd_sys_content_t /usr/share/trac
< Location / trac /operationalintelligence > SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv“/usr/share/trac/可操作性情报”PythonOption TracUriRoot /usr/share/trac/可操作性情报“SetEnv PYTHON_EGG_CACHE /tmp PythonInterpreter trac”
Apache在尝试重新启动时失败。
使用下面的配置,我将收到以下错误
Invalid command 'PythonInterpreter', perhaps misspelled or defined by a module not included in the server configuration
#Alias /trac /usr/share/trac/operationalintelligence
#<Directory /usr/share/trac/operationalintelligence>
# SetHandler mod_python
# PythonInterpreter main_interpreter
# PythonHandler trac.web.modpython_frontend
# PythonOption TracEnv /usr/share/trac/operationalintelligence
# PythonOption TracUriRoot /trac
#</Directory>我现在已经尝试了wsgi配置,该配置正在进行中。
WSGIScriptAlias /trac /usr/share/trac/operationalintelligence/cgi-bin/trac.wsgi
<Directory /usr/share/trac/operationalintelligence/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>我在httpd错误日志中收到的错误是
[Thu Feb 04 17:40:52 2016] [error] [client 47.73.16.6] mod_wsgi (pid=30558): Exception occurred processing WSGI script '/usr/share/trac/operationalintelligence/cgi-bin/trac.wsgi'.
[Thu Feb 04 17:40:52 2016] [error] [client 47.73.16.6] Traceback (most recent call last):
[Thu Feb 04 17:40:52 2016] [error] [client 47.73.16.6] File "/usr/share/trac/operationalintelligence/cgi-bin/trac.wsgi", line 30, in application
[Thu Feb 04 17:40:52 2016] [error] [client 47.73.16.6] from trac.web.main import dispatch_request
[Thu Feb 04 17:40:52 2016] [error] [client 47.73.16.6] ImportError: No module named trac.web.main
[Thu Feb 04 17:40:58 2016] [error] [client 47.73.16.6] mod_wsgi (pid=30553): Exception occurred processing WSGI script '/usr/share/trac/operationalintelligence/cgi-bin/trac.wsgi'.
[Thu Feb 04 17:40:58 2016] [error] [client 47.73.16.6] Traceback (most recent call last):
[Thu Feb 04 17:40:58 2016] [error] [client 47.73.16.6] File "/usr/share/trac/operationalintelligence/cgi-bin/trac.wsgi", line 30, in application
[Thu Feb 04 17:40:58 2016] [error] [client 47.73.16.6] from trac.web.main import dispatch_request
[Thu Feb 04 17:40:58 2016] [error] [client 47.73.16.6] ImportError: No module named trac.web.main
^C发布于 2016-02-05 23:04:00
ModPython的问题似乎是因为mod_python没有被加载。尝试:
a2enmod mod_pythonWSGI的问题在于Python路径上找不到Trac包。可能是权限问题。
发布于 2018-07-30 19:43:25
更改python文件的所有权有助于我:
chown -R wwwrun /usr/lib64/python2.7/site-packageshttps://stackoverflow.com/questions/35205990
复制相似问题