复制代码代码如下: # path to git projects (<project>.git) #$projectroot = "/var/cache/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 = ("/gitweb/static/gitweb.css"); # javascript code for gitweb $javascript = "gitweb/static/gitweb.js"; # logo to use $logo = "/gitweb/static/git-logo.png"; # the "favicon" $favicon = "/gitweb/static/git-favicon.png"; # git-diff-tree(1) options to use for generated patches #@diff_opts = ("-M"); @diff_opts = (); 12、配置apache2 ubuntu中默认的web目录是/var/www,默认的cgi目录是 /usr/lib/cgi-bin/,安装完成gitweb后,gitweb的gitweb.cgi会自动放置到该目录下。 如果你的cgi路径不是默认的/usr/lib/cgi-bin/,需要将gitweb安装在/usr/lib/cgi-bin中的gitweb.cgi复制到原来配置的cgi-bin路径,并在apache的配置文件/etc/apache2/apache.conf末尾加上以下内容:
复制代码代码如下: SetEnvGITWEB_CONFIG /etc/gitweb.conf <Directory "/srv/www/cgi-bin/gitweb"> Options FollowSymlinks ExecCGI Allow from all AllowOverride all Order allow,deny <Files gitweb.cgi> SetHandler cgi-script </Files> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.* /gitweb.cgi/$0 [L,PT] </Directory>