Gitweb on uhttpd [Solved]

Hi everyone,
I'm trying to setup gitweb on my NAS on openwrt.
I have installed lighhttpd and even Luci works.
I am probably having a problem with the correct lighttpd configuration.
I added the file:

root@RpiTestowe:/home/git# cat /etc/lighttpd/conf.d/20-gitweb.conf 
server.modules += ( "mod_alias", "mod_cgi", "mod_redirect", "mod_setenv" )

url.redirect += ( "^/gitweb$" => "/gitweb/" )
alias.url += ( "/gitweb/" => "/www/gitweb/" )
$HTTP["url"] =~ "^/gitweb/" {
       setenv.add-environment = (
               "GITWEB_CONFIG" => "/etc/gitweb.conf",
               "PATH" => env.PATH
       )
       cgi.assign = ( ".cgi" => "/usr/bin/perl" )
       server.indexfiles = ( "gitweb.cgi" )
}

In logs I see

Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.458) -- logical -> physical
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.459) Doc-Root     : /www
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.460) Basedir      : /www
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.461) Rel-Path     : /gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.462) Path         : /www/gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.479) -- handling physical path
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.480) Path         : /www/gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.487) -- file found
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.488) Path         : /www/gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.649) -- handling subrequest
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.650) Path         : /www/gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.614) === start of condition block ===
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.533) 1 (cached) result: false
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (mod_indexfile.c.158) -- handling the request as Indexfile
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (mod_indexfile.c.159) URI          : /gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.614) === start of condition block ===
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.533) 1 (cached) result: false
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.614) === start of condition block ===
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.533) 1 (cached) result: false
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.614) === start of condition block ===
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.533) 1 (cached) result: false
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.614) === start of condition block ===
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (configfile-glue.c.533) 1 (cached) result: false
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (mod_staticfile.c.205) -- handling file as static file
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (http-header-glue.c.462) not a regular file: /gitweb/ -> /www/gitweb/
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.661) -- subrequest finished
Thu Nov 22 12:04:39 2018 daemon.err lighttpd[3446]: (response.c.122) Response-Header: \nHTTP/1.1 403 Forbidden\r\nContent-Type: text/html\r\nContent-Length: 345\r\nDate: Thu, 22 Nov 2018 11:04:39 GMT\r\nServer: lighttpd/1.4.48\r\n\r\n

What to change ? What can I check? For now, I want it to be as root - I do it on test hardware (raspberry) before I put it on the target device (NAS)

Hi, No one is using gitweb ?

  • I've moved this to the For Developers section for you.
  • You're running a software repository from your router...interesting
  • You got LuCI running on lighhttpd...wow!

Configuration:
install git-gitweb package.
Adding a missing dependency on perlbase-filetest and perlbase-storable

Assuming you have a standard luci install (i.e. uhttpd installed), you can see gitweb at http://your-host/cgi-bin/gitweb.cgi. You may want to set up an alias so that you don't have to use that URL:

in /etc/config/uhttpd you could add

        list index_page 'gitweb.cgi'
        list index_page 'index.html'
        list alias '/git=/cgi-bin/gitweb.cgi'

(Not sure if the index_page thing is required, but it works for me).

With that config you can point at http://your-host/git and see what gitweb is publishing.

Other than that standard you'd do standard gitweb configs you can search.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.