cvs配置

1 安装cvs
#rpm -ih cvs-xx-xx-xx(xx是版本号)

或者是#apt-get install cvs

或者直接在网上找cvs的源码,自己编译安装

2 添加cvs组
#groupadd cvs

3 添加cvsroot
#useradd -g cvs -G cvs cvsroot (需要指定目录时在后面加-d /xxx)
#passwd cvsroot (设置cvsroot账号密码)

4 更改默认cvs代码目录(/home/cvsroot)属性
#su cvsroot
#chmod 771 /home/cvsroot
#su root

5 添加cvs组用户
#useradd -g cvs cvsuser1
#useradd -g cvs cvsuser2
#passwd cvsuser1
#passwd cvsuser2
(按照具体情况和要求添加CVS用户)
#vi /etc/group (modify)
cvs:x:105:cvsroot,cvsuser,cvsuser1

6 添加cvspserver配置文件

注意:这一步骤要求系统安装有xinetd.d服务,ubuntu下为apt-get install xinetd.d
#cd /etc/xinetd.d
#vi cvspserver

# cd /etc/xinetd.d
#vi cvspserver
service cvspserver
{
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /usr/bin/cvs
server_args = --allow-root=/home/cvsroot pserver
log_on_success +=USERID
log_on_failure +=USERID
disable =no
}

#vim /etc/services (add line)
cvspserver 2401/tcp #CVS client/server Operation
cvspserver 2401/udp #CVS client/server Operation

7 开启服务
#su root
#cd /home/cvsroot
#cvs init
#/etc/rc.d/init.d/xinetd restart
#cvs -d:pserver:cvsuser1@localhost:/home/cvsroot login (cvsuser1只是一个例子)
password:******
 
8 确定没有问题后,设置环境变量
#vi /etc/profile
添加
export CVSROOT=:pserver:$USER@localhost:/home/cvsroot

9 正常登陆
#cvs login
cvsuser password:******

10 导入项目
cvsroot 登陆
#cvs login
#cd /to/project_dir/ (进入代码所在目录第一层)
#cvs import -m "write some comments here" project_name vendor_tag release_tag

11 项目导出
#cvsuser登陆
#cvs login
#cvs co project_name

posted @ 2011-02-20 21:56  centimeter  阅读(217)  评论(0编辑  收藏  举报