cgit setup with nginx

Debian 安装 cgit 流水帐。

1
sudo apt-get install git nginx cgit fcgiwrap highlight

vim /etc/nginx/conf.d/cgit.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
server {

listen 80;
server_name example.com;
root /usr/share/cgit;
try_files $uri @cgit;

location @cgit {

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
fastcgi_param PATH_INFO $uri;
fastcgi_param QUERY_STRING $args;
fastcgi_param HTTP_HOST $server_name;
fastcgi_pass unix:/run/fcgiwrap.socket;
}
}
1
2
sudo mkdir /cgit/
sudo chmod 777 /cgit

vim /etc/cgitrc

1
2
3
4
5
6
7
8
9
10
11
12
#
# cgit config
# see cgitrc(5) for details

#css=/cgit-css/cgit.css
#logo=/cgit-css/cgit.png
css=/cgit.css
logo=/cgit.png
virtual-root=/
scan-path=/cgit/
enable-git-config=1
enable-index-owner=0

edit /usr/share/git-core/templates/description to custom your description

/cgit is your git repositories folder

1
2
3
4
sudo systemctl stop fcgiwrap 
sudo systemctl stop nginx
sudo systemctl start fcgiwrap
sudo systemctl start nginx

It should be working..

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×