How to configure CVS server in Red Hat Linux

From wiki CVS (Concurrent Versions System)uses a client–server architecture: a server stores the current version(s) of a project and its history, and clients connect to the server in order to "check out" a complete copy of the project, work on this copy and then later "check in" their changes. Typically, the client and server connect over a LAN or over the Internet, but client and server may both run on the same machine if CVS has the task of keeping track of the version history of a project with only local developers.

The following configuration has been tested on Red Hat Linux 5.x so if you are using different distribution then make sure you use relative command.

How to configure CVS server?

Make sure cvs package is installed in your machine.

# yum install cvs

Now the next thing which you have to do is create a project repository for your projects.

NOTE: Make sure that directory myprojects does not exist when you run the below command

# cvs -d /usr/local/myprojects init

The above command will create a new project repository with the name of "myprojects"

Now let us make some initial changes before starting the cvs server. Make sure your cvs file looks like as shown below.
# vi /etc/xinetd.d/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=/usr/local/myprojects pserver
bind                    = 192.168.0.138
}

Here 192.168.0.138 is the IP of my local machine where I am configuring my cvs server.

Add a new line in the last line
# vi /etc/services
cvspserver      2401/tcp                # CVS PServer

Restart the xinetd services

# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

Verify that the service is running and listening

# netstat -ntlp | grep 2401
tcp     0   0   192.168.0.138:2401      0.0.0.0:*   LISTEN      18337/xinetd

Now create a cvs user and assign any password for the project repository we created

# useradd deepak
# passwd deepak

Client login into CVS server

Syntax:
# cvs -d :pserver:user_name@server_name:/usr/local/myprojects login
# cvs -d :pserver:deepak@192.168.0.138:/usr/local/myprojects login

Another way to login

# export CVSROOT=:pserver:deepak@192.168.0.138:/usr/local/myprojects
# cvs login
Logging in to :pserver:deepak@192.168.0.138:/usr/local/myprojects
CVS password:

I hope the article was useful.