如何更改Trac的附件路径/文件夹?
我有虚拟主机:
/home/public_html/ - my www folder
/home/trac/ - trac projects folder
/home/trac/attachment/ - attachment folder
但我无法访问它。当我附加文件时,我无法通过Apache输出文件,因为它存储在apache htdocs之外。
我无法使用'别名' :/(我无法访问Apache配置文件,我只有.htaccess) 我可以访问Trac源(但它们存储在.egg文件中的哪个位置?)
我需要做什么?我想将附件文件夹移动到/ home / public_html / attachment /
答案 0 :(得分:1)
你有几个选择:
attachments
目录替换为新位置。Attachment._get_path()
方法。但是您不应该使用任何这些解决方案,原因如下:
为什么要从Web服务器提供附件?您的用户会非常重视下载附件吗?
正确的解决方案是在Trac中实现X-Sendfile
,这是我们打算在不久的将来做的事情。有关跟踪进度,请参阅#7894。