天天看點

install and config gitweb

 gitweb安裝及配置

1、安裝apache2及gitweb

sudo apt-get install apache2 gitweb

gitweb.cgi安裝位置在/usr/lib/cgi-bin下

2、配置gitweb

sudo vi /etc/gitweb.conf

修改$PROJECT_ROOT為你的項目根目錄,比如本例中使用/home/amba/repositories作為根目錄

3、修改/etc/apach2/sites-available/default為

<VirtualHost *:80>

ServerName git-server

DocumentRoot /usr/lib/cgi-bin

<Directory /usr/lib/cgi-bin>

Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch

AllowOverride All

order allow,deny

Allow from all

AddHandler cgi-script cgi

DirectoryIndex gitweb.cgi

</Directory>

</VirtualHost>

4、重新開機動apache2

sudo service apache2 restart

這樣你就可以在http://ip位址/gitweb.cgi下看到$PROJECT_ROOT下的項目了。

5、如果将gitweb.cgi重命名為index.cgi,并在上述配置中