Aug 1, 2007

Install Subversion with Apache

After your system is up to date go get apache 2.0, subversion and webdav module

yum install httpd
yum install subversion
yum install mod_dav_svn
Now we need to create the directory for the repository:

mkdir /usr/local/svn

Now we need to create the repository

svnadmin create --fs-type fsfs /usr/local/svn
svn import /tmp/webqs/ file:///usr/local/svn/webqs/ -m "Initial import"
We need to configure apache
vi /etc/httpd/conf/httpd.conf

add
<location /repos>
DAV svn
SVNPath /usr/local/svn

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file

# For any operations other than these, require an authenticated user.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</Location>
Create a user and password (if you want to create more users leave out the -c switch, just use -m)

htpasswd -cm /etc/svn-auth-file huusan
New password: *****
Re-type new password: *****
Adding password for user huusan

Restart httpd service
# service httpd restart
After it boots back up open a web browser to your subversion machine (http://127.0.0.1/repos) it will prompt you for your user name and password and there you go.

No comments: