Server setup steps: 1 installation package $ sudoapt-getinstallsubversion2 add svn Management user and su
Server setup steps:
1. installation package
$ Sudo apt-get install subversion
2. add svn management users and subversion groups
$ Sudo adduser svnuser
$ Sudo addgroup subversion
$ Sudo addgroup svnuser subversion
3. create a project directory
$ Sudo mkdir/svn
$ Cd/svn
$ Sudo mkdir fitness
$ Sudo chown-R root: subversion fitness
$ Sudo chmod-R g + rws fitness
4. create an SVN file repository
$ Sudo svnadmin create/svn/fitness
5. access methods and project import:
$ Svn co file: // home/svn/fitness
Or
$ Svn co file: // localhost/home/svn/fitness
* Note:
If you are not sure about the host name, you must use three slashes (//). if you specify the host name, you must use two slashes (//).
6. access permission settings
Modify the/svn/fitness/conf Directory:
Svnserve. conf, passwd, and authz files. spaces are not allowed at the front end of the row.
Edit the svnserve. conf file:
The object content after removing the comment line (starting with #) is
[General]
Anon-access = none
Password-db = passwd
Authz-db = authz
[Sasl]
Here, anon-access and auth-access are respectively anonymous and permission granted to authorized users. by default, anonymous users are granted read-only permissions. However, if you want to deny access to anonymous users, you only need to change read to none to achieve the goal.
Edit passwd as follows:
Each row below represents a user
The format is username = password
For example, if the password of the test account is 123456, the configuration is as follows:
[Users]
Test = 123456.
Test 2 = 121212
Edit authz as follows:
The permission for each path starts [].
Permission content is configured as a = B
1) left
A is the username (user2), User Group (@ grp2), or user group (& alias2)
Here, the user name and user group are used more often.
A can also be *, representing all users
2) Right value B
R indicates read)
W stands for write)
Rw indicates read/write
Null indicates no permission
User Group configuration
The user group is configured under the [groups] line.
The format is group name = member (multiple members are separated by commas), as shown in figure
Grp2 = user1, user2, user3
For example, all users in the root directory cannot read/write (empty), group grp2 read/write (rw), but user2 read-only (r)
Create a row at the bottom
Input
[/]
* =
@ Grp2 = rw
User2 = r
Now a folder named java is created, and all users are read-only (r). grp cannot be read/written (empty), but user3 can be read/written (rw)
Open conf/authz
Create a row at the bottom
Input
[/Java]
* = R
@ Grp2 =
User2 = rw
All configurations take effect after the service is restarted.
7. start the SVN service:
1) start the service
Svnserve-d-r/mfsshare/svn
2) Check whether the service is running ps-ef | grep svn. then, svnserve-d-r/mfsshare/svn indicates that the service is already running.
[Root @ cmini conf] # ps-ef | grep svn
Root 2774 1 0? 00:00:00 svnserve-d-r/mfsshare/svn
Root 14174 9352 0 00:00:00 pts/1 grep svn
3) close the service
In step 2nd, the pid of the process is obtained from the operation result, which is usually in the second column of the row. In this example, the pid of the process is 2774.
Enter the command. remember not to enter the wrong number,
Killed 2774
Step 3. check whether svnserve-d-r/mfsshare/svn is missing.
Restart service
Perform the following operations in sequence: 2), 3), and 1)
Description:
-D indicates that svnserver runs in "daemon" process mode
-R specifies the root location of the file system (the root directory of the version Library), so that the client can access the version library without entering the full path.
For example, svn: // 192.168.12.118/fitness
The SVN installation is complete.
LAN access method:
Example: svn checkout svn: // 192.168.12.118/fitness -- username mirze -- password 123456/var/www/fitness
Attach/conf configuration
Authz:
[groups]backend = yangyz,pengcp,fengj,yijjfrontend = xugx,suncyread = chul,hewc,wangc,yusm,zhouzc,liuq,maolf[/]* =yangyz = rw[/Documents]* = ryangyz = rw[/Management]* = ryangyz = rw[/Sources]* = rw[/Bin]* = ryangyz = rw
Passwd:
[users]pengcp = tx123456fengj = tx123456yangyz = tx123456chul = tx123456hewc = tx123456liuly = tx123456wangc = tx123456yusm = tx123456zhouzc = tx123456liuq = tx123456maolf = tx123456suncy = tx123456xugx = tx123456yijj = tx123456
Svnserve. conf:
[general]anon-access = nonepassword-db = passwdauthz-db = authz[sasl]