Chinaunix首页 | 论坛 | 博客
  • 博客访问: 66926
  • 博文数量: 7
  • 博客积分: 450
  • 博客等级: 下士
  • 技术积分: 120
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-10 10:02
文章分类
文章存档

2010年(3)

2009年(1)

2008年(3)

我的朋友

分类: LINUX

2009-08-02 14:33:57

Steps:

Step 1: 确认CVS是否安装?

         #rpm –qa cvs

Step 2: 如果没有安装,请使用如下命令进行安装

         #yum install cvs

Step 3: 安装xinetd

         #yum install xinetd

Step 4: 编辑/etc/xinetd.d/cvs文件,我将我的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

server_args   =-f

--allow-root=/home/cvsroot/project1 --allow-root=/home/cvsroot/project2 --allow-root=/home/cvsroot/project3 --allow-root=/home/cvsroot/project4

pserver

#   bind          = 127.0.0.1

    log        = /var/log/cvslog

}

 

Step 5: CVS服务器建立用户和组群

         #useradd –M cvsuser

         #groupadd cvsadmin

Step 6: 创建project1仓库

         #export CVSROOT=/home/cvsroot/project1

         #mkdir $CVSROOT

         #chmod 755 $CVSROOT

         #chgrp -R cvsadmin $CVSROOT

         #touch $CVSROOT/locks

         #cvs init

         #cd /root

         #cvs checkout CVSROOT

Step 7: project1创建使用者

         #htpasswd -d -c /home/cvsroot/project1/CVSROOT/passwd user1

         #htpasswd -d /home/cvsroot/project1/CVSROOT/passwd user2

Step 8: project1中编辑CVSROOT/config文件,我将我的cvs文件粘贴如下

# Set this to "no" if pserver shouldn't check system users/passwords

SystemAuth=no

 

# Set `IgnoreUnknownConfigKeys' to `yes' to ignore unknown config

# keys which are supported in a future version of CVS.

# This option is intended to be useful as a transition for read-only

# mirror sites when sites may need to be updated later than the

# primary CVS repository.

#IgnoreUnknownConfigKeys=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=yes

 

# 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

#cvs commit CVSROOT/config

Step 9: project1中编辑CVSROOT/cvswrappers文件,我将我的cvs文件粘贴如下

# This file affects handling of files based on their names.

#

# The -m option specifies whether CVS attempts to merge files.

#

# The -k option specifies keyword expansion (e.g. -kb for binary).

#

# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)

#

#  wildcard   [option value][option value]...

#

#  where option is one of

#  -f      from cvs filter      value: path to filter

#  -t      to cvs filter     value: path to filter

#  -m      update methodology   value: MERGE or COPY

#  -k      expansion mode       value: b, o, kkv, &c

#

#  and value is a single-quote delimited value.

# For example:

#*.gif -k 'b'

*.gif -k 'b'

*.tga -k 'b'

*.bmp -k 'b'

*.psd -k 'b'

*.tif -k 'b'

*.png -k 'b'

*.iff -k 'b'

*.aiff -k 'b'

*.obj -k 'b'

*.dat -k 'b'

*.exe -k 'b'

*.com -k 'b'

*.dll -k 'b'

*.dsw -k 'b'

*.dsp -k 'b'

*.lwo -k 'b'

*.lws -k 'b'

*.p -k 'b'

*.ico -k 'b'

*.frx -k 'b'

*.class -k 'b'

*.jar -k 'b'

*.zip -k 'b'

*.lzh -k 'b'

*.lha -k 'b'

*.rar -k 'b'

*.arj -k 'b'

*.arc -k 'b'

*.avi -k 'b'

*.mov -k 'b'

*.asf -k 'b'

*.smk -k 'b'

*.jpg -k 'b'

*.mpg -k 'b'

*.swf -k 'b'

*.frx -k 'b'

*.fli -k 'b'

*.flc -k 'b'

*.tiff -k 'b'

*.bin -k 'b'

*.dat -k 'b'

*.wad -k 'b'

*.ppt -k 'b'

*.pdf -k 'b'

*.3ds -k 'b'

*.max -k 'b'

Step 10: 重复Step6Step9所有步骤,为project2project3project4配置仓库及其相关设置。

Step 11: 重启xinetd服务

           #/etc/init.d/xinetd restart

Step 12: 测试CVS是否配置成功

           #export CVSROOT=:pserver:user1@127.0.0.1:/home/cvsroot/project1

           #cvs login

           如果验证通过,则表示Project1的配置成功。重复Step12所有操作以完成对project2project3project4的所有测试。

Issues 1: 客户机不能连接CVS服务器?

            可先将iptables关闭:#service iptables stop

            而后重复Step12相关操作,如果能连接,表示iptables没有配置。

Issues 2: 如果配置iptablesCVS请求通过?

           增加下列语句于文件/etc/sysconfig/iptables最后:

           -A RH –Firewall-1 –INPUT –s $SERVER-IP –p tcp –dprot 2401 –j ACCEPT

           重启iptables服务:service iptables restart

 

阅读(1703) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-28 19:06:23

Thanks a lot for you article about how to install cvs in fedora 11, it is very helpful,but i think there is something should be modified as followed: 1) useradd cvsuser 后没有起作用。 要在htpasswd手工添加 user1:encry passwd:cvsuser 2) 最后把目录下所有内容改为 owner cvsuser 的和 组 cvsadmin的 chown -R cvsuser /home/cvsroot/project1 chgrp -R cvsadmin /home/cvsroot/project2 如有不妥之处请指正 my mail: r_jiuchun&126.com