Install the CVS server in Linux

Source: Internet
Author: User
1. Install the CVS server:

1. Check whether CVS is installed on your operating system:
#>; Rpm-Qa | grep CVS

If you have not installed the package, you can find it on the RedHat 2nd discs and download the latest RPM package from the Internet. It is easy to find out, but there is actually no Linux version.

2. Create a CVS user group:

#>; Groupadd CVS

3. Create the cvsroot user and directory of the CVS group:

#>; Useradd-g cvs-D/home/cvsroot

4. Add a password for the cvsroot User:

#>; Passwd cvsroot

5. Change the Directory attribute of/home/cvsroot:

#>; Chmod-r 770/cvsroot

6. Change the user login identity:

#>; Su cvsroot

7. Start to create a single project:

#>; CD/home/cvsroot

8. start to build a warehouse:

#>; CVS-D/home/cvsroot/project1 init
#>; CVS-D/home/cvsroot/project2 init

9. Create the CVS Service Startup File. We use the xinetd method:

#>; [Crtl] + [d] switch to the root user identity
#>; CD/etc/xinetd. d
#>; VI cvspserver

Service cvspserver
{
Disable = No
Flags = Reuse
Port = 2401
Socket_type = stream
Protocol = TCP
Instances = 120
Wait = No
User = root
Passenv = path
Server =/cvsroot/CVS. Sh
ENV = home =/cvsroot
# Server_args =-f -- allow-root =/cvsroot/client/src -- allow-root =/cvsroot/client/bin -- allow-root =/cvsroot/client/wjqbook pserver
Log_on_failure + = userid
# Bind = 127.0.0.1

The content of the CVS. Sh file in the/cvsroot/directory is as follows #! /Bin/bash
/Usr/bin/CVS-f -- allow-root =/cvsroot/client/src -- allow-root =/cvsroot/client/bin -- allow-root =/cvsroot/client/ doc -- allow-root =/cvsroot/client/RES -- allow-root =/cvsroot/client/lib -- allow-root =/cvsroot/client/obj -- allow-root =/ cvsroot/client/other -- allow-root =/cvsroot/client/yanghaichunbook -- allow-root =/cvsroot/client/zhujinlinbook -- allow-root =/cvsroot/client/yangqubook -- allow -Root =/cvsroot/client/chenmengbook -- allow-root =/cvsroot/client/limengjiebook -- allow-root =/cvsroot/client/liyaobook -- allow-root =/cvsroot/client /wangxiguobook -- allow-root =/cvsroot/client/weijianquanbook -- allow-root =/cvsroot/client/zhangshuchengbook -- allow-root =/cvsroot/art/role -- allow-root = /cvsroot/art/scene -- allow-root =/cvsroot/art/animation -- allow-root =/cvsroot/art/initialpic -- allow-root =/cvsroot/art/handsetgame -- allow-root =/cvsroot/Server/mbssrc -- allow-root =/cvsroot/Server/mbsdoc -- allow-root =/cvsroot/Server/mbsdbsrc -- allow-root =/cvsroot/ server/mbslib -- allow-root =/cvsroot/Server/mbsbin -- allow-root =/cvsroot/Server/kartssrc -- allow-root =/cvsroot/Server/kartsdbsrc -- allow-Root =/cvsroot/Server/kartsdoc -- allow-root =/cvsroot/Server/kartslib -- allow-root =/cvsroot/Server/kartsbin -- allow-root =/cvsroot/Server/zhangshanbook -- allow-root =/cvsroot/Server/zhengjunbook -- allow-root =/cvsroot/Server/liqinghuibook -- allow-root =/cvsroot/Server/wenliangbook -- allow-root =/cvsroot /Server/yangcaigaobook -- allow-root =/cvsroot/Server/weiluebook -- allow-root =/cvsroot/Server/other -- allow-root =/cvsroot/Server/sharebook -- allow-Root- root =/cvsroot/Server/jiangweibook -- allow-root =/cvsroot/Server/kartsclient -- allow-root =/cvsroot/Server/zhangshuchengbook -- allow-root =/cvsroot/Server/ zhangwenxinbook -- allow-root =/cvsroot/Server/caojianpingbook -- allow-root =/cvsroot/design/mmorpggame -- allow-root =/cvsroot/design/racegame -- allow-root =/ cvsroot/design/handsetgame -- allow-root =/cvsroot/design/linwanlibook -- allow-root =/cvsroot/design/liangyuyebook -- allow-root =/cvsroot/design/jiangziyubook -- allow -Root =/cvsroot/design/zengjistmk -- allow-root =/cvsroot/design/public -- allow-root =/cvsroot/RPG/src -- allow-root =/cvsroot/RPG /doc -- allow-root =/cvsroot/RPG/RES -- allow-root =/cvsroot/RPG/bin -- allow-root =/cvsroot/RPG/lib -- allow-root = /cvsroot/RPG/obj -- allow-root =/cvsroot/RPG/other -- allow-root =/cvsroot/RPG/yangjingbook -- allow-root =/cvsroot/RPG/zhangwenxinbook -- allow-root =/cvsroot/RPG/chenmengbook -- allow-root =/cvsroot/RPG/limengjiebook -- allow-root =/cvsroot/RPG/wangxiguobook -- allow-root =/cvsroot/ engine/include -- allow-root =/cvsroot/engine/Library -- allow-root =/cvsroot/engine/enginebook -- allow-root =/cvsroot/engine/game -- allow-Root =/cvsroot/engine/chendaweibook -- allow-root =/cvsroot/engine/chenyibook -- allow-root =/cvsroot/engine/xiangshushubook -- allow-root =/cvsroot/engine/tianzhaohuibook -- allow-root =/cvsroot/engine/source pserver

Note: Due to the length limit of xinetd server_args, you can do this when you want to run many single warehouses:

#>; VI cvspserver

Service cvspserver
{
Disable = No
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/home/cvsroot/CVS. Run
Log_on_failure + = userid
}

Compile the CVS. Run script

#>; VI/cvsroot/CVS. Run

#! /Bin/bash
/Usr/bin/CVS-f -- allow-root =/home/cvsroot/project1 -- allow-root =/home/cvsroot/project2 pserver

#>; Chmod + x/home/cvsroot/CVS. Run

10. Join the CVS service:

#>; VI/etc/services

Cvspserver 2401/tcp # pserver CVS Service
Cvspserver 2401/udp # pserver CVS Service

11. Start the CVS service:

#>;/Etc/init. d/xinetd restart
Note: If the corresponding startup command cannot be found here, it must be that xinetd is not installed. Go to your Linux installation disk and find the file to install it. Then you can run this command. I did not install it, I found this file on 3rd disks and installed the file to run it. the RPM file name can be installed.
12. Check whether the cvspserver service has been started:

#>; Netstat-L | grep cvspserver
The following results should be returned:

TCP 0 0 *: cvspserver *: * listen

Ii. User Management of the CVS service:

We have already created two CVS repositories, project1 and project2. Next we will create CVS users for the two repositories respectively.

13. Create a user name and password that can log on to the CVS server:

#>; Su cvsroot
#>; VI/home/cvsroot/project1/cvsroot/passwd

Trotter: *****: cvsroot
MIMI: *****: cvsroot

#>; VI/home/cvsroot/project2/cvsroot/passwd

Trotter: *****: cvsroot
GARY: *****: cvsroot
(Note: *** it must be an encrypted password. It is not an encrypted password and is not recognized by the system. Therefore, you must encrypt the following encrypted file)
These two files mean three CVS users: Trotter, Mimi, and Gary. Mimi has project1 permission, Gary has project2 permission, and Trotter has
Permissions for Project 1 and project 2. After login, the permission is cvsroot.

Note: The CVS users and system users here are different.

14. ***** is the password generated by the following files:

#>; 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 //", Eval $ randletter, Eval $ randletter );
My $ plaintext = shift;
My $ crypttext = crypt ($ plaintext, $ salt );
Print /// "$ {crypttext}
////";

#>; Chmod A + x/home/cvsroot/passwd. pl

15. If you want to generate a password of "123456", then:

#>;/Home/cvsroot/passwd. pl // "123456 ////"

Press enter to obtain the encryption password, and use it to replace ***** in the passwd file *****

16. OK. CVS has been fully installed. If you want a user to have project1 permissions, you can give it to/home/cvsroot/project1/cvsroot/passwd.
If you want a user to have both project1 and project2 permissions, you can add/home/cvsroot/project1/cvsroot/passwd and
Add a user with the same user name and password to/home/cvsroot/project2/cvsroot/passwd. Finally, let's try it out:

#>; CVS-D: pserver: trotter@172.30.5.107:/home/cvsroot/project1 Login
(Note:/home/cvsroot/project1 is the path of the database you have created. It must be the same as the path under server_args in the cvspserver file. Otherwise, an error will occur)
After you press enter, the system prompts you to enter the Trotter password. You can enter it according to your own password. If no error message is displayed, the password is successful (my machine IP address is 172.30.5.107)

This is used for testing in Linux. For testing in windows, I have a tool named wincvs. You can also try it out, which is quite useful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.