install packages
sudo aptitude install gitweb apache2configure gitweb
modify
/etc/gitweb.conf:
# path to git projects (.git)
#$projectroot = "/var/cache/git";
$projectroot = "/srv/gitosis/repositories";
# 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;
$projects_list = "/srv/gitosis/gitosis/projects.list";
# stylesheet to use
#$stylesheet = "/gitweb.css";
$stylesheet = "/git/gitweb.css";
# logo to use
#$logo = "/git-logo.png";
$logo = "/git/git-logo.png";
# the 'favicon'
#$favicon = "/git-favicon.png";
$favicon = "/git/git-favicon.png";
configure apache2
create
/etc/apache2/conf.d/git with this content:
<Directory /var/www/git>
Allow from all
AllowOverride all
Order allow,deny
Options ExecCGI
<Files gitweb.cgi>
SetHandler cgi-script
</Files>
</Directory>
DirectoryIndex gitweb.cgi
SetEnv GITWEB_CONFIG /etc/gitweb.conf
make files visible to apache2
sudo mkdir /var/www/git
sudo cp /usr/share/gitweb/* /var/www/git
sudo cp /usr/lib/cgi-bin/gitweb.cgi /var/www/git
sudo /etc/init.d/apache2 reload
chmod 0755 /srv/gitosis/repositories/test_repo.git
configure gitosis
git clone gitosis@localhost:gitosis-admin.git
cd gitosis-admin
modify
gitosis.conf, add the following:
[repo test_repo]
gitweb = yes
description = one line test repo description
owner = first_name last_name
save the configuration and push it back to gitosis
git add gitosis.conf
git ci -m "publishing test_repo via gitweb"
git push origin master
try it out
open
http://localhost/git and see test_repo.git in column titled "Project"references
- how to install a public git repository on a debian server
- daniel baumann debian cheatpages on gitosis
/usr/share/doc/gitosis/examples/example.conf(installed with gitosis package)
No comments:
Post a Comment