-------------------------------------------------- ------------
-------------------- By clear
Installation of a CVS server:
1. Check if cvs are installed on your operating system:
#> rpm -qa | GREP CVS
If you don't have you can find on the 2nd of Redhat, you can also download it to the latest RPM package online. It is easy to find, in fact, there is no Linux version.
2. Create a CVS user group:
#> GroupAdd CVS
3. Establish a CVSRoot user and the directory of the CVS group:
#> UserAdd -g cvs -g cvs -d / cvsroot cvsroot
4. Add a password for the cvsroot user:
#> Passwd cvsroot
5. Change / cvsroot / directory properties:
#> CHMOD -R 770 / CVSROOT
6. Change the user to log in:
#> su cvsroot
7. Started to create a single item:
#> cd / cvsroot
#> MKDir Project1
#> MKDir Project2
8. Start establishing a warehouse:
#> cvs -d / cvsroot / project1 init
#> cvs -d / cvsroot / Project2 init
#> chmod -r 770 ./project1/ ./project2/project2/
9. Establish a CVS service launch file, we use xinetd mode:
#> [Crtl] [d] Switch to root user identity
#> cd /etc/xinetd.d
#> VI CVSPSERVER
Service CVSPServer
{
Disable = no
Flags = Reuse
Socket_type = stream
Wait = NO
User = root
Server = / usr / bin / cvs
Server_args = -f --allow-root = / home2 / cvsroot / project1 --allow-root = / home2 / cvsroot / project2 pserver log_on_failure = userid
}
Note: Due to the length limit of Xinetd's Server_args, you can do this when you want to run a lot of single warehouse:
#> VI CVSPSERVER
Service CVSPServer
{
Disable = no
Flags = Reuse
Socket_type = stream
Wait = NO
User = root
Server = / cvsroot/cvs.run
LOG_ON_FAILURE = UserID
}
Write cvs.run scripts
#> vi /cvsroot/cvs.run
#! / bin / bash
/ usr / bin / cvs -f
- Allow-root = / cvsroot / project1
- Allow-root = / cvsroot / project2
PSERVER
#> chmod x /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 CVS service:
#> /etc/init.d/xinetd Restart
12. Check if the CVSPSERVER service is started:
#> netstat -l | GREP CVSPSERVER
There should be the following results:
TCP 0 0 *: CVSPSERVER *: * LISTEN
two. CVS service user management:
Above we have established two CVS warehouses in Project1 and Project2. Here we have two warehouses to establish CVS users.
13. Create a username and password that can log in to the CVS server:
#> su cvsroot
#> vi / cvsroot / Project1 / cvsroot / passwd
Trotter: *****: cvsroot
Mimi: *****: cvsroot
#> vi / cvsroot / project2 / cvsroot / passwd
Trotter: *****: cvsroot
Gary: *****: CVSROOT
The two files are Trotter, MIMI, GARY three CVS users, MIMI has the use of Project1, Gary has the use of Project2, Trotter has the use of Project1 and Project2. The permissions after login are cvsroot privileges.
Note: CVS users and system users are different.
14. ***** is a password, generated by the following file:
#> vi /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}
"
#> chmod a x /cvsroot/passwd.pl
15. If you want to generate a password is "123456", then:
#> / cvsroot/passwd.pl "123456"
Encryption password can be obtained, replace ***** in the Passwd file
16. OK, CVS is now fully installed, if you want a user to have Project1 permissions, you join a user in / cvsroot / project1 / cvsroot / passwd; if you want a user to have Project1 and Project2 Permissions, you will give him the same username and password in the / cvsroot / project1 / cvsroot / passwd and / cvsroot / project2 / cvsroot / passwd. Finally, let's try:
#> cvs -d
Server: Trotter@192.168.1.200: / cvsroot / project1 login
After the command is used to enter the trours, please enter the password of Trotter. You press the password set by yourself. If there is no error message, it is successful (my machine IP address is 192.168.1.200)
*** In addition, thank you for all the author of the article ***