gpt4 book ai didi

apache - 使用 Apache 部署 Trac 1.0 - 'chrome' 和 'site' 文件夹 MIA

转载 作者:行者123 更新时间:2023-12-02 05:03:51 34 4
gpt4 key购买 nike

我刚刚使用 easy_install-2.6 安装了 Trac 1.0 的副本,但在破译 Install documentation 的“部署 Trac”部分时遇到了困难。 。

发出easy_install-2.6 Trac=1.0后,我创建了我的环境,如下所示:

trac-admin /www/virtualhosts/trac initenv

接下来,我设置权限:

chown -R apache.apache /www/virtualhosts/trac/

我的/etc/httpd/conf.d/trac.conf 文件如下所示:

<Location /trac>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
# "/www/virtualhosts/svn/trac" is the folder you gave to trac-admin initenv earlier
PythonOption TracEnv /www/virtualhosts/trac
# "/trac" is the same as the Location above
PythonOption TracUriRoot /trac
# "/tmp" should be some writable temporary directory
SetEnv PYTHON_EGG_CACHE /tmp
# "trac" can be any string, but must be the same for all
# Trac instances on the same Apache install
PythonInterpreter trac
</Location>
<Location /trac/login>
AuthType Basic
AuthName "Trac User"
AuthUserFile /www/virtualhosts/trac/conf/trac.htpasswd
Require valid-user
</Location>

我重新加载了 httpd 配置:

service httpd reload

没有看到任何错误,我通过将浏览器指向 http://my.site/trac/ 打开了 Trac 安装。 Trac 应用程序加载正常。

在文档中,有一个关于部署 Trac 的部分。这是我有点模糊的地方。我安装的 trac 是否尚未部署?或者这是一个额外的步骤?

其次,在映射静态资源下,文档解释了如何为两个目录添加别名:chrome 和 site。在 Apache ScriptAlias 示例的开头,文档提供了以下命令:

trac-admin /var/trac/env deploy /path/to/trac/htdocs/common

我的系统上没有/var/trac/env。我无法找到该目录的创建位置,除非它应该是在 Trac 1.0 初始安装期间设置的。

有人可以解释一下需要做什么才能创建 chrome/site 目录吗?我知道这些是 Apache 的别名,但我没有得到上面引用的命令,其中 trac-admin 使用/var/trac/env 中的某些内容。该目录不存在,因此我无法发出该部署命令。

我需要 chrome/site 别名正常工作才能安装插件。

最佳答案

一方面,不要使用 mod_python。它不再被维护,并且存在一些已知问题。 Setting up your server to use WSGI会给您带来更好的体验。

特别是关于 deploy 命令,Trac 文档确实可以更清晰一些。我相信这两个目录路径只是占位符,与到目前为止文档中使用的路径没有任何关系。它们只是为了与后面的配置文件示例中使用的路径相匹配。

根据您提供的信息以及我设置 Trac 系统时的笔记,请尝试以下命令:

trac-admin /www/virtualhosts/trac deploy /www/virtualhosts/trac/deploy

这应该在您的 Trac 目录中创建一个 deploy 子目录,并用“cgi-bin”和“htdocs”子文件夹填充它。从那里,只需根据您正在进行的部署类型修改您的 Apache 配置文件(更多详细信息请参阅 FastCGIWSGI 页面)。

关于apache - 使用 Apache 部署 Trac 1.0 - 'chrome' 和 'site' 文件夹 MIA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12752463/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com