zoukankan      html  css  js  c++  java
  • Redhat 6 git服务器配置 (git-daemon)

    git-daemon是按照git的自己的git协议进行访问git服务
     
    1.git-daemon软件安装

    软件仓库见 redhat 6 git 服务器 配置 (http)

     
    2.配置git daemon
    git daemon有默认功能是直接依附在inetd上工作的
    编辑
    /etc/xinetd.d/git
     

    service git

    {
            disable         = no
     
            # git is in /etc/services only on RHEL5+
            #type            = UNLISTED
            #port            = 9418
     
            socket_type     = stream
            wait            = no
            user            = nobody
            server          = /usr/libexec/git-core/git-daemon
            server_args     = --base-path=/var/www/git --export-all --user-path=public_git --syslog --inetd --verbose
            log_on_failure  += USERID
            # xinetd does not enable IPv6 by default
            # flags           = IPv6
    }
     
    disable改成no
    base-path切换成 git仓库所在的路径 /var/www/git
     
    3.配置防火墙
    编辑/etc/sysconfig/iptables
    添加下面两项
    -A OUTPUT -p tcp --dport 9418 -m state --state NEW,ESTABLISHED -j ACCEPT
    -A INPUT -p tcp --sport 9418 -m state --state ESTABLISHED -j ACCEPT
    或者使用system-config-firewall-tui开放9418端口
     
    4.重启xinetd服务
    service xinetd restart
     
    至此就可以适应使用git访问了git clone git://server/XXXX.git了
     
    注:
    需要对仓库进行push操作的话
    需要设定仓库的daemon.receivepack属性为true,如下
    cd XXX.git
    git config --file config daemon.receivepack true
     
    参考资料:
    man git-daemon
  • 相关阅读:
    软件测试作业4
    Android基础知识每日记(持续更新)
    二叉树操作总结
    No.223 Rectangle Area
    No.66 Plus One
    No.80 Remove Duplicates from Sorted Array ||
    No.27 Remove Element
    No.26 Remove Duplicates from Sorted Array
    No.9 Palindrome Number
    No.219 Contains Duplicate ||
  • 原文地址:https://www.cnblogs.com/zelos/p/5910607.html
Copyright © 2011-2022 走看看