Gitweb

来自百合仙子's Wiki
跳转到导航 跳转到搜索

配置

配置文件

定义项目起始目录。如果不指定仓库列表文件的话,gitweb 会寻找其下的所有仓库:

our $projectroot = "$ENV{HOME}/workspace";

服务器配置

Nginx 配置示例(使用 nginx-fcgi 脚本:

server {
    server_name     gitweb.localhost;
    access_log      /srv/http/localhost/logs/gitweb.access.log;
    error_log       /srv/http/localhost/logs/gitweb.error.log;

    location / {
        root          /usr/share/gitweb; 
        gzip off;     #gzip makes scripts feel slower since they have to complete before getting gzipped
        fastcgi_pass  unix:/tmp/cgi-dispatch.sock;
        fastcgi_index gitweb.cgi;
        fastcgi_param SCRIPT_FILENAME /usr/share/gitweb$fastcgi_script_name;
        include fastcgi_params;
    }

    location /static {
        root    /usr/share/gitweb;
    }
}
GITWEB_CONFIG=$HOME/workspace/gitweb_config.perl nginx-fcgi -l log -S /tmp/cgi-dispatch.sock -pid nginx-fcgi.pid

参见

外部链接