Monday, May 14

How-To: CentOS 4.4 CVS Server Setup

install centos 4.4 servercd
(no firewall, no selinux, all other automatic)

# rpm --import /usr/share/rhn/RPM-GPG-KEY*

Look for cvs services listed in /etc/services
# grep cvs /etc/services

cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
cvsup 5999/tcp CVSup # CVSup file transfer/John Polstra/FreeBSD
cvsup 5999/udp CVSup # CVSup file transfer/John Polstra/FreeBSD
# yum install cvs

Create a CVS user and group.
# useradd cvs
# passwd cvs

Create, setup and own cvsroot directory
# mkdir /usr/local/cvsroot
# cvs -d /usr/local/cvsroot init
# chown cvs:cvs /usr/local/cvsroot

Set default CVSROOT
# vi /etc/profile
Append following line:
export CVSROOT=/usr/local/cvsroot
And load it into the shell
# . /etc/profile

Add /etc/xinetd.d/cvspserver and make it look as follows:
# vi /etc/xinetd.d/cvspserver
service cvspserver
{
disable = no
socket_type = stream
wait = no
user = cvs
group = cvs
log_type = FILE /var/log/cvspserver
protocol = tcp
env = '$HOME=/usr/local/cvspserver'
log_on_failure += USERID
port = 2401
server = /usr/bin/cvs
server_args = -f --allow-root=/usr/local/cvsroot pserver
}
Restart xinetd:
# service xinetd restart
You can check /var/log/messages file for relevant error messages.

Adding CVS (and cvs-only!) users and CVS passwd file
# su - cvs
$ htpasswd -cb /usr/local/cvsroot/CVSROOT/passwd uname1 pwd
$ htpasswd -b /usr/local/cvsroot/CVSROOT/passwd uname2 pwd
Add the local cvs user to the cvs user mapping:
$ vi /usr/local/cvsroot/CVSROOT/passwd
uname1:enc-passwd:cvs
uname2:enc-passwd:cvs
Sources: taursys, cvsd faq, hackorama, cyberciti