March 2011
« Feb   Apr »

Subversion : setup svnserve in a easy way

I had worked with various type of subversion deployments which using ssh, http and https. All the above steps has some difficulties when we moved it to  another cpanel or production mode server.

The issues are,

a. SVN over ssh requires ssh access to user account which I do not like
b. http/https requires mod_dav,mod-svn modules installation and apache config. file alteration.This would be difficult if the server has WHM/Cpanel installed.

The best and easy way is serve svn over the svnserve standalone daemon which is running on the port “3690”

Here we go,

a. creating svn repositories
[root@rc-090 ~]# svnadmin create /var/projects/svnrepo1
[root@rc-090 ~]# svnadmin create /var/projects/svnrepo2

b. Starting “svnserv” service for my svn projects
[root@rc-090 ~]# svnserve -d -r /var/projects/
verify it by,

[root@rc-090 ~]#  <strong>netstat -nlp | grep "3690"</strong>
tcp        0      0 :::3690                     :::*                        LISTEN      4567/svnserve

stopping svnserv service,
# killall -9 svnserve

c. Setting up user authentication

Edit repository svnserv.conf file and you may need to comment out few lines as shown below. A samples config. file looks like,
[root@rc-090 projects]# cat /var/projects/svnrepo1/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
realm = “Provide your credential …. ”

Now you need to set user credentials in “passwd” file. A sample entry should look like this,
[root@rc-090 projects]# cat /var/projects/svnrepo1/conf/passwd

liju = pass

c. Accessing svn over the network
Now you can access the repositories over the LAN on the following url
#svn co svn://liju@

In windows,

Keep in mind that you are using repository name placed under the “/var/projects” rather than using full physical path to the repository.

If you want to set user level restriction, you need to uncomment ” authz-db = authz” on “svnserve.conf” file and set respective user level restriction by looking the entry in the file “authz” under “conf” directory.

#cat svnrepo1/conf/authz

harry = rw
joe = r
* =

It shows hary has full access to the location “/docs/secure” and joe is limited to read access and other users have no access to this location.

Better is to create a group and add users , then limit the groups based on their access.

–Njoy đŸ™‚

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>