gitweb setup with nginx

Debian 安装 gitweb 流水帐。

install base packages

1
2
sudo su
apt install nginx nginx-common git gitweb fcgiwrap highlight

edit nginx

1
vim /etc/nginx/conf.d/gitweb.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
server {
listen 80;
server_name example.com;

location /index.cgi {
root /usr/share/gitweb/;
include fastcgi_params;
gzip off;
fastcgi_param SCRIPT_NAME $uri;
fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}

location / {
root /usr/share/gitweb/;
index index.cgi;
}
}
1
service nginx restart

custom gitewb

1
vim /etc/gitweb.conf
1
2
3
4
5
6
7
8
9
# custom git folder
$projectroot = "/gitweb";
# owner name display = none
our $omit_owner = 1;
# highlight code
$feature{'highlight'}{'default'} = [1];
$projects_list = $projectroot;
@stylesheets = ("static/gitweb.css");
$javascript = "static/gitweb.js";
1
vim  /usr/share/git-core/templates/description
1
custom description XD
1
2
3
systemctl stop nginx 
systemctl restart fcgiwrap
systemctl start nginx
1
2
mkdir /gitweb
git clone --bare https://github.com/example.git /gitweb

custom theme

1
2
3
git clone https://github.com/kogakure/gitweb-theme /usr/share/gitweb/gitweb-theme
cd /usr/share/gitweb/gitweb-theme/
./setup -vi --install
Your browser is out-of-date!

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

×