安装gitweb
安装
sudo apt-get install -y git git-core gitweb
配置
修改/etc/gitweb.conf
# path to git projects (.git) $projectroot = “/home/git/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;
# stylesheet to use @stylesheets = (“static/gitweb.css”);
# javascript code for gitweb $javascript = “static/gitweb.js”;
# logo to use $logo = “static/git-logo.png”;
# the ‘favicon’ $favicon = “static/git-favicon.png”;
# git-diff-tree(1) options to use for generated patches
#@diff_opts = (“-M”); @diff_opts = ();
接入apache
创建配置文件
sudo touch /etc/apache2/sites-available/gitweb.conf
sudo nano /etc/apache2/sites-available/gitweb.conf
Alias /gitweb /usr/share/gitweb
Options FollowSymLinks ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex index.cgi gitweb.cgi
Order Deny,Allow
Allow from all
生成链接
cd /etc/apache2/sites-enabled
sudo ln -s /etc/apache2/sites-available/gitweb.conf
开启cgi
cd /etc/apache2/mods-enabled
sudo ln -s /etc/apache2/mods-available/cgi.load
重启apache
sudo service apache2 restart