免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 915 | 回复: 0
打印 上一主题 下一主题

创建自己的git管理平台 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-30 17:02 |只看该作者 |倒序浏览

                                这两天在本机试用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
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Deny From all
    Allow from 10.0.12.144
    Allow from 10.0.12.167
    AllowOverride None
    Options None
    Order deny,allow
    Deny from all
    Allow from 10.0.12.144
    Allow from 10.0.12.167
    ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/"
    ScriptAlias /git "/usr/local/httpd/htdocs/cgi-bin/gitweb.cgi"
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
    大功告成!
   
   

               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/61880/showart_1069911.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP