Install and configure the cvs service in linux-Linux Enterprise Application-Linux server application information. For details, see the following.
1. Verify that CVS is installed # Rpm-q cvs
If the version information similar to this is displayed, it indicates that CVS has been installed:
# Cvs-1.11.19
If no installation information is available, download the corresponding installation package from htttp: // www.cvshome.org.
My installation environment is linux as4 u2
If you do not want to use your own version, you can use
# Rpm? E cvs
Delete the built-in cvs installation package
Obtain the latest installation package cvs-1.11.21.tar.gz from htttp: // www.cvshome.org.
Decompress the package and install it:
# Tar zxvf cvs-1.11.21.tar.gz
Go to extract package cvs-1.11.21
#./Configure? Prefix = your installation directory & make install
2. Create a CVS user group and user Run the following command under the root user:
# Groupadd cvs
# Adduser cvsroot
# Passwd cvsroot
# Enter the cvsroot User Password
3. Create a CVSROOT (root directory of the CVS Repository) Run the following command under the root user:
# Mkdir/cvsroot the cvsroot path you want.
# Chown cvsroot. cvs/cvsroot change cvsroot permission
4. initialize the CVS Repository Run the following command under the cvsroot User:
# Su-cvsroot
# Cvs-d/cvsroot init corresponds to the cvsroot path created above
# Note: corresponding to the configuration of the/etc/xinetd. d/cvspserver File
5. Modify Environment Variables Edit the. profile file of the corresponding user in/etc/profile or/home.
The/etc/profile has been modified here as an example:
# Exit
Return to the root user. Only the root user has the permission to modify/etc/profile.
# Vi/etc/profile edit the/etc/profile file
Add the following two sentences at the end:
CVSROOT =/cvsroot
Export CVSROOT
Update environment variables:
# Source/etc/profile
At this time, the system has known environment variables such as $ CVSROOT.
6. Start the cvs server: Create the file cvspserver in the/etc/xinetd. d/directory. The content is as follows:
# Default: on
# Description: The cvs server sessions;
Service cvspserver
{
Socket_type = stream
Wait = no
User = root
Server =/usr/bin/cvs
# Note:/usr/bin/cvs is the location of the cvs command file.
# Note: the system's built-in cvs installation package is deleted,
# Note: server = your cvs installation directory/bin/cvs
Server_args =-f -- allow-root =/cvsroot pserver
# Note: corresponding to the cvs-d/cvsroot init command in step 1
Only_from = 192.168.10.0/24
# Note that 24 is the subnet mask length, corresponding to 255.255.255.0
}
Here, only_from is used to restrict access and can be modified or not based on the actual situation.
Modify the File Permission:
# Chmod 644 cvspserver
Then restart xinetd:
#/Etc/rc. d/init. d/xinetd restart
Check whether the cvs server is running:
# Netstat-lnp | grep 2401
Tcp 0 0 0.0.0.0: 2401 0.0.0.0: * LISTEN xxxxxx/xinetd
The cvs server is running.
7. Create a cvs user To ensure the security of the CVS system, modify the/cvsroot/CVSROOT/config file and remove the comment # Before "# SystemAuth = no, change "SystemAuth = no" to "SystemAuth = no", and create accounts for developers one by one. Do not assign user directories to new accounts because they will be used as a virtual user account. The specific commands are as follows:
[Root @ terry root] # chmod-R ug + rwx/cvsroot
[Root @ terry root] # chmod 644/cvsroot/CVSROOT/config
[Root @ terry root] # useradd-g cvs-M gaoshang
[Root @ terry root] # passwd gaoshang
The above command creates a user gaoshang without the Home Directory, copies the system shadow file to CVSROOT, and rename it passwd:
[Root @ terry root] # cp/etc/shadow/cvsroot/CVSROOT/passwd
[Root @ terry root] # chmod 0644/cvsroot/CVSROOT/passwd
Then, modify the passwd file, delete all rows except the user cvsroot and gaoshang that can use CVS, remove all contents after the second colon in each row, and add the string cvsroot, the format is as follows:
Then, remove the user gaoshang you just added in the system:
[Root @ terry root] # userdel-f gaoshang
(Here, the system uses the ciphertext generated for the user password when creating the user)
Now, the configuration of the CVS server is complete. At this time, your CVS users can only use the users specified in passwd to log on to your CVS server.
8. Assign permissions to users Add two files readers and writers under/cvsroot /.
Add users with only read permission to the readers file,
Add users with write permission to the writers file.
For example: # vi writers
Gaoshang
9. linux client logon test (or see Windows cvs client wincvs 1.3 instructions)
Assume that the cvs server is on 192.168.10.11 and the system has users cvsroot and gaoshang. Log on to another linxu machine and run the following command to complete the test:
# Note: enter the password. If no error message is displayed, the logon is successful.
[Root @ test2 test] #
[Root @ test2test] # export CVSROOT =: pserver: gaoshang@192.168.10.11: 2401/cvsroot
[Root @ test2 test] # cvs login
Logging in to: pserver: gaoshang@192.168.10.11: 2401/cvsroot
CVS password:
# Note: enter the password. If no error message is displayed, the logon is successful.
[Root @ test2 test] #
Configuration problems
1. cvsroot users cannot log on
[Root @ test2 test] # export CVSROOT =: pserver: cvsroot@192.168.10.11: 2401/cvsroot
[Root @ test2 test] # cvs login
Logging in to: pserver: cvsroot@192.168.10.11: 2401/cvsroot
CVS password:
No such user cvsroot in CVSROOT/passwd
Solution: Check that the/cvsroot/CVSROOT/passwd file does not contain the cvsroot user.
2. Only cvsroot users can log on. Other users cannot log on.
Check the cause and find/etc/xinetd. d/server_args =-f -- allow-root =/cvsroot pserver DIRECTORY parameter of the cvspserver file is incorrect, because the cvs working directory we configured this time is/cvsroot, instead of/home/cvsroot, therefore, set this parameter to server_args =-f -- allow-root =/cvsroot pserver. All users can log on normally.
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.