1、安装CVS
首先确定系统中没有安装CVS,如果没有则安装:<br>
yum install cvs
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=/var/cvs
server_args = -f --allow-root=/shanmin/cvs pserver
# bind = 127.0.0.1
}
4、初始化cvs服务
cvs -d /shanmin/cvs init
注:这个路径要和/etc/xinetd.d/cvs中的一致,并且可以随便根据自己的需要定制.
5、增加用户
groupadd cvs
useradd cvsroot -g cvs
6、设置目录权限
chmod 777 /shanmin/cvs
7、修改/shanmin/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、增加/shanmin/cvs/CVSROOT/passwd文件
[root@fc6 CVSROOT]# cat passwd
shanmin:woXRXXMqwnmWs:cvsroot
注:这个密码文件中第2段是md5的密码。多个用户为每行一个.
9、增加/shanmin/cvs/CVSROOT/readers文件
这个文件中存储着所有只读用户的用户名,一行一个.
10、增加/shanmin/cvs/CVSROOT/writers文件
这个文件中存储着所有可写权限的用户名,一行一个.
注:同一个用户不要在/shanmin/cvs/CVSROOT/readers和/shanmin/cvs/CVSROOT/writers中都填写,如果都填写则以/shanmin/cvs/CVSROOT/readers中的为准。
11、关闭SELinux
[root@~]#setenforce 0
注:CVS和SELinux有“冲突”,必须关闭,不然客户端会提示没有权限。
12、启动服务
service xinetd start
13、防火墙开2401端口
14、服务端安装完成。