Chinaunix首页 | 论坛 | 博客
  • 博客访问: 379948
  • 博文数量: 120
  • 博客积分: 5051
  • 博客等级: 大校
  • 技术积分: 1255
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-03 01:25
文章分类

全部博文(120)

文章存档

2011年(2)

2010年(11)

2009年(28)

2008年(26)

2007年(53)

我的朋友

分类: LINUX

2007-12-12 15:39:52

1)install cvs
 download cvs source package
 tar -jxvf cvs-1.11.22.tar.bz2
 cd cvs-1.11.22
 ./configure --prefix=/usr/local/cvs
 make
 make install

2)add cvs user
 groupadd cvs
 useradd -g cvs -d /home/cvsroot cvsroot
 password cvsroot

3)set cvs evn
 su - cvsroot
 vi .bash_profile  add
 CVSROOT=:pserver:cvsroot@localhost:/home/cvsroot
 export CVSROOT
 save and exit
 source .bash_profile

4)init cvs
 cvs -d /home/cvsroot init

5)start cvspserver
 vi /etc/services add
 cvspserver      2401/tcp                        # CVS client/server operations
 cvspserver      2401/udp                        # CVS client/server operations
 save & exit

 vi /etc/xinetd.d/cvspserver
 service cvspserver
{
disable = no
port = 2401
socket_type = stream
wait = no
user = root
server = /usr/local/cvs/bin/cvs
server_args = -f --allow-root=/home/cvsroot  pserver
protocol = tcp
}

save and exit

chmod +x /etc/xinetd.d/cvspserver

check if port 2401 is open,is result like this,2401 is open
netstat -l|grep cvspserver
tcp        0      0 *:cvspserver                *:*                         LISTEN

6) cvs configuration

 6.1)add cvs user
     vi /home/cvsroot/CVSROOT/passwd (this file is not exist originally)
     username:password:cvsroot
     save and exit

     the above password produced by one of followimg methord:

     a)use apache htpasswd
     cd /home/cvsroot/CVSROOT
     input shell command as this:
     [root@abc ~]# /usr/local/apache2/bin/htpasswd -c password cvsroot
     New password:  (input password,and you will use this password to login cvs)
     Re-type new password: (retype password )
     Adding password for user cvsroot

     the above command will produce a file named passwd in the /home/cvsroot/CVSROOT
     vi passwd and at the end of file add cvsroot (refer following example)
     modify 'cvsroot:xxxxx' as 'cvsroot:xxxxx:cvsroot'
     save and exit

     b)you could use this script to produce password:
     vi /home/cvsroot/passwd.pl
     #!/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}
     ";
     save and exit

     cd /home/cvsroot and input shell command as :
     ./passwd.pl "123456"(123456 is your cvs login passwor)
     the above command will produce an encrypt password as xxxx,copy this password
     then vi /home/cvsroot/CVSROOT/passwd
     username:xxxx(paste the passwd):cvsroot  (fox example:  haili:xxxxx:cvsroot)
     (xxxx is password produced by the above script passwd.pl)

     you could add user as this:
     haili:xxxxx:cvsroot
     henry:xxxxx:cvsroot
     ally:xxxxxx:cvsroot

    so ,you could login cvs as:
    cvs -d :pserver:username@localhost:/home/cvsroot login
    (exmple:cvs -d :pserver:haili@localhost:/home/cvsroot login)
    if no error info return ,you have login cvs.

 6.2)user priviledge config:
     read priviledge:
     vi /home/cvsroot/CVSROOT/readers (you should create this file by youself)
     username1
     username2
     username3
     save and exit

     write privilege:
     vi /home/cvsroot/CVSROOT/writers (create this file by youself)
     username1
     username2
     username3
     save and exit

    Attention please: the user who in the file of reader will not be given the write priviledge.


7)cvs command(cvs --help-commands will display all cvs command)

  cvs import
  cvs import -m "comment messege" projectname vision start
  cvs import -m "init version" creasian v-0-0-0 start

  cvs checkout
  cvs checkout projectname
  cvs checkout creasian

  cvs commit
  cvs commit -m "commmet" filename
  cvs commit -m "comment" links.inc.php

  cvs update
  cvs update projectname

  cvs status
  cvs status projectname

  cvs add
  cvs add filename(or directory)

  cvs remove
  cvs remove filename(or directory)

  cvs diff

  cvs log

  cvs -q tag xxx-20070411

阅读(1517) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~