歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Gitweb在Ubuntu上的配置

Gitweb在Ubuntu上的配置

日期:2017/2/28 16:10:17   编辑:Linux教程

首先安裝:

$ sudo apt-get install gitweb

gitweb.cgi 腳本安裝在 /usr/lib/cgi-bin/ 中,該目錄為默認 Ubuntu 上 apache2 的 cgi-bin 目錄。所以,打開:

http://localhost/cgi-bin/gitweb.cgi

默認沒有 css 加載,把 gitweb 要用的靜態文件連接到 DocumentRoot 下:

$ cd /var/www/
$ sudo ln -s /usr/share/gitweb/* .

修改配置:

$ sudo vi /etc/gitweb.conf

將 $projectroot 改為存放各個 .git 的目錄。保存後刷新浏覽器。
Related Posts

如果沒有找到項目,你需要將projectroot/*.git 的屬性改為755,讓apache用戶有可讀權限。可以只改你需要讓別人通過web訪問的那個git。
http://localhost/cgi-bin/gitweb.cgi


/etc/gitweb.conf 內容:
# path to git projects (<project>.git)
$projectroot = "/var/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
$stylesheet = "/gitweb/gitweb.css";

# logo to use
$logo = "/gitweb/git-logo.png";

# the 'favicon'

$favicon = "/gitweb/git-favicon.png";

Copyright © Linux教程網 All Rights Reserved