Ubuntu 16.04 cgit with apache2

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 libssldev

(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 details

css=/cgit-css/cgit.css
logo=/cgit-css/cgit.png

repo.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

 

留下评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据