第一步: 当然是安装了


sudo aptitude install build-essential
                      autoconf
                      automake
                      libtool
                      libfcgi-dev
                      spawn-fcgi
                      fcgiwrap
git clone https://github.com/gnosek/fcgiwrap.git
git clone git://hjemli.net/pub/git/cgit
git clone git://github.com/gnosek/fcgiwrap.git
cd fcgiwrap/
autoreconf -i
make
sudo make install
sudo cp fcgiwrap /usr/local/bin/

由于hjemli主机目前已经将代码迁移到https://git.zx2c4.com/cgit,所以可以去这个地方下载源码,
然后根据源码中的README来讲cgit安装到系统中。

第二步:居然是配置nginx服务器或者Apache服务器 /etc/nginx/sites-available/default

server {
        listen 80;
        server_name localhost;
        root /var/www/htdocs/cgit;
        location ~* ^.+\.(css|png|ico)$ {
                expires 30d;
        }
        location / {
                index cgit.cgi;
                fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi;
                fastcgi_pass unix:/var/run/fcgiwrap.socket;
                fastcgi_param HTTP_HOST $server_name;
                fastcgi_param PATH_INFO $uri;
                fastcgi_param QUERY_INFO $uri;
                include "fastcgi_params";


        }
        access_log /var/log/nginx/cgit_access.log;
        error_log /var/log/nginx/cgit_error.log warn;
}

第三步:配置cgit的配置文件,将系统的git 仓库配置到/etc/cgitrc

virtual-root=/
enable-index-links=1
enable-log-filecount=1
enable-log-linecount=1
#snapshots=tar.gz tar.bz zip
enable-commit-graph=1
enable-subject-links=1
#enable-http-clone=1
enable-http-clone=0
root-desc=Git repositories hosted project
root-title=git repositories

repo.url=xxx.git

repo.path=/home/git/xxx.git
repo.desc= xxx for xxxxxx
repo.owner=xxx

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐