twitter
    Find out what I'm doing, Follow Me :)

Thursday, April 8, 2010

CVS and cvsWEB

 
CVS how to
------------------------------
OS: CENTOS
1. install xinetd server using
# yum install xinetd
2. install cvs
# yum install cvs
3.vim /etc/xinetd.d/cvs
------------------------------------------------------------------
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=/var/cvs pserver
#       bind                    = 127.0.0.1
}
------------------------------------------------------------------
Note: by default this cvs service is disabled. you need to enable it by change "no"

4.initialized repository according to the path you want using below command
# cvs -d /var/cvs/ init
5.start xinedd server
#/etc/init.d/xinetd start
6.test cvs server is running using following command
# netstat -tap | grep cvs
tcp        0      0 *:cvspserver                *:*                         LISTEN      13496/xinetd
 
7.Cvs allows the user to add user independently of the underlying OS intallation.. Im going to add user for cvs using OS level
# useradd -G cvs cvs
 
8.create file name random.pl and put in below code on it
---------------------------------------------------------------
#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand
(26)) + (int (rand (1) + .5)
% 2 ? 65 : 97))";
my $salt = sprintf ("%c%c",eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}\n";
--------------------------------------------------------------- 
use above random.pl to create cvs user password. To create encrypted password run below command
#./random.pl cvsadmin
copy and paste this password into passwd file in /var/cvs/CVSROOT/passwd

9.Create a text file in /usr/local/cvsroot/CVSROOT called passwd and enter the users as shown below (format is: userid:encrypted-password:cvs )
username1:x$5itFdsw123:cvs
username2:3fgRH4p3443:cvs

10.change owner and group of cvs repository and file to cvs
# chown -R cvs.cvs /var/cvs/

11.Set restrictive permissions on the file:
# chmod 400 /var/cvs/CVSROOT/passwd