SVN permission configuration under centos

This article intends to record a series of operational issues in the use of svn under Linux.
You can find relevant tutorials about the construction and opening of svn. After installation, a series of permission configurations and account password assignments can be configured by referring to this document.

svn actual use operation

start service command

/home/svn/warehouse/ is the actual svn installation path

sudo svnserve -d -r /home/svn/warehouse/

stop service command

killall svnserve

Configuration file description

Both the authority control file and the password save file are under the svn root path.

The svn root path is: /home/svn/warehouse

Authority control file: /home/svn/warehouse/authz

Password storage and verification file: /home/svn/warehouse/http_passwd

New complete operation

Add warehouse

svnadmin create /home/svn/warehouse/ebu1

After it is built, there will be corresponding files in the corresponding directory

image-20230413141759243

Go to the conf folder

image-20230413132314070

Modify svnserve.conf

image-20230413132522336

1. Register or modify user password

htpasswd -bm /home/svn/warehouse/http_passwd zhangsan 123456

2. Set the permission to access svn

vi/home/svn/warehouse/authz
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe

# [/foo/bar]
# harry = rw
# &joe = r
# * =
#
pro=zhaoliu
#管理员
admin=admin,zhaoliu
#开发
dev=zhangsan,lisi
#管理部
xmglb=zhangsan1,lisi1
#一部
ebu1=zhangsan,lisi
#二部
ebu2=zhangsan,lisi
#三部
ebu3=zhangsan,lisi
#四部
ebu4=zhangsan,lisi

[/]
#* = r
@admin = rw

[dev:/]
@dev = rw

[pro:/]
@pro = rw

[xmglb:/]
@xmglb = rw

[ebu1:/]
@ebu1 = rw

[ebu2:/]
@ebu2 = rw

[ebu3:/]
@ebu3 = rw

[ebu4:/]
@ebu4 = rw

authz file configuration instructions

###Personnel Group Description

#Add a personnel account to the corresponding group, the group name and warehouse name are the same.
#A member of the administrator group, to view the permissions of all warehouses.

admin=admin, zhaoliu

# Members of the development team

dev=XXXX

And so on the members of each group

Description of read and write permissions in the group

[/] means all paths
#* = r

@admin = rw means that the administrator group has all read and write permissions

[dev:/] indicates that the corresponding warehouse path is dev

@dev = rw indicates that members of the dev group have read and write permissions to the dev warehouse path

Problems and solutions

1. Log view

Check the log path:

image-20230413142502695

View the corresponding error message:

image-20230413142540803

2. It can be checked out, and an error will be reported when submitted.

image-20230413130336544

Solution

sudo chown -R apache:apache /home/svn/warehouse/

Guess you like

Origin blog.csdn.net/u010048119/article/details/130129844