gitweb在ubuntu上的配置

首先安裝:

$ 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";


轉自:http://my.chinaunix.net/space.php?uid=20146040&do=blog&id=76266
發佈了34 篇原創文章 · 獲贊 12 · 訪問量 16萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章