Gitweb is the default web interface provided with [[git]] itself and is the basis for other git scripts like [[cgit]], [[gitosis]] and others.

Gitweb is the default web interface provided with [[git]] itself and is the basis for other git scripts like [[cgit]], [[gitosis]] and others.

+

+

gitweb actually supports fcgi natively, so you don't need to wrap it as a cgi script http://repo.or.cz/w/alt-git.git?a=blob_plain;f=gitweb/INSTALL https://sixohthree.com/1402/running-gitweb-in-fastcgi-mode

==Installation==

==Installation==

Line 8:

Line 10:

Next you need to link the current gitweb default to your webserver location. In this example I use the default folder locations:

Next you need to link the current gitweb default to your webserver location. In this example I use the default folder locations:

ln -s /usr/share/gitweb /srv/http/gitweb

ln -s /usr/share/gitweb /srv/http/gitweb

+

+

{{Note|1=You may want to double check the server directory to make sure the symbolic links were made.}}

That's it for the "installation". Next is the configuration.

That's it for the "installation". Next is the configuration.

Line 13:

Line 17:

==Configuration==

==Configuration==

===Apache===

===Apache===

−

Add the following to the end of you /etc/httpd/conf/httpd.conf

+

Add the following to the end of your /etc/httpd/conf/httpd.conf

<Directory "/srv/http/gitweb">

<Directory "/srv/http/gitweb">

DirectoryIndex gitweb.cgi

DirectoryIndex gitweb.cgi

Line 26:

Line 30:

</Directory>

</Directory>

−

You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.

+

If using a virtualhosts configuration, add this to /etc/httpd/conf/extra/httpd-vhosts.conf

+

<VirtualHost *:80>

+

ServerName gitserver

+

DocumentRoot /var/www/gitweb

+

<Directory /var/www/gitweb>

+

Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch

+

AllowOverride All

+

order allow,deny

+

Allow from all

+

AddHandler cgi-script cgi

+

DirectoryIndex gitweb.cgi

+

</Directory>

+

</VirtualHost>

+

+

You could also put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.

===Lighttpd===

===Lighttpd===

−

If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:

I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.

That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You do not need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.