Sunday, May 30, 2010

Fedora Setup SVN Server - How to

SVN was already pre-installed along with fedora actually. In case of not, you still can manually install through yum install. Below were the simple instruction how to set up a SVN server on  your linux, fedora distort.

1. install SVN
$yum install subversion

2. install mod_dav_svn
$yum install mod_dav_svn

3. create your svn repository
$mkdir /svn/repos

4. create your project repos
$mkdir /svn/repos/yourproject
* if you see the sqlite version prompt about your sqlite version, please update your sqlite
   yum update sqlite

5. change /svn folder owner to apache
$chown -R apache.apache /svn

6. create users who can access your project
$vi /svn/repos/yourproject/svnauth
[/]
username_1
username_2

7. add password to your project user list
$htpasswd -bcm /svn/repos/yourproject/svnpass username_1 password_1
$htpasswd -bm /svn/repos/yourproject/svnpass username_2 password_2

*htpasswd -help

Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password

htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.

8. set up your apache and add below code to your apache config file

<location /svn/yourproject>
SVNPath /svn/repos/yourproject
AuthType Basic
AuthName "SVN Repository"
AuthUserFile /svn/repos/yourproject/svnpass
Require valid-user
AuthzSVNAccessFile /svn/repos/yourproject/svnauth
</location>

9. restart your apache

Now your SVN Server has been setup already. Please refer to http://www.yourdomain.com/svn/yourproject to access your SVN Server. you will be prompt to enter your username and password.

There were lots of svn client software can be downloaded for free. just google it...

0 comments:

Post a Comment