Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Gitweb未正确显示_Linux_Gitweb_Lighttpd - Fatal编程技术网

Linux Gitweb未正确显示

Linux Gitweb未正确显示,linux,gitweb,lighttpd,Linux,Gitweb,Lighttpd,我试着设置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.activa

我试着设置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"
)
$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);
这就是gitweb.conf的样子:

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"
)
$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文件编辑:这是因为我没有更新缓存


有什么想法吗?

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

编辑 当前版本的gitweb也可以在非裸机上工作,但您的系统可能有一个旧版本

无法在git配置中配置缺少的存储库名称:

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

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

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

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

需要设置mime类型。

修改样式表后是否尝试绕过缓存?(Ctrl+R或Ctrl+F5)@Lekensteyn:哦,对了。谢谢:)。这就解决了instaweb的问题。没错,它不是一个简单的存储库。不过,你确定这能解决问题吗?我以为这与我的lighttpd/gitweb配置有关。@someguy更新了我的帖子。用一个赤裸裸的故事工作应该永远有效。确保您的路径指向父目录,而不是存储库。我使用的是git 1.7.6,这是最新的稳定版本。我已经更新了我的问题,显示了它应该是什么样子,以防你误解了这个问题。我试着指向父目录,这也是同样的问题。