Step1>Downloading and Installing Svn modules and dependencies :
Download the most recent distribution tarball from here :
Subversion depends on a number of third party tools and libraries.The Subversion has a package containing the minimal prerequisite libraries (Apache Portable Runtime, serf,neon,sqlite-amalgamation and Zlib) called the “dependency package” tarball or zipfile.
You can simply unpack the dependency package "on top of" the Subversion package; for example, if you are using a .tar.gz bundle on Unix, you could type: $ tar xzvf subversion-1.x.x.tar.gz $ tar xzvf subversion-deps-1.x.x.tar.gz $ cd subversion-1.x.x
and then use the standard GNU procedure to compile:
$ ./configure – On Unix systems, the ‘./configure’ script will tell you if you are missing the correct version of any of the required libraries or tools. (We can use the said command with prefix –enable maintainer mode or other prefixes as desired.)
$ make install
Test and verify the above setup by running “make check” at the end.
Step1(a)> Building a Subversion Server:
Subversion has two servers you can choose from:svnserve and Apache.
Svnserve is a small, lightweight server program that is automatically compiled when you build Subversion’s source.
Apache is a more heavyweight HTTP server, but tends to have more available features which help us give a better and secure control over the Repository.
Step2> Downloading and Installing Apache2 :
Please refer to the below mentioned URL for the latest released version:
Compile the below mentioned configuration files as said below:
$ ./configure –enable-maintainer-mode (This arg says to include debugging information.As similar we did while running the ./configure for svn as said in above process.Same setup should be followed else we can run into issues .Take this is as a feedback keep the prefixes usage as same as you do for svn & apache modules).
Compile and install apache:
$ make install
Step2(a)> Making and Installing the Subversion Apache Server Module :
Go back into your subversion working copy and run ./autogen.sh if you need to. Then, assuming Apache httpd 2.0 is installed in the standard location, run:
Note: do *not* configure subversion with “–disable-shared”! mod_dav_svn *must* be built as a shared library, and it will look for other libsvn_*.so libraries on your system.
Note: If you have old subversion libraries sitting on your system,libtool will link them instead of the `fresh’ ones in your tree.Remove them before building subversion.
$ make clean && make && make install
Step 3> Configuring and authorizing Apache for Subversion:
By default you will find the httpd.conf file at the below mentioned location:
Verify the below svn modules are added in your httpd.conf file :
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Note: Create a file with the name as ‘svn-auth-file’ and save it under /etc directory.
Add the below mentioned svn module to the end of the httpd.conf file. This is one of the basic example for setting up your Svn repository with limited access.
AuthName “Suvbersion Repository”
Please refer to the below URL for other authorization options available:
Step 3(a)> How to add a SVN user in svn-auth-file :
1.To do this use command htpasswd -m /etc/svn-auth-file “UserName”
(Here the -m option modifies the svn-auth-file)
2.This will add a user and prompt for a password
3.Enter a desired password
4.Restart the apache server with command :/etc/init.d/httpd restart or
sudo /etc/init.d/apache2 restart
5.To delete the user . Use command htpasswd -D /etc/svn-auth-file userName
(Here the -D option delete the desired user from the svn-auth-file)
Step 4> Running the apace server with Svn plugin :
Trigger the below mentioned command:
$ /usr/local/apache2/bin/apachectl start or/etc/init.d/apache2 start
(This will start your apache server with effect to the recent modifications done in httpd.conf file.)
$ /usr/local/apache2/bin/apachectl stop or/etc/init.d/apache2 stop
(This command stops the apache server and you can re-edit your httpd.conf as and when desired and re-start your apache server to have the changes into effect).
Check /usr/local/apache2/logs/error_log to make sure it started up okay.
Step 5> Testing and using the SVN repository:
Steps to checkout and checkin some stuff to your repository :
$ svn checkout/co http://localhost/svn/repos (The most common reason this might fail due, to the permissions for reading the files from the repo DB.Make sure that the httpd process has permission to read and write to the repository).
$ svn commit/ci – This command recursively sends your changes to the SVN server. It will commit changed files, added files, and deleted files. The
-m option should always be used to pass a log message to the command.
$ svn add – When you are creating a new file or directory, you need to tell the SVN server about it. This command authenticates the newly created file or directory to the SVN server.
$ svn update/up – This command syncs your local sand box with the server. If you have made local changes, it will try and merge any changes on the server with your changes on your machine.
$svn help – Provides a summary of the available commands.
Note: Please proceed to Step3 If you already have a SVN server installed on your Unix machine. If you are starting afresh ,follow the steps from the beginning.
As per my understanding I have tried to explain the setup with easy and quickly understood steps.Hope this might help to the extent of setting up your client Repository quick and easy with minimal configuration issues.If I am missing something here and if there are any valuable feedback feel free to say them.