Cvs server configuration and client usage

Source: Internet
Author: User

You can find a lot of such questions on the Internet. The following is my own process.

The operating system of my CVS server is RedHat 9.0, and the client is tested on Windows XP and another RedHat 9.0 respectively. Both RedHat 9.0 computers use the CVS 1.11.2 on the CD. In Windows XP, CVS 1.11.14 is used, which is http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-14.zip.

CVS server configuration

Server Configuration means to start the corresponding service on the computer as the server. The following are all the operation steps. The CVS info document provides the most complete and detailed explanation.

Step 1:

Check whether CVS is installed. Enter # rpm-Qa CVS in shell. If you find that CVS is not installed, enter the redhat9 installation disk, enter the command # Find-name "CVS *", find the cvs rpm installation package, and install CVs.

Step 2:

Write the configuration file of the cvspserver. Enter/etc/xinetd. d/to create the cvspserver file. The content is as follows:

Service cvspserver

{

Flag = Reuse

Port = 2401

Disable = No

Socket_type = stream

Wait = No

User = root

ENV = home =

Server =/usr/bin/CVS

Server_args =-f -- allow-root =/cvsroot pserver

}

Note: Xinetd is an extended Internet service daemon ). For more information, see the xinetd man manual. In the xinetd. conf man manual, you can also find the detailed Syntax of its configuration file. In the cvspserver file created above, braces must be a single line with spaces around the equal sign. This is not a style issue, but a syntax requirement for the xinetd service configuration file. Check the/etc/xinetd. conf file to learn more. The service name following the service in the file must appear in the/etc/services file. Therefore, Step 3:

Step 3:

Check whether the cvspserver service exists in/etc/services. Open the/etc/services file and use the CVS keyword to search. If the following two lines are found:

Cvspserver2401/tcp # CVS client/server operations

Cvspserver2401/udp # CVS client/server operations

. If not found, add them manually.

Step 4:

Restart the xinetd service. Use # service xinetd restart or #/etc/rc. d/init. d/xinetd restart.

Step 5:

Enter the command # netstat-L | grep cvs. You can see the following line:

TCP 0 0 *: cvspserver *: * listen

If not, it may be a firewall problem. Enter # setup, select customize in firewall configuration, and open port 2401. At this point, the cvspserver service has been started. The following task is to initialize the repository of CVs and set the access permission. Enables users to use CVS over the network.

Step 6:

Create a Group to use the CVS service and add a new member to the group.

# Groupadd CVS

# Useradd-g cvs cvsroot

Step 7:

Initialize the root directory of the CVS document:

# Mkdir/cvsroot

# CVS-D/cvsroot init

The cvsroot directory is generated under/cvsroot.

Step 8:

Assign a user name. These usernames are the users of the CVS server, not the operating system users on the server computer. For details, see the CVS info document. CVS user information is stored in the passwd file under the cvsroot directory. This file needs to be created manually:

# Emacs/cvsroot/passwd

Format:

CVS User name: Password (optional): System User Name (optional)

Indicates that after a CVS user logs on, it is equivalent to the permission of the specified system user. For example, the username is grid and the password is grid216. Add the following line to the passwd file:

Grid: gmnn. vqtuzjlm: cvsroot

The ciphertext of the password can be generated using the following program.

# DEFINE _ xopen_source

 

# Include <stdio. h>

# Include <time. h>

# Include <unistd. h>

 

Int main (int argc, char ** argv ){

Char salt [4];

 

If (argc! = 2 ){

Perror ("usage: passgen passwordtext ");

Exit (1 );

}

 

Srand (time (0 ));

Sprintf (salt, "% c", rand () % 26 + 'A', rand () % 26 + 'A ');

Printf ("% s/n", crypt (argv [1], salt ));

Return 0;

}

 

Run the gcc-lcrypt passgen. c-o passgen command to compile the connection.

Then execute:

#./Passgen grid216

The ciphertext of the password is generated.

In this case, you can access the CVS server from the client.

On the client (linux redhat9 ):

Step 1:

You do not need to set environment variables. However, it is inconvenient to enter a long root directory of the server document each time. Therefore, it is very convenient to set the CVSROOT environment variable:

# Export CVSROOT =: pserver: grid@192.168.0.7:/cvsroot

In this case, you need to reset the next time you log on to the environment. It can be as follows:

# Emacs ~ /. Bash_profile

Then add the following in. bash_profile:

Export CVSROOT =: pserver: grid@192.168.0.7:/cvsroot

Load it again to make it take effect:

# Source ~ /. Bash_profile

Step 2:

Log on to the CVS server:

# Cvs login

The system prompts you to enter the password. If no error message is displayed after you enter the password, the logon is successful.

 

In windows xp client:

D:/cvs> set CVSROOT =: pserver: grid@192.168.0.7:/cvsroot

D:/cvs> cvs login

Logging in to: pserver: grid@192.168.0.7: 2401/cvsroot

CVS password:

 

D:/cvs>

In this way, the logon is successful.

 

Create a new folder named MyCode on the client. Used to demonstrate the use of CVS. Use the windows xp client.

D:/cvs> cd ..

D:/> path d:/cvs; % path %

D:/> mkdir MyCode

D:/> cd MyCode

Create a code file test. c:

# Include <stdio. h>

 

Int main (){

Printf ("Initial Edition ");

Return 0;

}

 

Import project:

D:/MyCode> cvs import-m "Initial Edtion" MyCode vendor-tag release-tags

N MyCode/test. c

 

No conflicts created by this import

In this case, the/cvsroot directory on the server has an additional MyCode directory. This MyCode on the client does not work at this time. You can delete it. Delete the MyCode directory of the client.

 

Check out a project:

D:/> cvs co MyCode

Cvs server: Updating MyCode

U MyCode/test. c

 

Modify one and check in again:

Modify test. c:

# Include <stdio. h>

 

Int main (){

Printf ("Initial Edition ");

Printf ("Added in Second Edition ");

Return 0;

}

Check in a project:

D:/MyCode> cvs ci-m "second edition" test. c

Checking in test. c;

/Cvsroot/MyCode/test. c, v <-- test. c

New revision: 1.2; previous revision: 1.1

Done

Delete local working copy:

D:/MyCode> cd ..

D:/> cvs release-d MyCode

You have [0] altered files in this repository.

Are you sure you want to release (and delete) directory 'mycode': n

** 'Release' aborted by user choice.

The preceding answer n does not delete working copy.

Submit with the specified version number:

D:/MyCode> cvs ci-m "commit with given version number"-r 2.0 test. c

Checking in test. c;

/Cvsroot/MyCode/test. c, v <-- test. c

New revision: 2.0; previous revision: 1.2

Done

 

In addition, some people on the Internet introduced the use of wincvs and toris cvs. I downloaded wincvs and tried it for a while. I think the interface is complicated and it is not as concise as it is used in command lines. For wincvs, visit http://wincvs.uptodown.com/en/free-download /. Running wincvs requires python support. Therefore, you also need to install python. You can download python at http://www.python.org.

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.