Ubuntu 16.04环境下搭建Git服务器
(1)安装apache2
sudo apt-get install apache2
(2)安装cgit
git clone https://git.zx2c4.com/cgit
cd cgit
git submodule init
git submodule update
make
sudo make install
依赖项
sudo apt-get install build-essential
sudo apt-get install libssl–dev
(3)配置apache2
启用模块
sudo a2enmod cgid
添加/etc/apache2/conf-available/cgit.conf
ScriptAlias /cgit/ “/var/www/htdocs/cgit/cgit.cgi/”
RedirectMatch ^/cgit$ /cgit/
Alias /cgit-css “/var/www/htdocs/cgit/”
<Directory “/var/www/htdocs/cgit/”>
AllowOverride None
Options ExecCGI FollowSymlinks
Require all granted
</Directory>
启用cgit.conf
sudo ln -sf ../conf-available/cgit.conf cgit.conf
(4)配置cgit
/etc/cgitrc
#
# cgit config
# see cgitrc(5) for detailscss=/cgit-css/cgit.css
logo=/cgit-css/cgit.pngrepo.url=test.git
repo.path=/var/www/htdocs/cgit/test.git
repo.desc=the master test repository
repo.owner=test@example.com
repo.readme=info/web/about.html