Gitweb 无法正确显示
我尝试设置 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 文件。 编辑:这是因为我没有更新缓存。
有什么想法吗?
I tried setting up gitweb, but when I load the page, it comes out weird...
Edit: In case people misunderstood, this is what it should look like:
This is what my lighttpd configuration file looks like:
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"
)
This is what gitweb.conf looks like:
$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
is just to give you an idea.)
When I use git instaweb
, it seems to come out fine, although it looks like it's ignoring the new gitweb.css file that I'm trying to use. Edit: It's because I didn't update the cache.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是 CSS 文档没有被正确识别。
需要设置 mime 类型。
The problem is that CSS documents aren't being recognized properly.
The mime type needed to be set.
gitweb
仅适用于裸存储库。所以请确保你有一个。您的屏幕截图看起来像是您已经创建了一个具有完整工作树的存储库,并指向该目录。编辑
当前版本的 gitweb 也可以在非裸机上运行,但您的系统可能有旧版本。
缺少的存储库名称可以在 git-config 中配置:
还有更多可用的配置参数,只需查看文档(在 /usr/share/doc/git* 下)
gitweb
works only on bare repositories. So make sure you have one. Your screen-shot looks like you have created one repository with full working tree, and pointing to this directory.EDIT
The current version of gitweb works on non-bare also, but your system may have an older one.
The missing name of the repository could be configured in your git-config:
There are more config parameters available, just have a look at the documentation (under /usr/share/doc/git*)