搭建网页版的git服务器,git 代码服务器的网页版gitweb的搭建

sudo apt-get install apache2 git-core gitweb

sudo a2enmod rewrite

#vi /etc/gitweb.conf

$projectroot = "/home/git/work"; 我的git代码库project.git在/home/git/work/目录下。注意是XXX.git所在的路径,但是不要包含XXX.git

$git_temp = "/tmp";

#$home_link = $my_uri || "/";

$home_text = "indextext.html";

$projects_list = $projectroot;

$stylesheet = "/gitweb.css";

$logo = "/git-logo.png";

$favicon = "/git-favicon.png";

# enable human readable URLs

$feature{'pathinfo'}{'default'} = [1];

然后#vi /etc/apache2/sites-available/gitweb

ServerName git.mydomain.com

ServerAlias git

DocumentRoot /home/git/work

SetEnv GITWEB_CONFIG /etc/gitweb.conf

RewriteEngine on

RewriteRule ^/$ /gitweb [PT]

RewriteRule ^/(.*.git/(?!/?(HEAD|info|objects|refs)).*)?$ /gitweb%{REQUEST_URI} [L,PT]

# Aliases

ScriptAlias /gitweb /usr/lib/cgi-bin/gitweb.cgi

Alias /gitweb.css /usr/share/gitweb/gitweb.css

Alias /git-logo.png /usr/share/gitweb/git-logo.png

Alias /git-favicon.png /usr/share/gitweb/git-favicon.png

# Logfiles

ErrorLog /var/log/apache2/gitweb.error.log

CustomLog /var/log/apache2/gitweb.access.log combined

再然后:

$sudo a2ensite gitweb

$sudo invoke-rc.d apache2 restart  重启Apache

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值