终于实现linux 下的cvs了


       重装了一次系统,重装了N次的cvs,终于让linux下的cvs理论上可以进行开发。

       还要感谢超少在忙VB时热心的做测试……

       虽然现在是凌晨3点整,还是得总结一下:

1、咱先把CVS装上吧

首先确定系统中没有安装CVS,如果没有则安装:
 yum install cvs   注:fedora中可以使用光盘安装,个人认为容易点哦


2、确认系统中是否安装xinetd,在Fedora 6中这个没有默认安装。如果没有安装则安装:
 yum install xinetd    注:这个我是用命令行在网上自动下载安装的,中间还出现了个错误,忽略了

3、修改/etc/xinetd.d/cvs

[root@fc6 CVSROOT]# cat /etc/xinetd.d/cvs
# default: off
# description: The CVS service can record the history of your source \
#              files. CVS stores all the versions of a file in a single \
#              file in a clever way that only stores the differences \
#              between versions.
service cvspserver
{
        disable                 = no
        port                    = 2401
        socket_type             = stream
        protocol                = tcp
        wait                    = no
        user                    = root
        passenv                 = PATH
        server                  = /usr/bin/cvs
#       env                     = HOME=/zyf/cvs
        server_args             = -f --allow-root=/zyf/cvs pserver
#       bind                    = 127.0.0.1
}

4、初始化cvs服务
 cvs -d /zyf/cvs init
 注:这个路径要和/etc/xinetd.d/cvs中的一致,并且可以随便根据自己的需要定制.

5、增加用户
 groupadd cvs
 useradd cvsroot -g cvs

6、设置目录权限
 chmod 777 /zyf/cvs

7、修改/zyf/cvs/CVSROOT/config文件
[root@fc6 CVSROOT]# cat config
# Set this to "no" if pserver shouldn't check system users/passwords
SystemAuth=no  注:这里默认是注释掉的。

# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs

# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no

# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOEFWUPCGMAR

# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg
# script to change the log message.  Set it to `stat' to force CVS to verify
# that the file has changed before reading it (this can take up to an extra
# second per directory being committed, so it is not recommended for large
# repositories.  Set it to `never' (the previous CVS behavior) to prevent
# verifymsg scripts from changing the log message.
#RereadLogAfterVerify=always

注:这个更改是为了用户验证的时候忽略系统用户,这样可以避免建立很多的系统帐户,而影响安全性。

8、增加/zyf/cvs/CVSROOT/passwd文件
[root@fc6 CVSROOT]# cat passwd
zyf:woXRXXMqwnmWs:cvsroot
注:这个密码文件中第2段是md5的密码。多个用户为每行一个.  这个密码真的不太好得到,每次都是建用户。

9、增加/zyf/cvs/CVSROOT/readers文件
 这个文件中存储着所有只读用户的用户名,一行一个.

10、增加/zyf/cvs/CVSROOT/writers文件
 这个文件中存储着所有可写权限的用户名,一行一个.
 注:同一个用户不要在/zyf/cvs/CVSROOT/readers和/shanmin/cvs/CVSROOT/writers中都填写,如果都填写则以/zyf/cvs/CVSROOT/readers中的为准。

11、关闭SELinux
 [root@~]#setenforce 0
 注:CVS和SELinux有“冲突”,必须关闭,不然客户端会提示没有权限。


修改/etd/services文件 ,加入以下内容:

cvspserver    2401/tcp            # CVS client/server operations
cvspserver    2401/udp            # CVS client/server operations

      cvs服务由inted来唤起,因此需要改动inetd提供的服务,我的redhat使用的是inetd 方式则在文件/etc/inetd.conf中加入如下的内容:cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/home/cvsroot pserver

  FC6使用的是xinetd方式,所以在xinetd.d目录下添加需要启动的服务:

  cd /etc/xinetd.d

  vi cvspserver

  文件内容:

  service cvspserver

  {

  disable = no

  flags = REUSE

  socket_type = stream

  wait = no

  user = root

  server = /usr/bin/cvs

  server_args = -f --allow-root=/home/cvsroot pserver

  log_on_failure += USERID

  }

  12.重新启动inetd或者xinetd:

  /etc/rc.d/init.d/xinetd restart

  13.检查cvspserver服务是否已经启动

  netstat -l |grep cvspserver

  结果如下:

  tcp 0 0 *:cvspserver *:* LISTEN

  以上结果全部通过,但是在客户机上执行

cvs -d :pserver:steven@192.168.211.72:/home/cvsroot login

  输入密码后,没有收到任何消息,即表示成功

  ^_^ no news is a good news!!

  在客户端,设置环境变量如下:

  export CVS_RSH=ssh

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

  你可以

  echo $CVS_RSH

  ssh

  echo $CVSROOT

  :pserver:username@ip:/home/cvsroot

  这样你在客户端就可以直接输入 cvs login登陆了

  其它操作都可以直接cvs command 了

12、启动服务
 service xinetd start

13、防火墙开2401端口   注:我是把防火墙关了。


  还要注意:writers一定要设置好权限,为了这个颇费了一阵子劲儿。





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值