第 178 章 cvs - Concurrent Versions System

178.1. installation

过程 178.1. install cvs

  1. install

    $ sudo apt-get install xinetd
    $ sudo apt-get install cvs
    			

    show the cvs version

    $ cvs -v
    
    Concurrent Versions System (CVS) 1.12.13 (client/server)
    			
  2. create cvs group and cvsroot user

    $ sudo groupadd cvs
    $ sudo adduser cvsroot --ingroup cvs
    			

    change user become cvsroot

    $ su - cvsroot
    			
  3. initialization 'CVSROOT'

    $ cvs -d /home/cvsroot init
    			

    if you have successed, you can see CVSROOT directory in the '/home/cvsroot'

    $ ls /home/cvsroot/
    CVSROOT
    			
  4. authentication

    default SystemAuth=yes, you can use system user to login cvs.

    but usually, we don't used system user because it isn't security.

    SystemAuth = no

    edit '/home/cvsroot/CVSROOT/config' make sure SystemAuth = no

    $ vim /home/cvsroot/CVSROOT/config
    SystemAuth = no
    			

    create passwd file

    the format is user:password:cvsroot

    you need to using htpasswd command, if you don't have, please install it as the following

    $ sudo apt-get install apache2-utils
    			

    or

    $ perl -e 'print("userPassword: ".crypt("secret","salt")."\n");'
    			

    or

    $ cat passwd
    #!/usr/bin/perl
    srand (time());
    my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
    my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
    my $plaintext = shift; my $crypttext = crypt ($plaintext, $salt);
    print "${crypttext}\n";
    
    $ ./passwd "mypasswd"
    atfodI2Y/dcdc
    			

    let's using htpasswd to create a passwd

    $ htpasswd -n neo
    New password:
    Re-type new password:
    neo:yA50LI1BkXysY
    			

    copy 'neo:yA50LI1BkXysY' and add ':cvsroot' to the end

    $ vim /home/cvsroot/CVSROOT/passwd
    neo:yA50LI1BkXysY:cvsroot
    nchen:GXaAkSKaQ/Hpk:cvsroot
    			
  5. Go into directory '/etc/xinetd.d/', and then create a cvspserver file as the following.

    $ sudo vim /etc/xinetd.d/cvspserver
    
    service cvspserver
    {
       disable = no
       flags = REUSE
       socket_type = stream
       wait = no
       user = cvsroot
       server = /usr/bin/cvs
       server_args = -f --allow-root=/home/cvsroot pserver
       log_on_failure += USERID
    }
    			
  6. check cvspserver in the '/etc/services'

    $ grep cvspserver /etc/services
    cvspserver      2401/tcp                        # CVS client/server operations
    cvspserver      2401/udp
    			
  7. restart xinetd

    $ /etc/init.d/xinetd
    Usage: /etc/init.d/xinetd {start|stop|reload|force-reload|restart}
    			
  8. port

    $ nmap localhost -p cvspserver
    
    Starting Nmap 4.53 ( http://insecure.org ) at 2008-11-14 16:21 HKT
    Interesting ports on localhost (127.0.0.1):
    PORT     STATE SERVICE
    2401/tcp open  cvspserver
    
    Nmap done: 1 IP address (1 host up) scanned in 0.080 seconds
    			
  9. firewall

    $ sudo ufw allow cvspserver
    			

environment variable

CVSROOT=:pserver:username@ip:/home/cvsroot

vim .bashrc

export CVS_RSH=ssh
export CVSROOT=:pserver:neo@localhost:/home/cvsroot
	

test

$ cvs login
Logging in to :pserver:neo@localhost:2401/home/cvsroot
CVS password:
neo@netkiller:/tmp/test$ cvs co test
cvs checkout: Updating test
U test/.project
U test/NewFile.xml
U test/newfile.php
neo@netkiller:/tmp/test$
	

178.1.1. chroot

$ sudo apt-get install cvsd
		

environment variable

neo@netkiller:~/workspace/cvs$ export CVSROOT=:pserver:neo@localhost:/home/cvsroot
		

ssh

export CVS_RSH=ssh
export CVSROOT=:ext:$USER@localhost:/home/cvsroot
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 前言 CVS 是 Concurrent Versions System 的简称。它是现今 Open Source 成功发展的幕後功臣之一。CVS 解决多人合作开发时程式版本控管的问题,通常会再搭配邮件列表(Mailing List)做为开发团队沟通的管道。这种组合,使开发团队不受时间地域限制,合作伙伴分散全世界,且团队大小没有上限,因此 Open Source 才能集合世界各地高手,不断地薪火相传、不断地推出高品质的自由软体。 不过,CVS 初期上手不易,但若能以功能需求导向(我想要做这个,如何办到呢?)的方式来学习,可能也不是那麽困难。 本讲义,全部在 text console 模式下操作,但不代表您也必须用这种模式,您可以选用您喜爱的任何一种有支援 CVS 的编辑器或 CVS 操作环境(比如 WinCVS)。不过,您必须先了解 CVS 各种操作的涵意,这样观念才会清楚,才能确切掌握 CVS,和大家共同开发时,才能顺利愉快增进效率。一但您熟悉 console 模式之後,欲转换到其它环境,皆能有清晰的观念基础。 本文原为校园自由软体学务系统(sfs)合作开发伙伴而写的讲义,为免影响 sfs3 正式的系统(91/10开始),本文是以 xxx.yyy.edu.tw 中旧的 sfs2 专案为例子。往後您只要把出现 sfs2 的地方,改成 sfs3 或其它专案的名称,即可套用到其它专案。 注:C V S 不是 C S V !! 前者为版本控制系统,後者则是一种将每一列栏位用逗点分开的文件档案格式。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值