Make sure these GIT packages are installed:
$ aptitude install git git-core gitk gitweb
Assume the default apache web server is /var/www/ ,
gitweb is the directory I want to install gitweb:
$ cd /var/www/ $ mkdir gitweb $ cd gitweb
copy gitweb graphics and stylesheets(git-favicon.png git-logo.png gitweb.css) to its directory, their path should correspond to what states in /etc/gitweb.conf:
$ cd /var/www/gitweb/ $ cp /usr/share/gitweb/* .
add gitweb directory to apache2 configuration by creating a “gitweb” file inside apache conf.d directory:
$ vi /etc/apache/conf.d/gitweb
Paste the following text and modify if your path is different:
Alias /gitweb /var/www/gitweb
Options Indexes FollowSymlinks ExecCGI
DirectoryIndex /cgi-bin/gitweb.cgi
AllowOverride None
Modify gitweb.conf, assuming the public GIT repositories are located in /var/www/repo/
$ vi /etc/gitweb.conf
$projectroot = “/var/www/repo/”;
# directory to use for temp files
$git_temp = “/tmp”;# target of the home link on top of all pages
#$home_link = $my_uri || “/”;# html text to include at home page
$home_text = “indextext.html”;# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;# stylesheet to use
# I took off the prefix / of the following path to put these files inside gitweb directory directly
$stylesheet = “gitweb.css”;# logo to use
$logo = “git-logo.png”;# the ‘favicon’
$favicon = “git-favicon.png”;
restart apache2 web server:
$ sudo /etc/init.d/apache2 restart
Now you should be able to view gitweb listing all GIT projects under /var/www/repo/:
http://localhost/gitweb
March 7, 2010 at 7:47 am
[…] https://gideontsang.wordpress.com 0 Comments […]
August 2, 2011 at 3:26 pm
[…] /etc/apache2/conf.d/gitweb, so there’s no other files to edit (unlike what blog1, blog2, or blog3 […]
October 19, 2011 at 6:38 pm
hello
could you please let me know the steps to install and setup gitweb on windows.
-sekar
December 9, 2011 at 1:36 am
Premium Accounts…
[…]gitweb on Ubuntu/Jaunty « Gideon’s blog[…]…
December 12, 2011 at 7:24 pm
This site really helped in setting gitweb on remote ubuntu server, Thanks Buddy.
February 4, 2012 at 12:12 am
[…] /etc/apache2/conf.d/gitweb, so there’s no other files to edit (unlike what blog1, blog2, or blog3 […]