#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
<VirtualHost *>
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
</VirtualHost>
再然后:
$sudo a2ensite gitweb
$sudo invoke-rc.d apache2 restart 重启Apache
到此这篇搭建git 服务器web界面(如何搭建git服务器)的文章就 介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在编程的领域有一番成就!
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/hd-wfwjg/74942.html