2008-01-24

HOWTO: Set Up a CVS Repository Server under Linux

Since I want to use CVS as my project version control system, I decide to set up a CVS server on a Linux box.

I try to follow the instruction from [HOW-TO Install and Configure a CVS Repository Server] to get my work done, but there are so many problems happened.

First of all, the Linux is an old SuSE Linux distribution. CVS is already installed on the machine, which can be checked in the graphical config tool "yast" or "yast2".

Since I don't want to specify the passwords for every cvs user, it's better if the cvs server can use the users of the Linux sytem. It can be achieved by adding a line in the /config file.

Assumed that you create a repository in the directory /usr/local/cvsroot with the command:
cvs -d /usr/local/cvsroot init
then CVS will create a directory /CVSROOT under /usr/local/cvsroot. The config file of cvs is right in /usr/local/cvsroot/CVSROOT/. Open it and find a line like:

#SystemAuth=no
change it to

SystemAuth=yes
Then CVS knows you want to use the password of the users from the system.

I intend to use the machine as a CVS Repository Server, that means, the repository should be accessed remotely.

In order to do that, the cvs pserver should listen to the port 2041, which is enabled by inetd or xinetd. Since both are not existed in my system, I download the xinetd from its website.

After extract the downloaded source, you can use the command

tar -xvf xinetd-version.tar.gz
to extract the source codes.

Change your current path to ./xinetd-version, then just execute the following commands to install xinetd:

./configure
make
make install
cp xinetd/sample.conf /etc/xinetd.conf
cp xinetd/xinetd /etc/init.d/
Modify the file /etc/xinetd.conf so that it will run the cvspserver automatically:

service cvspserver
{
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /usr/bin/cvs
server_args = --allow-root=/usr/local/cvsroot pserver -f
}

Now start xinetd with
/etc/init.d/xinetd
After such a long long process, the CVS server should be running on the machine now. You can verify it by:

cvs -d :pserver:username@localhost:/usr/local/cvsroot login

I must say, it's somehow frustrated to set up such a CVS server if you find there are so much difficult on your way. :(

No comments: