运行 ViewVC 的 FastCGI 配置的 Lighttpd - 重写问题

运行 ViewVC 的 FastCGI 配置的 Lighttpd - 重写问题

目前我正在努力配置lighttpd和查看VC。配置从 Apache 2.2.x 移植而来,目前仍在机器上运行,通过代理提供 WebDAV/SVN 服务。

现在,我遇到的问题似乎与重写规则有关,我不太确定我在这里遗漏了什么。这是我的配置(略作精简以保持简洁):

var.hgwebfcgi                        = "/var/www/vcs/bin/hgweb.fcgi"
var.viewvcfcgi                       = "/var/www/vcs/bin/wsgi/viewvc.fcgi"
var.viewvcstatic                     = "/var/www/vcs/templates/docroot"
var.vcs_errorlog                     = "/var/log/lighttpd/error.log"
var.vcs_accesslog                    = "/var/log/lighttpd/access.log"

$HTTP["host"] =~ "domain.tld" {
    $SERVER["socket"] == ":443" {
        protocol                     = "https://"
        ssl.engine                   = "enable"
        ssl.pemfile                  = "/etc/lighttpd/ssl/..."
        ssl.ca-file                  = "/etc/lighttpd/ssl/..."
        ssl.use-sslv2                = "disable"
        setenv.add-environment       = ( "HTTPS" => "on" )
        url.rewrite-once            += ("^/mercurial$" => "/mercurial/" )
        url.rewrite-once            += ("^/$" => "/viewvc.fcgi" )
        alias.url                   += ( "/viewvc-static" => var.viewvcstatic )
        alias.url                   += ( "/robots.txt" => var.robots )
        alias.url                   += ( "/favicon.ico" => var.favicon )
        alias.url                   += ( "/mercurial" => var.hgwebfcgi )
        alias.url                   += ( "/viewvc.fcgi" => var.viewvcfcgi )
        $HTTP["url"] =~ "^/mercurial" {
            fastcgi.server += (
                ".fcgi" => ( (
                    "bin-path"      => var.hgwebfcgi,
                    "socket"        => "/tmp/hgwebdir.sock",
                    "min-procs"     => 1,
                    "max-procs"     => 5
                ) )
            )
        } else $HTTP["url"] =~ "^/viewvc\.fcgi" {
            fastcgi.server += (
                ".fcgi" => ( (
                    "bin-path"      => var.viewvcfcgi,
                    "socket"        => "/tmp/viewvc.sock",
                    "min-procs"     => 1,
                    "max-procs"     => 5
                ) )
            )
        }
        expire.url                   = ( "/viewvc-static" => "access plus 60 days" )
        server.errorlog              = var.vcs_errorlog
        accesslog.filename           = var.vcs_accesslog
    }
}

现在,当我访问 时domain.tld,我可以正确看到存储库的索引。但是,当我查看每个相应存储库的链接(或单击它们)时,它的形式是 ,https://domain.tld/viewvc.fcgi/reponame而不是预期的形式https://domain.tld/reponame

我必须更改/添加什么才能实现此目的?我是否必须以某种方式“滥用”索引文件机制?目标是保持/mercurial别名的功能。

到目前为止,我已尝试再次仔细阅读 Packt 的 lighttpd 书籍,也阅读了 lighttpd 文档,但似乎没有发现与问题相符的内容。

相关内容