2. Use LINUX as the CVS server

Source: Internet
Author: User
Article Title: LINUX is the second CVS server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Backup and movement of software libraries
  
The files in the backup software library are not different from those in other files, but you need a backup tool to lock CVS. in this way, you must register a user who can read the software library and open the CVS software library. You need to edit '# cvs. rfl' file.
  
When you want to use a backup soft database to restore the original database, if the original database has been changed after your backup, CVS will report an error. You must follow the steps below
  
? Get a new working directory
  
? Copy the last file that failed to be submitted (of course, the directory file of CVS cannot be copied)
  
? Working in the new directory, use commands such as cvs update or cvs diff to point out the changes that have been made, and save the changes to the software library using cvs commit.
  
It is easy to move a software library to other places. the simplest way is to create a new directory to the directory to be moved. if you want to re-use the original directory, you can only manually modify 'cvs/Repository 'and 'cvs/root'. Unless you are good at this, it is not recommended to use it.
  
4.2 remote user management of CVS
  
As a CVS server, two points should be met. ensure that the software library has sufficient space. second, ensure that there is no less than 32 MB of memory, the server generates two processes for each user connected to it, the cost of sub-processes is small. however, if the network bandwidth is not enough, the cost for the parent process is huge.
  
The other big expense is the diff file. When the source file is large, it also costs a lot to verify or detect it.
  
Logon authentication for remote users
  
Remote logon using rsh as an Example
  
When the Cvs server uses rsh to allow users to connect, it should be configured. rshosts: Assume that tom on the remote host tom.exsample.com needs to connect to the cvs server funame.simple.com. edit the bach directory on the server. rshosts.
  
Tom.exsample.com tom
  
Can the client run rsh? L bach funame.simple.com 'echo @ PATH
  
To determine whether you can connect to the CVS server, and the customer should write the displayed path to. bashrc or cshrc (instead of. logiin or. profile .)
  
In addition, the client can also define the environment variable CVS_SEVER. to define the host location. on the server side, modify/etc/ineted. the conf file to tell the server to run cvssever when obtaining a connection to a specific port. the default port number is 2041. of course, you can use the environment variable CVS_AUTH_PORT on the user end to stop setting every time you use it.
  
If the ineted of the client allows the original call, you only need to add the following sentence to the/etc/ineted. conf file to 2401 stream tcp nowait root/usr/local/bin/cvs? F? Allow? Root =/cvsroot pserver
  
You can also use the-T option to define the buffer directory.
  
-Allow? Root defines a software library that can be used by users. If there are more software libraries on the server, you need to re-use this sentence. In addition, internal users can define the environment variable CVSROOT.
  
: Transferve: usr@funam.simple.com:/cvsroot
  
Usr is the user name (in linux) funam.simple.com is the cvs server, and it is assumed that/cvsroot is the Directory Name of the software library. remote users can use the following format:
  
: Etx: Ver: usr@funam.silple.com:/cvsroot
  
: Etx: defined as a remote user.
  
If the customer's ineted is generally called, add the following sentence to/etc/seveice:
  
Cvspsever 2401/tcp
  
Restart ineted to read the initialization file.
  
CVS manages users. by default (for example, telnet login), the user name and password are the same as those in linux. that is, as long as you log on to the linux system, you have the read-only permission of $ CVSROOT .. of course, developers of a software must have the permission to read and write the corresponding directories to complete source code upgrade and other work. therefore, CVS also provides its own user authentication system to facilitate user management.
  
There can be a passwd file under $ CVSROOT/CVSROOT on the server (which can be defined using the environment variable CVS_PASSFILE .) to record the user information of cvs. it adopts the same organizational form as linux etc/passwd. similarly, its passwold is encrypted in linux Standard. the following is the content of a passwd.
  
Anyone:
  
Tom: xyzkue
  
Mary: yuio: pubcvs
  
The first line means that no password is required when you log on as anyone. even if the string is empty. of course, in this way, you may only get read-only permission. the second line indicates that tom needs to input passwold during logon. the passworld is encrypted with xyzkue. after logging on in this way. generally, you can obtain higher permissions.
  
The third line indicates that you need to enter the password when logging on to mary. enter the same software library as the System user. this is because. cvs records all the actions of its users in the software library. define different identities from system users. use cvs.
  
For example, you can use tom to log on as follows:
  
$ Cvs? D: etx: tom@funam.simple.com:/cvsroot login
  
(If the user name tom can have the same name inside the remote end, tom @ can also be omitted)
  
In addition, you can use cvs loginout to cancel all environment variables.
  
Access using GASSAPI
  
CVS also supports TCP direct access using the GASSAPI. before using the security switch, you need to re-compile the CVS to obtain the support for the GASSAPI. How can I use it? With? You can use the-a method to connect to the API.
  
However, during login, You need to redefine $ CVSROOT, for example:
  
$ Cvs? D: gsever: usr@cvssever.com:/cvsroot login
  
Use kerberos for Direct Connection
  
The simplest method to use rsh is described above. The main feature of this method is that all data passes through an additional program. It is very time-consuming. If kerberos is installed, you can directly use TCP connections.
  
Similarly, CVS needs to be re-compiled to get support for keberos. Available -- with-krb4 for connection. the data transmitted in this way is not encrypted. for security. you must use '-- enable-encryption to connect to the server and client. in this case, you apply the common variable-x to require encryption.
  
On the server side, you need to edit inetd. conf to run cvs kserver. The default port number of the client is 1999. If you want to use another port number, you need to define CVS_CLIENT_PORT on the client side.
  
The logon command is
  
Cvs-d: kserver: faun.example.org:/usr/local/cvsroot checkout foo
  
Connect with fork
  
In this way, you can connect to the software library of the local hard disk through the remote protocol. In other words, it can have the same features as: local: the LOGIN command in this way is
  
Cvs-d: fork:/usr/local/cvsroot login
  
The default host name is cvs.
  
Iii. cvs server rack and Application Instances
  
1. Server Installation Configuration
  
Assume there is a work project, and cvs is required as the administrator code. this development group contains three internal developers, and the ip addresses are: 192. 168 .. 1.2 (User Name t1), 192.168.1.3) (User Name t3), 193.168.1.3 (User Name t3), one remote user, whose host is tom.example.com. (The user name is tom)
  
If you have installed cvs, it is very easy to create a cvs host that is cvs.exam.org. The steps are as follows:
  
1.1 Log On As root. Create a software library (repository)
  
$ Export CVSROOT =/cvsroot
  
$ Mkdir/cvsroot
  
$ Cd/cvsroot
  
$ Cvs init
  
1.2 set the execution permission
  
$ Chmod/cvsroot/CVSROOT 744 (/ccvsroo/CVSOOT is set to read-only)
  
$ Chmod/cvsroot 764 (/cvsroot can read and write to the Development Group)
  
Modify the file for other users. Because the developer is a system user, it is better to use the System user name and password here. Edit the. rhosts file as follows:
  
Tom.example.com. tom
  
Modify the/etc/inetd. conf file on the server and add the following sentence:
  
2401 stream tcp nowait root/usr/local/bin/cvs-f -- allow-root =/usr/cvsroot pserver
  
In this way, a basic cvs server is built.
  
We only provide a basic application here. The actual details of the application in cvs are very complicated. Here we will only introduce some of them. You can read the installation documents carefully with interested friends.
  
2. Application Instance
  
(Using the cvs system on the host, you can telnet to the host and then use it. It is no different from the local one, so this article will not be mentioned)
  
Assume that tom in the above example wants to use the cvs system on the cvs host for collaborative development. First, it configures its own environment variables. First, edit/etc/services to add:
  
Cvspserver 2401/tcp
  
Add the following code to the. profile file:
  
CVSROOT =: etx: vers: tom@cvs.exam.org:/cvsroot
  
Export CVSROOT
  
In this way, he can use $ cvs login to log on. the following uses the specific use of tom as an example to describe the application of cvs. same as other linux commands. cvs also has a large number of parameters. I will create a list in the next section.
  
Tom has the following files in the/usr/test directory:
  
Ecample. c exampl2.c tes1.c test2.c utimel. c tty. c
  
If you want to create your own directory in the software library
  
$ Cd/usr/test
  
~ Test $ cvs import? M "tom first creation" tomdir tom tomwork
  
N tomdit/example. c
  
N tomdit/exampl2.c
  
N tomdir/test1.c
  
N tomdir/test2.c
  
N tomdir/utmel. c
  
N tomdit/tty. c
  
No conflicts creat by this import
Command description import submit command? M is followed by a description. tom publisher tomwork is the release number. If you are prompted that CVSROOT is incorrect, you can use--d to add CVSROOT
  
Note: Can I use cvs command for all cvs commands? H To get help. At this time, the/cvs directory on the server has an additional tomdir subdirectory. The content is:
  
Example. c, v exampl2.c, v test1.c, v test2.c, v tty. c, v utimel. c, v

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.