Subversion HowTo
A simple guide to setting up svn on Slackware...
Subversion and its tools are installed by default in Slackware so;
Firstly, create a folder for the SVN repositories
mkdir -p /home/svn/repositories
The above example was taken from the source at the bottom on this post, but I will most likely be using /var/svn/repositories
so in the following, substitute /home/svn/ for /var/svn/ if we choose to go this way.
To setup Apache;
Un-comment the following three lines in /etc/httpd/httpd.conf
LoadModule dav_module lib64/httpd/modules/mod_dav.so
LoadModule dav_svn_module lib64/httpd/modules/mod_dav_svn.so
LoadModule authz_svn_module lib64/httpd/modules/mod_authz_svn.so
While we're in the httpd.conf file, it's worth navigating to the extra configuration section (this is the section that points to the extra configuration files in /etc/httpd/extra) and adding an entry similar to;
Include /etc/httpd/extra/httpd-svn.conf
I thought the /etc/httpd/extra directory was included by default, obviously not.
Create /etc/httpd/extra/httpd-svn.conf
with the following content;
<Location /svn>
DAV svn
SVNParentPath /home/svn/repositories
AuthzSVNAccessFile /home/svn/.svn-policy-file
AuthName "Test SVN Repo"
AuthType Basic
AuthUserFile /home/svn/.svn-auth-file
Satisfy Any
Require valid-user
</Location>
To set up simple path based authentication;
Create /home/svn/.svn-policy-file
with the following content;
[/]
* = r
[test:/]
plisken = rw
In the above, the * gives read to all users and plisken has read/write access to a repository called test
We need to create a file .svn-auth-file as follows;
htpasswd -cs /home/svn/.svn-auth-file plisken
The first time we do this, we need to use -c this tells htpasswd to create the file, so going forward, we would remove the -c as follows;
htpasswd -s /home/svn/.svn-auth-file bob
Where bob is another user
Beyond the scope here but we may wish to consider using an alternitive to -s (sha1) such as htdigest [to look into]
To create a repository, do;
svnadmin create --fs-type fsfs /home/svn/repositories/test
The --fs-type fsfs (may or may not be needed) and where test is the name of the repository, as used in the /home/svn/.svn-policy-file above.
Give Apache permissions over it;
chown -R apache:apache /home/svn/repositories/test
To test;
we can goto http://<server>/svn/test
Sources
http://www.slackwiki.com/Subversion
https://docs.slackware.com/howtos:network_services:subversion
No comments:
Post a Comment
Note: only a member of this blog may post a comment.