Cygwin established CVS warehouse

xiaoxiao2021-03-06  38

Due to the installation of Cygwin on your own machine, let him not be very good every day, need to give him a point use, just need an installation of a CVS server, I decided not to use CVSNT, install it on my machine A service under Cygwin. Ok, now start:

Step 1: First need to install Cygwin, you need to select the following package

DEVL / CVS (of course)

Admin / CygrunSRV is used to add Cygwin services to Windows services

Net / inetus is not allowed to be xinetd, because I have a lot of questions when I use XINETD, and I have not solved INetd.

Step 2: After installing Cygwin, build a cvsroot user in Windows. This user needs to be a local user, do not be a domain user, determine if there is a CVSROOT household in a Cygwin / Home directory. If you don't switch to this user, you can run cygwin.

Step 3: Under Cygwin Environment, run IU-Config

Step 4: Run mkpasswd -l> / etc / passwd, import Windows users into Cygwin, then use the editor (Vi, UltraEdit, it is notepad not line), only reserved Administrator users and cvsroot users and others. Users you think need.

Step 5: Run the inetd service. Run the following command

Set the Windows environment variable: cygwin = ntsec. Add cygwin / bin to your PATH.

Run in Cygwin

Cygrunsrv -i inetd -d "cygwin inetd" -p / usr / sbin / inetd -a -d -e cygwin = ntsec

Cygrunsrv -s inetd

You can see that the CygWin inetd service has been launched in the Windows Service Manager.

Run usr / sbin / inetd.exe --install-as-service

From the new start.

Since Cygwin does not support the su command, you have to switch the user under Cygwin with Telnet.

Step 6: Establish a cvsroot directory, you can build in / var / cvsroot, if you do not want to build a repository directory in a Cygwin environment, you can use / cygdrive / d to select the drive. Select CVSRoot users under Cygwin, run CVS -D / CygDrive / D / CVSROOT INIT, configure the root directory of the CVS service, set under D: / CVSROOT.

Step 7, edit the /etc/inetd.conf file, join:

CVSPSERVER STREAM TCP NOWAIT CVSROOT / BIN / CVS CVS -F - Allow-root = / cygdrive / d / cvsroot PServer

Edit Modify / etc / Services, join:

CVSPSERVER 2401 / TCP #CVS Server TCP Port

CVSPSERVER 2401 / DUP #CVS Server UDP Port

Step 8, configure CVS users, just like other systems, there is a very detailed document on the Internet, and no longer say more.

From the newly launched inetd service, you can.

What to pay attention to during the installation process is the permissions issue of the directory, and the file established in Cygwin can only be managed in Cygwin.

There is also a problem that does not distinguish between file sketch under this CVS, you need to pay attention when using it. If you select Xinetd during the installation process, I have not found the way to register the successful Windows service, so I will not introduce it here.

I wish you all a happy use.

CVS experience talks

From: tissue engineering of UML: Gong Tianyi [2004/11/22]

CVS is an abbreviation for the Concurrent Version System for version management. The role in multiplayer team is more obvious. The basic work idea of ​​CVS is this: Create a repository on one server, and many source processes of many different items can be stored in the warehouse. The source program is managed by the warehouse administrator. In this way, it seems that only one person is like a file. Avoid conflicts. Each user first uses the warehouse to download the project file in the warehouse to the local. Any modification of the user is first conducted locally, then submitted by the CVS command and is unified by the CVS warehouse administrator. This will do tracking file changes, conflict control, and more. Since CVS is based on SCCS and RCS based on the original UNIX system, CVS is mostly used in the Linux system. The server-side settings in this article are also linux as an example. First, the installation of the CVS server first confirms if the system is installed in the system: [root @ localhost /] # rpm -qa | grep cvs CVS-1.11.2-cvshome.7x.1 If the command output is similar to the above output, CVS has been installed, otherwise you need to install the CVS rpm package from the installation CD, or download it at http://www.cvshome.org. 1. Establish a cvsroot directory because it involves the user's permission issues read and written on the file in CVSROOT, so a relatively simple method is to create a group, then build a account belonging to the group, and the user after reading and writing It is to belong to this group. Suppose we built a group called CVS, the username is CVSROOT. The command group and the user's commands are below #groupadd CVS #adduser cvsroot, the user host directory generated in / home / cvsroot (according to your own system adjustment) 2, use the cvsroot user to log in, modify the permissions of / home / cvsroot (cvsroot), assignment The same person has read and writes: $ chmod 771. (Or 770 should also) Note: This part of the work is done according to documentation, there must be no test, I will do the test after the test is in the later version of the tutorial Speak carefully. If you have this experience, please give me, thank you. 3. Establish a CVS warehouse (still cvsroot users), with the following command: $ cvs -d / home / cvsroot, log in, modify /etc/inetd.conf (using xinetd, without this file) and / etc / services If you use inetd, add: Cvsserver Stream TCP NOWAIT ROOT / USR / BIN / CVS CVS -F - Allow-root = / home / cvsroot PServer Description: Top The line is a single line, / usr / bin / cvs should be your CVS version of the command path, please adjust according to your system. / Home / CVSROOT is the path to the cvsroot you created, and also adjust it according to the contents of the part of the directory above.

If you are using the XINETD system, you need to create file CVSPServer in the /etc/xinetd.d/ directory (this name can be defined), the content is as follows: # default: on # description: The cvs server sessions; service cvsserver {socket_type = stream Wait = no user = root server = / usr / bin / cvs server_args = -f --allow-root = / cvsroot pserver log_on_failure = userid online = 192.168.0.0/24} where the only_from is used to restrict access, depending on Don't or modify the actual situation. Modify the file permission: # chmod 644 CVSPServer Add: CVSServer 2401 / TCP Description: Cvsserver is any name, but cannot be renamed with the existing service, but also modified /etc/inetd.conf above /etc/inetd.conf The first line of the line is consistent. 5, add users who can use CVS services to CVS group: Modify / etc / group as root, add users who need CVS to the CVS group, such as what I want users Laser and Gumpwu can use CVS services, then modify In the future, the / etc / group should have the following rows: CVS: X: 105: Laser, GID on your system may not be 105, there is no relationship. Mainly to separate the Laser and Gumpwu to the last colon with a comma. Of course, like the distribution of the RedHat has tools like LinuxConf, do this will be simpler. 6, restart inetd to take effect: #killall -hup inetd If you are using Xinetd's system: # /etc/rc.d/init.d/xined restart and check if the CVS server is running: [Root @ localhost /] # netstat -lnp | GREP 2401 TCP 0 0 0.0.0.0:0:2401 0.0.0.0:0:0:2401 0.0.0.0:0:141 / xinetd The CVS server has been run.

Second, the management CVS server server can be used, and now everyone is how to manage the server, for example, I want some people to read and / or write the permissions of the CVS warehouse, but don't want to give it system permissions? It is not difficult, there is a cvsroot directory in the cvs administrator user (in the cvsroot user), this directory has three profiles, passwd, readers, Writers, we can configure CVS by setting these three files. The server, the following introduces the role of these files: Passwd: CVS user list file, its format is very like shadow file: {CVS user name}: [Encrypted password]: [Equivalent system user name] If you I hope that a user is just a CVS user, not a system user, then you have to set this file. After you have just installed this file, this file may not exist, you need to create a CVS administrator user, of course, according to the format, the second field It is the user's encryption password, which is encrypted with CRYPT (3). You can write a program to do encryption, you can also use the lazy way I introduced: first create a system user, name, and CVS users, password is Prepare the CVS user password, copy the second field from / etc / shadow after creating, then remove this user. This method is more convenient to deal with fewer users, and people are not suitable, and there are also safety hazards of conflict conditions, and Root privileges, it is not good. However, the equivalent is. Write a small program is not difficult, you can search for the LinuxForum programming version, have a friend has written a post above. The third field is an equivalent system username. In fact, it is to assign an equivalent system user with a CVS user. Look at the following example you understand its function. Readers: A user list file with CVS read rights. It is a one-dimensional list. Users in this file have only read permissions for CVS. Writers: a list of users with CVS write permissions. Like readers, it is a one-dimensional list. Users in this file have write access to CVS. The above three files may not exist when the default installation, you need to create it yourself, ok, now let us use an example to teach. Suppose we have the following users to use CVS: Laser, Gumpwu, Henry, Betty, Anonymous. Where Laser and Gumpwu are system users, and Henry, Betty, Anonymous we don't want to give system user privileges, and Betty and Anonymous are read-only users, and Anonymous is even more than. So well, let's do some ready to work, first create a CVSPUB user, this user's responsibility is to read and write CVS warehouses on behalf of all non-system users. #adduser ... then edit / etc / group, let CVSPUB users in the CVS group while adding other users with system user privileges to the CVS group.

(See above) and edit the CVSRoot / Passwd file in the CVS administrators, add the following lines: Laser: $ xxefajfka; faffa33: CVSPUB GUMPWU: $ AJFAAL; 323R0OFeeanv: CVSPUB HENRY: $ FAJKDPAIEJE: CVSPUB BETTY: FJKAL; ffjieInfn /: CVSPUB Anonymous :: CVSPU Note: The second field above (separator is :) is a secret text, you want to use the program or use my dirt. Edit Readers file, add the following line: Anonymous Betty Edit Writers file, add the following line: Laser Gumpwu Henry Note: Users in Writers cannot be in Readers, or you cannot upload update files. For users who use CVS to modify its environment variables, such as Laser users' environment variables, open the .bash_profile file under the / home / laser (Laser), join cvsroot = / home / cvsroot export cvsroot with laser login Establish a CVS project, if you want root, you can modify the / etc / profile file. Now we have set it well, so how to use it, I have written a simplest (estimate is also the most common) command: First, establish a new CVS project, usually there are some project files. In this way we can use the following steps to generate a new CVS project: enter your existing project directory, such as CVSTest: $ cd cvstest running command: $ cvs import -m "this is a cvstest project" cvstest v_0_0_1 start description : Import is one of the commands of CVS, indicating an input project file to the CVS warehouse. The string behind the -m parameter is a description text, and write some meaningful things. If you do not add -M parameters, then CVS will automatically run an editor (generally VI, but can change to you by modifying environment variable editor) I like to use the editor.) Let you enter information, cvstest is the project name (actually a warehouse name, which is stored in the warehouse named after this name.) V_0_0_1 is the total mark of this branch. Nothing is used (or is not common.) Start is a tag of the input level of the import logo file, no use. This way we have built a CVS warehouse. The folder for establishing a CVS warehouse should be "clean" folder, that is, only the source code file and the documentation described, and should not include the compiled file code, etc.! Third, using CVS WinCVS is a good CVS client software, in http://cnpack.cosoft.org.cn/down/wincvsdailyGuide.pdf can download the user's manual. It is not described here. IV. Use the CVS management project. I am working on the company's ERP project. When I use CVS, I have repeatedly modified the same procedure for different developers, and the process is urgent, and the solution is imminent.

Since this project uses the Java development under the Linux platform, the development tool JBulider is supported by the project management. As the main programmer, I decided to use CVS to make version control, first refer to the above, I have established CVS service on the Linux server, then I pass my local project file to the server. For example: My project files Under F: / ERP, I uploaded the ERP.jpx file, the Default folder, and the src folder to the server / usr / local / erp, then log in to the Linux server, the user who logs in CVS users, their environment variables are correct (my username admin) #CD / usr / local / erp #cvs import -m "this is a a a a confed" ERP V_0_0_1 Start This CVS warehouse named ERP is established. . The members of the development team can be downloaded to the location with WinCVS: Open WinCVS Click Toolbar Create -> Create A New Repository ... Pop-up window ENTER THE CVSROOT Fill in admin@192.168.1.9: / home / cvsroot Among Admin is the user of CVS, in this example is also Linux system users, 192.168.1.9 is the address of the server, / home / cvsroot is the main directory of CVS, refer to above. Select CVS 1.10 (Standard) in the "Passwd File on the CVS Server" User Version. After confirming, point toolbar admin -> login ... will prompt the password, enter the password, look at the status bar of WinCVS. If prompted ***** CVS EXITED NORMALLY WITH code 0 ***** indicates that login is normal. Click Tools Create -> Checkout Module ... Pop-up dialog, where Enter the module name and path on the server fills in ERP, that is, our CVS Warehouse, which is the ERP, Local Folder to Checkout to Choose To download to a local directory, I chose F: / myerp Other projects can be default, after confirming, you can download it locally, in f: / myerp / going there is an ERP folder, its file structure and F: / ERP The next file structure is the same. Use JBulider to open the ERP.JPX file under the F: / MyERP / ERP / under this project file. In JBuilder's toolbar Team -> Select Project VCS pop-up dialog box, select CVS for the file you want to modify, in the middle of the Project View, then right click, explore the shortcut menu, select CVS -> CVS Edit "xxxx.java (file name)" first use may prompt the CVS server password. Select CVS -> Update "xxxx.java before modification, select CVS -> Commit" xxxx.java (file name) ", modified files are saved to the CVS server, Update The purpose is to download, compare files. Keep the latest version every time you modify it.

转载请注明原文地址:https://www.9cbs.com/read-52400.html

New Post(0)