Tuesday, October 13, 2009

gitweb on Ubuntu/Jaunty

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

6 comments:

Install and setup gitweb in Ubuntu 9.10 on apache | Phlegx Systems said...

[...] http://gideontsang.wordpress.com 0 Comments [...]

Setting up Gitweb on your Ubuntu workstation « sonia hamilton – linux, brazilian jiu jitsu said...

[...] /etc/apache2/conf.d/gitweb, so there’s no other files to edit (unlike what blog1, blog2, or blog3 [...]

sekar said...

hello
could you please let me know the steps to install and setup gitweb on windows.

-sekar

Premium Accounts said...

Premium Accounts...

[...]gitweb on Ubuntu/Jaunty « Gideon’s blog[...]...

Anonymous said...

This site really helped in setting gitweb on remote ubuntu server, Thanks Buddy.

Setting up Gitweb on your Ubuntu workstation | Sonia Hamilton said...

[...] /etc/apache2/conf.d/gitweb, so there’s no other files to edit (unlike what blog1, blog2, or blog3 [...]