2025年搭建git服务器web界面(如何搭建git服务器)

搭建git服务器web界面(如何搭建git服务器)sudo apt get install apache2 git core gitwebsudo a2enmod rewrite nbsp vi etc gitweb conf nbsp projectroot strong home git work strong 我的 git 代码库 project

大家好,我是讯享网,很高兴认识大家。



 

#vi /etc/gitweb.conf 

\(projectroot = "<strong>/home/git/work</strong>"; 我的git代码库project.git在/home/git/work/目录下。注意是XXX.git所在的路径,但是不要包含XXX.git<br>\)git_temp = “/tmp”;
#\(home_link = \)my_uri || “/”;
\(home_text = "indextext.html";<br>\)projects_list = \(projectroot;<br>\)stylesheet = “/gitweb.css”;
\(logo = "/git-logo.png";<br>\)favicon = “/git-favicon.png”;
# enable human readable URLs
\(feature{'pathinfo'}{'default'} = [1];</p> <p>然后#vi&nbsp;/etc/apache2/sites-available/gitweb</p> <p>&lt;VirtualHost *&gt;<br> ServerName git.mydomain.com<br> ServerAlias git</p> <p> DocumentRoot <strong>/home/git/work</strong><br> SetEnv GITWEB_CONFIG /etc/gitweb.conf</p> <p> RewriteEngine on<br> RewriteRule ^/\) /gitweb [PT]
RewriteRule ^/(..git/(?!/?(HEAD|info|objects|refs)).)?\( /gitweb%{REQUEST_URI} [L,PT]</p> <p> # Aliases<br> ScriptAlias /gitweb /usr/lib/cgi-bin/gitweb.cgi<br> Alias /gitweb.css /usr/share/gitweb/gitweb.css<br> Alias /git-logo.png /usr/share/gitweb/git-logo.png<br> Alias /git-favicon.png /usr/share/gitweb/git-favicon.png</p> <p> # Logfiles<br> ErrorLog /var/log/apache2/gitweb.error.log<br> CustomLog /var/log/apache2/gitweb.access.log combined<br>&lt;/VirtualHost&gt;</p> <p>再然后:</p> <p>\)sudo&nbsp;a2ensite&nbsp;gitweb

















讯享网

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

&nbsp;

小讯
上一篇 2025-05-01 08:19
下一篇 2025-04-18 21:51

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/136322.html