Apache2 Web服务器上Trac的子位置

时间:2013-03-15 23:08:28

标签: apache2 trac

我需要将Trac放在除/之外的URL路径上。如果我从http://trac.edgewall.org/wiki/TracOnUbuntu获取配置并修改位置块,则会收到错误消息“没有处理程序匹配的请求到/ trac”。我怎么能避免这个?

<VirtualHost *:80>
    ServerName trac.local
    <Location /trac> # instead of Location /
       SetHandler mod_python
       PythonInterpreter main_interpreter
       PythonHandler trac.web.modpython_frontend
       PythonOption TracEnv /var/local/trac
       PythonOption TracEnvParentDir /var/local/trac
       PythonOption TracUriRoot /
       PythonOption TracEnv /var/local/trac
        # PythonOption TracEnvIndexTemplate /var/local/trac/templates/index-template.html
       PythonOption TracLocale en_US.UTF8
       PythonOption PYTHON_EGG_CACHE /tmp
       Order allow,deny
       Allow from all
    </Location>
    <Location /trac/login> # instead of /login
      AuthType Basic
      AuthName "myproject"
      AuthUserFile /var/local/trac/.htpasswd
      Require valid-user
    </Location>
</VirtualHost>

1 个答案:

答案 0 :(得分:0)

如何调整'PythonOption TracUriRoot /'呢?

此外请注意,mod_python已经过折旧(寿命终止),而您应该更换choose WSGI代替新安装。