织梦CMS - 轻松建站从此开始!

罗索

创建自己的git管理平台

落鹤生 发布于 2012-04-27 10:09 点击:次 
这两天在本机试用git,想在linux下建立自己的git管理平台,折腾了半天终于OK,详述如下。
TAG:

这两天在本机试用git,想在linux下建立自己的git管理平台,折腾了半天终于OK,详述如下。

1 准备工作
下载git和httpd两个tar包
git-1.5.3.2.tar.bz2
httpd-2.2.9.tar.bz2
主机IP:10.0.12.167
虚拟机IP:10.0.12.143

2 编译安装
    tar -xjvf git-1.5.3.2.tar.bz2
    cd git-1.5.3.2
    ./configure --prefix=/usr/local/git
    make
    make install
    
    tar -xjvf httpd-2.2.9.tar.bz2
    cd httpd-2.2.9
    ./configure --prefix=/usr/local/httpd
    make
    make install
   
3 配置
    (1) cp -a git-1.5.3.2/gitweb/* /usr/local/httpd/cgi-bin
    (2) cp -a git-1.5.3.2/gitweb /usr/local/httpd/htdocs/
    (3) cp gitweb_config.perl /usr/local/httpd/cgi-bin
    (4) modify /usr/local/httpd/conf/httpd.conf

4 文件gitweb_config.perl内容如下
#!/usr/bin/perl

@stylesheets = ("/gitweb/gitweb.css");
our $logo = "/gitweb/git-logo.png";
our $favicon = "/gitweb/git-favicon.png";
our $projectroot = "/pub/git";

5 文件httpd.conf修改如下
Listen 10.0.12.144:80
ServerName 10.0.12.144
<Directory "/usr/local/httpd/htdocs">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Deny From all
    Allow from 10.0.12.144
    Allow from 10.0.12.167
</Directory>
<Directory "/usr/local/httpd/cgi-bin">
    AllowOverride None
    Options None
    Order deny,allow
    Deny from all
    Allow from 10.0.12.144
    Allow from 10.0.12.167
</Directory>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
    ScriptAlias /git "/usr/local/httpd/htdocs/cgi-bin/gitweb.cgi"
</IfModule>

6 git仓库创建
    cd /pub/git
    mkdir GitTest
    git-init-db
   
    cd /home/user/temp
    mkdir GitTest
    git-init-db
    (copy project files here)
    git-add .
    git-commit -a -m "Initial"
    git-push /pub/git/GitTest master:master
   
7 gitweb浏览
    回到主机打开IE浏览器,输入http://10.0.12.143/git
    大功告成!

----------------------------------------------------------------   

更新一下~~

ubuntu9.10发布了,忍不住安装

ubuntu下搭建git服务器更为简单

<1> apt-get install git-core gitweb apache2

<2> 默认css是没有加载的

    cd /var/www

    ln -s /usr/share/gitweb/* .

<3> 修改配置文件

    vi /etc/gitweb.conf

    修改其中$projectroot为自己的git目录

<4> 打开http://localhost/cgi-bin/gitweb.cgi

    是不是大功告成了!!

    用apt-get安装方便多了。

(韵寒书香)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/201204/15967.html]
本文出处:blog.chinaunix.net 作者:韵寒书香 原文
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容