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.

11 thoughts on “How to configure CVS server in Red Hat Linux”

  1. /usr/local/myproject: no such repositry

    I am showing like that error so can any one help me what's the reason

    ashish.laxkar16[at]gmail.com please suggest me also in mail box...

    Reply
  2. If you are using my post as your example then please crosscheck your configuration as I have used /usr/local/myprojects as my repository which is "myprojects" and not "myproject"

    Reply
  3. Hi

    After installation i received below the error message.

    cvs [login aborted]: connect to localhost:2401 failed: Connection refused

    could you help me.. it's work past few weeks but suddenly stopped.

    Reply
  4. I'm getting below the error message.

    cvs [login aborted]: connect to localhost(127.0.1.1):2401 failed: Connection refused

    Could you help me to fix this issue.

    Reply
  5. Hi make sure cvs server on port 2401 is running
    # server xinetd status

    # netstat -ntlp | grep 2401

    and secondly check your firewall and selinux. In case you want to allow cvs server

    # iptables -I INPUT -p tcp --dport 2401 -j ACCEPT
    # iptables -I INPUT -p udp --dport 2401 -j ACCEPT

    Follow the below link for more info on selinux guide for cvs server
    access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-Concurrent_Versioning_System-Configuration_Examples.html

    Thanks and Regards
    Deepak

    Reply
  6. Hi Deepak,
    This document is really helpful. I would like to know one more case . How to configure the the Linux CVS repository like WindowsCVSNT repository configuration. eg. repository path, name and description

    Reply
  7. Hello Namitha, I have not worked on Windows CVSNT so I might not be much aware in terms of your question but we do provide a repo path /usr/local/myprojects and servername can be provided in hosts file or a DNS can be used instead of using IP address in Linux .. I know I do not sound much helpful but that is all the info I have at the moment.

    Thanks

    Reply
  8. Hello Team,
    I m working on CVS Installation in one of our QA environment and seems thr is one issue we came across.
    When we set SELINUX (selinux=permissive) then only we are able to login to the CVS and the default value for that is (selinux=restricted) and when default value is set we are unable to login to the CVS.

    I m curious is thr way to get the issue resolve without changing the selinux.

    Thanks
    Venkata S Sadhu

    Reply
  9. Hello,

    If you have a requirement to use selinux as restrictive then you will have to add selinux rule for your cvs configuration file. I am afraid I have not much experience in the selinux area (and specially for cvs server config) so you may have to ask some expert here who can guide.

    Thanks
    Deepak

    Reply
  10. Hello sir
    this is raj when i configured cvs server on centos 7, i have following issue
    cvs -d :pserver:usr2@192.168.1.15:/home/cvs login
    Logging in to :pserver:usr2@192.168.1.15:2401/home/cvs
    CVS password:
    /home/cvs: no such repository

    Reply

Leave a Comment