使用lighttpd设置git-server/web:给出..找不到git上传包



我已经设置了lighttpd和gitweb。创建了一个空存储库,如下所示:

$server> git --version
git version 1.7.11.7
$server> git --bare init p1
$server> cd p1
$server> git update-server-info
$server> cd ..
$server> chown -R lighttpd:lighttpd p1

在浏览器中,我可以浏览这个存储库,但当我试图从命令行克隆它时,我会得到:

$> git clone https://example.com/git/project.git p1
Cloning into 'p1'...
fatal: https://example.com/git/project.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?

也许这有帮助,这是我的lighttpd配置

alias.url += (
  "/static/gitweb.css"      => "/var/www/git/static/gitweb.css",
  "/static/git-logo.png"    => "/var/www/git/static/git-logo.png",
  "/static/git-favicon.png" => "/var/www/git/static/git-favicon.png",
  "/static/gitweb.js"       => "/var/www/git/static/gitweb.js",
  "/git"                    => "/var/www/git/gitweb.cgi"
)

我确实运行了"git更新服务器信息",但没有成功!有什么建议吗?

有时这是一个git可执行路径问题。这个问题也许可以找到解决办法。

此外,如果您有权访问lighttpd服务器日志,请检查error.log并验证url是否正确。如果服务器conf使用重定向,那么git-reos也必须使用正确的别名访问。这是对这个问题的回答中的一个建议。这个问题也涉及这个主题。

这个github信息网页指出,服务器(http服务器使用的)和客户端之间的git版本差异可能会导致这样的问题。此网页描述了如何在ubuntu服务器上将git升级到最新的稳定版本(如果您使用的是LTS,则非常有用)。

Sitaram在这里添加了一些关于如何正确设置的文档。

我在安装apache时遇到了类似的问题,但还没有找到解决方案。

最新更新