specify the installation directory C: \ usr \ local \ Apache2
The directory is selected correctly
wait until the end of the installation.
Connecting SVN to Apache
Copy from the C: \ usr \ local \ Subversion \ bin \ directory to the C: \ usr \ local \ Apache2 \ modules \ directory all the * .so, * .dll files
intl3_svn.dll
libapr.dll
...
ssleay32.dll
mod_authz_svn.so
mod_dav_svn.so
Configuring Apache to work with SVN
We configure SVN for work with several storages at once.
Setup:
Create the directory C: \ usr \ local \ Apache2 \ conf \ svn \ and create the file httpd-svn.conf in it with the following content:
# httpd-svn.conf SVN Config file
#
# Connect modules for working with SVN
LoadModule dav_module modules / mod_dav.so
LoadModule dav_svn_module modules / mod_dav_svn.so
LoadModule authz_svn_module modules / mod_authz_svn.so
<Location / svn>
DAV svn
# Absolute path to the directory containing the SVN repository
SVNParentPath "D: / repos"
# lists the repositories
SVNListParentPath on
# storage list design file
SVNIndexXSLT "/svnindex.xsl"
# file ACL access control to storage
# uncomment to use
AuthzSVNAccessFile conf / svn / svnaccess
# only authenticated users will have access to the repository
Require valid-user
# Authentication Type
AuthType Basic
# General name of the repository
AuthName "My SVN Repository"
# File with user passwords for access to SVN repository
AuthUserFile conf / svn / svnpasswd
</ Location>
To access, enter the name guest and leave the password blank.
Create svnpasswd password file
The first way is using the svnuser.bat script.
Open notepad and copy the following code.
@echo off
if% 1 == "" goto USAGE
if not exist svnpasswd htpasswd -cm svnpasswd% 1
if exist svnpasswd htpasswd -m svnpasswd% 1
goto EXIT
: USAGE
echo Create SVN access file
echo Usage: svnuser username
: EXIT
Save the file with the name
svnuser.bat
to the C: \ usr \ local \ Apache2 \ bin \ directory
run a command prompt and go to the directory C: \ usr \ local \ Apache2 \ bin \
add users one by one using the command
svnuser name
, the program will ask for a password - enter it.
In the directory C: \ usr \ local \ Apache2 \ bin \ you will find the file created with the passwords svnpasswd
copy the file to the C: \ usr \ local \ Apache2 \ conf \ svn \ directory
The second way is manually
Open command prompt
change directory C: \ usr \ local \ Apache2 \ bin \
to add users who have access to the repository, run for each user command
htpasswd svnpasswd user1 passwd_for_user1
In the directory C: \ usr \ local \ Apache2 \ bin \ you will find the file created with the passwords svnpasswd
copy the file to the C: \ usr \ local \ Apache2 \ conf \ svn \ directory
Note
htpasswd requires the -b switch for each run (so that the password can be entered from the command line) and -c for the first run to create a password file
Configuring SVN Authorization by Path (Path-Based Authorization)
In SVN there is an opportunity to delimit the areas of user access. A special format file is created in which we indicate the paths available to users. I will give an example. In the list we have 3 storages: RepA, RepB, docs. And 3 users: oleg, ira, sveta. ')
We divide users into groups: Attention!Comments in the file are not allowed, so do not forget to delete them!
[groups]
admins = oleg // group administrators, write oleg
devteam = ira, oleg // main project development team
editors = @devteam, sveta // users writing documentation
// previously described user groups can be included in the subsequent ones
// when linking to a group @ group_name is used
We indicate who can see the listing of available repositories. By default, we allow everyone to view. The rule applies to nested vaults! A group of administrators allow editing of files and vault settings.
[/]
* = r
@admins = rw
RepA repository access. From the root element, the rule applies here to allow viewing to all (* = r), however, some users need to deny access to this repository, this can be done by writing the user name with an empty access modifier value. We prohibit the user oleg access to the repository, and ira will get full control as a developer.
[RepA: /]
oleg = // subtract all permissions, null
ira = rw // read, write
Access RepB repository. We prohibit the user ira access to the repository, and oleg will get full control as a developer.
[RepB: /]
ira =
oleg = rw
Access to the document repository. Permit full access to the editors documentation team.
[docs: /]
@editors = rw
As a result, we get the configuration file for authorization svnaccess .
[groups]
admins = oleg
devteam = ira, oleg
editors = @devteam, sveta
[/]
* = r
@admins = rw
[RepA: /]
oleg =
ira = r
[RepB: /]
ira =
oleg = r
[docs: /]
@editors = rw
anonymous = r
Copy the created svnaccess file to the C: \ usr \ local \ Apache2 \ conf \ svn \ directory
The browser will ask you for the name and password you specified earlier in the file. C: \ usr \ local \ Apache2 \ conf \ svn \ svnpasswd , enter them and you will see the list of storages store1, store2