Lun. Dic 23rd, 2024

This howto assumes you have installed Subversion and Apache and discusses how to display the http port (80) instead of svn (3690) Subversion repositories through Apache and the WebDAV protocol

First install the module that will allow us to display the files stored in the subversion repository using Apache:
[root @ test ~] # yum install mod_dav_svnsubversion
Then edit the Apache configuration to indicate where our repositories and the type of authentication that is used to access them

[root@test ~] cd /etc/httpd/conf.d/
[root@test ~] vim subversion.conf

Dav_svn_module LoadModule modules/mod_dav_svn.so
Authz_svn_module LoadModule modules/mod_authz_svn.so

<Location /repos>
DAV svn
SVNPath /var/ www/svn/repos -> directory where svn repository
AuthType Basic
AuthName «Subversion repos»
AuthUserFile /etc/svn-auth-conf -> File with users and passwords (recommended that passwords are encrypted)
Require valid-user
</ Location>

The next thing is to create users with the password encryption. This is accomplished with the parameter -m  and in the absence of the file add the parameter -c to create.

[root@test ~] htpasswd -cm /etc/svn-auth-conf user1
New password:
Re-type new password:
Adding password for user user1
[root@test ~] htpasswd -m /etc/svn-auth-conf user2 -> -c parameter is not put on this occasion as there is already a file
New password:
Re-type new password:
Adding password for user user2

If we make based authentication for user and group repository add the following line in the file subversion.conf:
AuthzSVNAccessFile /etc/svn-acl-conf

<Location /repos>
DAV svn
SVNParentPath /var/www/svn/repos
AuthzSVNAccessFile /etc/svn-acl-conf
AuthType Basic
AuthName «Subversion repos»
AuthUserFile / etc / svn-auth-conf
Require valid-user
</ Location>
Create the file /etc/svn-acl-conf has the following syntax:

[reponame: repopath]
user = permissions
Where permits can be r (read), rw (read and write) or empty, in which case you will not have any access. The default is not given any permission.

In this example the user harry has read permission and javier user read / write access to the repository «framework»
[framework :/]
john = r
javier = rw
To create groups indicated in the following manner:

[groups]

staff = john javier

and refers to the sign (@)

[framework :/]
john = r
rw = @ staff

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *