0

我尝试设置 gitweb,但是当我加载页面时,它变得很奇怪......

在此处输入图像描述


编辑:如果人们误解了,它应该是这样的: 在此处输入图像描述


这是我的 lighttpd 配置文件的样子:

server.port = 80
server.username = "http"
server.groupname = "http"
server.document-root = "/usr/share/gitweb"
server.errorlog = "/var/log/lighttpd/error.log"
dir-listing.activate = "enable"
index-file.names = ( "gitweb.cgi" )
cgi.assign = (
    ".cgi" => ""
)
mimetype.assign = (
    ".html" => "text/html",
    ".txt" => "text/plain",
    ".jpg" => "image/jpeg",
    ".png" => "image/png"
)
server.modules += (
    "mod_cgi",
    "mod_setenv"
)
setenv.add-environment = (
    "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf"
)

这是 gitweb.conf 的样子:

$git_temp = "/tmp";

# The directories where your projects are. Must not end with a slash.
$projectroot = "/path/to/projects";

# Base URLs for links displayed in the web interface.
our @git_base_url_list = qw(git://localhost http://git@localhost);

/path/to/projects只是给你一个想法。)

当我使用git instaweb时,它似乎很好,尽管它看起来忽略了我正在尝试使用的新 gitweb.css 文件。编辑:这是因为我没有更新缓存。

有任何想法吗?

4

2 回答 2

1

问题是 CSS 文档没有被正确识别。

mimetype.assign = (
    ".html" => "text/html",
    ".txt" => "text/plain",
    ".jpg" => "image/jpeg",
    ".png" => "image/png",
    ".css" => "text/css"
)

需要设置 MIME 类型。

于 2011-08-20T13:05:41.543 回答
0

gitweb仅适用于裸存储库。所以确保你有一个。您的屏幕截图看起来像您创建了一个具有完整工作树的存储库,并指向该目录。

编辑 当前版本的 gitweb 也适用于非裸机,但您的系统可能有一个较旧的系统。

可以在 git-config 中配置缺少的存储库名称:

[gitweb]
  description = "My Repository Description"
  cloneurl    = git://here.you.could/clone/me.git
  owner       = "Me"

有更多可用的配置参数,只需查看文档(在 /usr/share/doc/git* 下)

于 2011-08-19T21:32:03.997 回答