install and config gitweb

 gitweb安裝及配置

1、安裝apache2gitweb

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,並在上述配置中

修改 DirectoryIndex gitweb.cgi爲

DirectoryIndex index.cgi,則通過http://ip地址/就可以看到$PROJECT_ROOT下的項目了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章