First, install the necessary packages.
Yum Install Subversion (SVN server)
Mysql-server (for Codestriker)
httpd mod_dav_svn Mod_perl (used to support web-style management of SVN servers)
SendMail (for configuring user to submit code and email reminders)
wget gcc-c++ make unzip perl* (prerequisite package)
NTSYSV vim-enhanced (optional)
Two, basic SVN server configuration
1, create a new directory to store all SVN files (this file represents the root directory of this SVN server)
# MKDIR/HOME/SVN
2, create a new version of the warehouse
# Svnadmin Create/home/svn/project (project represents the warehouse directory)
3, initializing the directory in the version warehouse
# mkdir Project Project/server project/client project/test (Create temp directory)
# SVN import project/file:///home/svn/project-m "Initialize SVN catalog"
# RM-RF Project (delete the temporarily established directory)
(This is a temporary directory that we can think of as the project we're going to import into SVN.)
, the project was not put directly into the SVN server's warehouse, but imported through import.
The-m parameter here represents the memo information when we commit, and project/says we want to import
The project directory, File:///home/svn/project indicates the purpose path of the project we imported.
############## #下面是关于svn文件的配置, mainly the distribution of people's rights,
Remember: There is no space at the beginning of the header in the configuration file. ###############
4, add user
To add an SVN user, simply add a "Username=password" entry to the/home/svn/project/conf/passwd file,
To test, I added the following:
(The four user roles are represented in the example: Engineering administrator, server side, client, tester)
[Users]
# Harry = Harryssecret
# sally = Sallyssecret
PM = PM_PW
Server_group = SERVER_PW
Client_group = CLIENT_PW
Test_group = TEST_PW
5, modify user access Policy
([project:/] A directory that represents the permissions that will be set, relative to the SVN directory.) You can add a person's permissions directly inside,
You can also specify permissions with the @ Group name, with multiple people in the group in [groups], separated in English,
* = Indicates the permissions of other users other than the above, note that the assignment of permissions is inherited,
For example, the root directory is set to read-only, will cover the underlying writing, a total of three types of properties: ' R ', ' RW ', ', means that access is not allowed.
for * = This block represents anyone, all authorized users use $authenticated, anonymous users use $anonymous)
/home/svn/project/conf/authz records the user's access policy, the following are references:
[Groups]
project_p = PM
project_s = Server_group
Project_c = Client_group
project_t = Test_group
[project:/]
@project_p = RW
* =
[Project:/server]
@project_p = RW
@project_s = RW
* =
[Project:/client]
@project_p = RW
@project_c = RW
* =
[Project:/doc]
@project_p = RW
@project_s = RW
@project_c = RW
@project_t = RW
* =
The above information indicates that only PM has the right to read and write the root directory, Server_group can access the server directory, Client_group can access the client directory, everyone can access the doc directory.
6, modify the svnserve.conf file, so that users and policy configuration to increase efficiency.
(Anon-access represents an unauthorized user, auth-access represents an authorized user, passwor-db the path to fill in the Password data file
Because a different warehouse can be set up in an SVN server, and different user passwords need to be defined for each warehouse
, so use the specified directory here, auth-db Similarly, the general bit in the warehouse in the several files of conf, the permissions are divided into three kinds:
Write,read,none)
Svnserve.conf contents are as follows:
[General]
Anon-access = None
auth-access = Write
Password-db =/home/svn/project/conf/passwd
Authz-db =/home/svn/project/conf/authz
7, start the server
# svnserve-d-R/HOME/SVN
(Here I need to emphasize below: Start server path problem, if make write to/home/svn under, mean to turn over address svn://host/The directory that represents is/HOME/SVN.
Now, for example, I add two warehouses to my/home/svn directory, project1,project2, then I want to visit when I need to fill in svn://host/project1 this form.
But if you write the svnserve-d-r/home/svn/project1 directly when you start, you can access the root directory svn://host/when you visit,
The permissions in the directory correspond to the same, except that we may have different actual directories mapped to the SVN root directory at startup.
The blogger was stuck with the problem before. Recommend the use of/HOME/SVN this, convenient for us to manage multiple warehouses. )
8, test server (check out from the command line: SVN checkout warehouse path)
# SVN Co svn://192.168.60.10/project
Authentication realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Password for ' root ':
Authentication Realm: <svn://192.168.60.10:3690 > 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Username:server_group
Password for ' server_group ':
SVN: Authorization failed (Server_group access to the root directory)
# SVN co svn://192.168.60.10/project
Authentication realm: <SVN ://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Password for ' root ':
Authentication Realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
username:pm
Password for ' PM ':
Aproject/test
Aproject/server
aproject/client
Checked out revision 1. (test fetch succeeded)
# CD Project/server
# vim MAIN.C
# svn add main.c
# SVN commit main.c-m "Test my C program, see what to see, can't ah??"
Adding MAIN.C
Transmitting file data.
Committed revision 2. (test commit succeeded)