CentOS 7
Ads

Subversion : HTTP Access
2015/07/13
 
It needs to open 3690/TCP if you use svnserve server, but if you'd not like to open it, it's possible to access to repositories with HTTP without SVN.
[1]
[2] Install required packages.
[root@dlp ~]#
yum -y install mod_dav_svn
[3] Configure Subversion for HTTP access. For example, set for a repository "/var/svn/repos/project".
[root@dlp ~]#
vi /etc/httpd/conf.d/subversion.conf
# create new

<Location /project>
    DAV svn
    AuthType Basic
    AuthName "DAV SVN"
    AuthUserFile /var/svn/.svnpasswd
    Require valid-user
    SVNPath /var/svn/repos/project
</Location>
# add a user

[root@dlp ~]#
htpasswd -c /var/svn/.svnpasswd cent

New password:
Re-type new password:
Adding password for user cent
[root@dlp ~]#
chown -R apache. /var/svn/repos

[root@dlp ~]#
systemctl restart httpd

[4] Configure access control if you'd like to set. It is different from the setting of svnserve's one, that is only for using svnserve.
[root@dlp ~]#
vi /var/svn/repos/project/conf/authzsvn.conf
# create new

# define group

[groups]
developer = cent,fedora
operator = redhat
# everyone can Read access

[/]
* = r
# only developer group can Read/Write under the trunk

[project:/trunk]
@developer = rw
# only operator can Read/Write under the branches

[project:/branches]
@operator = rw
# only operator can Read/Write under the tags

[project:/tags]
@operator = rw
[root@dlp ~]#
vi /etc/httpd/conf.d/subversion.conf
<Location /project>
    DAV svn
    AuthType Basic
    AuthName "DAV SVN"
    AuthUserFile /var/svn/.svnpasswd
    Require valid-user
    SVNPath /var/svn/repos/project
    AuthzSVNAccessFile /var/svn/repos/project/conf/authzsvn.conf

</Location>
[root@dlp ~]#
systemctl restart httpd

[5] Access from a client like follows.
[cent@client ~]$
svn --username cent list http://dlp.srv.world/project

Authentication realm: <http://dlp.srv.world:80> DAV SVN
Password for 'cent':
# password you set

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <http://dlp.srv.world:80> DAV SVN

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/cent/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no

branches/
tags/
trunk/
[6] It's possible to read access with Web browser.
[7] It's OK to specify the URL you set on using TortoiseSVN client like follows.
 
Tweet