Install guide of SVN repository
1 : Download the svn exe from the following url :
http://subversion.tigris.org/files/documents/15/39559/svn-1.4.5-setup.exe
2 : Run the installer and follow the installation instruction
3 :Setup server as a Windows service using the following command on command line:
sc create SvnServe binpath= "C:\Program Files\Subversion\bin\svnserve.exe --service --listen-port 3690 -r \"C:\SvnData\"" start= auto
4 : Start service manually for the first time (or restart system):
net start SvnServe
5 : Create directory for your repositories:
md C:\SvnData
6 : Create repository for your project:
"C:\Program Files\Subversion\bin\svnadmin.exe" create C:\SvnData\MyProject
7 :Edit repository configuration file: C:\SvnData\MyProject\conf\svnserve.conf and edit the file. You can set there the following parameters:
anon-access - defines the access level of the anonymous users - the options are read|wite|none with default value read
auth-access - defines the access level of the authorized users - the options are read|wite|none with default value write
password-db - defines file name of the password database - the default is passwd file in the same directory as svnserve.conf
authz-db - defines file name of the authorization database - the default is authz file in the same directory as svnserve.conf. This file let you create user groups and manage access to the projects in more detailed way. You will no need it with a simple access scenarios.
realm - defines the database realm, which is by default unique to the project. Set this value to some common with other project if you want to authorize once for all the projects (if you do so the password-db parameter should be set to common user database file).
Sample configuration file:
[general]
anon-access=none
auth-access=write
password-db=passwd
realm=LocalSvnRealm
SVN server and project repository are ready now. All you need is to use any client (I prefer TortoiseSVN available from Tigris.org
but you can do it using command line tools of course) and initially checkout repository to your working directory - the repository
URL is svn://localhost:3690/MyProject.
8 : Edit password database file: C:\SvnData\MyProject\conf\passwd and optionally move the file to the target location if you changed default
location in configuration file. The file structure is:
[users]
wakil = XXXXX
ahamad = XXXXX
9 : defines the groups user authorization in authz file
[groups]
# harry_and_sally = harry,sally
admin=wakil, ahamad
# [/foo/bar]
# harry = rw
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
@admin = rw
* = r
10 : "C:\Program Files\Subversion\bin\svn.exe" checkout --username=wakil --password=wakil123 svn://localhost:3690/MyProject c:\WorkingCopy
11 :
There are a few more things:
adding Subversion binaries directory to your PATH variable will help you working with SVN on everyday use
it's good (but not mandatory) to create standard repository layout to keep your project data. So you should create the following directory structure in the project
trunk - this directory will store working copy
branches - this directory will store branch copies
tags - this directory will store tag copies
After you create those directories you can switch your working directory to svn://localhost:3690/MyProject/trunk and start development.
md c:\WorkingCopy\trunk c:\WorkingCopy\branches c:\WorkingCopy\tags
"C:\Program Files\Subversion\bin\svn.exe" add c:\WorkingCopy\trunk c:\WorkingCopy\branches c:\WorkingCopy\tags
"C:\Program Files\Subversion\bin\svn.exe" commit --username=user1 --password=password1 --message="Directory structure created" c:\WorkingCopy
"C:\Program Files\Subversion\bin\svn.exe" switch svn://localhost:3690/MyProject/trunk c:\WorkingCopy
the default port for svnserve is 3690 so you can skip it in service creation command as well as in repository URL (it was included here for presentation purposes
No comments:
Post a Comment