0

I tried setting up gitweb, but when I load the page, it comes out weird...

enter image description here


Edit: In case people misunderstood, this is what it should look like: enter image description here


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?

someguy
  • 7,144
  • 12
  • 43
  • 57

2 Answers2

1

The problem is that CSS documents aren't being recognized properly.

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

The mime type needed to be set.

someguy
  • 7,144
  • 12
  • 43
  • 57
0

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:

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

There are more config parameters available, just have a look at the documentation (under /usr/share/doc/git*)

Thomas Berger
  • 1,860
  • 13
  • 26
  • That's right, it isn't a bare repository. Are you sure that would solve the problem, though? I thought this would have something to do with my lighttpd/gitweb configuration. – someguy Aug 19 '11 at 21:43
  • @someguy Updated my post. To work with a bare repostory should work always. Make sure that your Path is pointing to the **parent** directory, not to the repository. – Thomas Berger Aug 19 '11 at 22:09
  • I'm using git 1.7.6, which is the latest stable version. I've updated my question showing what it *should* look like in case you misunderstood the problem. I've tried pointing to the parent directory and it's the same problem. – someguy Aug 20 '11 at 10:59