Welcome to weblogs.com.pk Sign in | Join | Help

Running SubVersion With Apache On Windows

Source Controls are important in iteration based software development. They can even be used for personal use, and can be handy to see what changes were made in past, or to recover old version of files in case something has gone tremendously wrong.

 

Microsoft’s VSS (Visual Source Safe) and CVS (Concurrent Version System) are two widely used version control system. Source Safe has its limitation like poor administration, closed formats. It is very tightly integrated with Visual Studio product line though. On the other hand, CVS being open source has its user base. There are number of problems in CVS, and to solve these problems the original developer of CVS along with others has setup SubVersion project, that again is open source.

 

SubVersion can be used with Apache’s webserver and uses WebDAV as the communication protocol. To configure SubVersion with Apache on the Windows you need to follow these steps.

 

  1. Download Apache binaries from http://httpd.apache.org/download.cgi and install it.
  2. If you are using IIS and its using port 80, default Apache installation will fail to install Apache service. To work it out, edit your httpd.conf (usually in C:\Program Files\Apache Group\Apache2\conf folder) and change the following line (use search to find the line)
    Listen 80
    to
    Listen 8000
    Now, when started, Apache will listen on port 8000 and will not interfere with IIS. To install the Apache service from Apache’s bin folder (usually C:\Program Files\Apache Group\Apache2\bin) give the following command
    apache –k install
    This will install Apache2 service, that you can set to run Automatically. Simply start the service and test http://localhost:8000 and you should see Apache’s test page.
  3. Download SubVersion binaries from http://subversion.tigris.org and unzip the folder, (for example into c:\, and I am seeing C:\svn-win32-1.0.2)
  4. Copy SVN (The subversion protocol) Shared Objects (SOs) from httpd folder (C:\svn-win32-1.0.2\httpd) to Apache’s modules folder (C:\Program Files\Apache Group\Apache2\modules)
  5. Copy iconv folder, that contains shared objects on which SVN is based to Apache’s bin\iconv folder (C:\Program Files\Apache Group\Apache2\bin\iconv), Windows might prompt asking to overwrite few existing objects, check if you have, more recent versions that overwrite otherwise do not.
  6. Configure Apache to load SVN modules. You need to uncomment the following line first, as SVN module depends on this.
    LoadModule dav_module modules/mod_dav.so
    Add these lines after all LoadModules;
    #SubVersion-Begin
    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so
    #SubVersion-End
  7. Create some repository using svnadmin binary (in C:\svn-win32-1.0.2\bin), for-example,
    svnadmin create c:\repository
  8. To use authentication create Apache’s password file using htpasswd binary (from C:\Program Files\Apache Group\Apache2\bin)
    >htpasswd.exe -c c:\svn-auth Khurram
    Automatically using MD5 format.
    New password: *******
    Re-type new password: *******
    Adding password for user khurram
    You also need to create an access file where you will manage the access control lists. Here is a simple example that let everyone complete access.
    [/]
    * = rw

    I saved this file as c:\svn-access
  9. Configure a virtual directory in Apache that will link up to the repository we have just created. Virtual directory is configured in Apache using tag. Here’s the example entry that create /svn virtual directory load the svn module that is linked up with the repository we created and uses Basic authentication type whose logins are given using AuthUserFile and AuthzSVNAccess module, that work in conjunction with the Apache’s authentication mechansim is configured to use the svn-access file. Apache is enforced to use authentication.
    #SubVersion-Begin

      DAV svn
      SVNPath c:/repository
      AuthType Basic
      AuthName "Subversion repository"
      AuthUserFile c:/svn-auth
      AuthzSVNAccessFile c:/svn-access
     
        Require valid-user
     

    #SubVersion-End

 

That’s it, your SubVersion server is up and running; accessable over WebDav (http://localhost:8000/svn), try giving the URL in the browser, you should see your repository.

 

You can use TourtiseSVN client that integrated into Windows Explorer and is very easy to use. You can configure the TourtiseSVN as per your requirement.

 

Create empty folder, right-click the folder, choose Check Out, and give http://localhost:8000/svn as repository path, as it requires authentication, TourtiseSVN will prompt you for the login/password, enter them, and your repository will have checked-out. Add new files in the folder, right click the folder or individual files and choose Add from TourtiseSVN sub-menu, when finished, right click the repository folder and choose Commit.

 

If you need more information regarding SubVersion, read SVN Book.

TourtiseSVN has very good help file bundled with it. You can also find the updated documentation here.

Published Wednesday, May 5, 2004 12:53 PM by khurram

Comments

# SubVersion v1.0.3

Wednesday, May 19, 2004 4:08 PM by TrackBack

# re: CVSNT

Friday, September 3, 2004 11:51 AM by TrackBack

# Classification of Source Code Control Systems

Friday, September 3, 2004 12:50 PM by TrackBack

# re: Running SubVersion With Apache On Windows

Thursday, September 23, 2004 8:37 AM by
I tried this technique,however after step 6my Apache server will not run. If I uncomment those modules for Subversion

#SubVersion-Begin
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#SubVersion-End

Everything works fine. Just to let you know, i did copied the contents of of httpd iconv to their respective folders. Any thoughts?

# re: Running SubVersion With Apache On Windows

Tuesday, September 28, 2004 4:50 PM by khurram
Subversion must have latest builds of the DLLs that its modules require and Apache distribution might have the old versions. To workout, follow these steps before starting the Apache

1- Backup Apache\bin folder
2- Copy all the DLLs from SubVersion\bin to Apache\bin

Dont blame me if anything goes wrong :)

# re: Why and How to build a

Wednesday, January 26, 2005 3:33 PM by TrackBack

# Classification of Source Code Control Systems

Sunday, March 20, 2005 12:33 AM by TrackBack

# SubVersion v1.0.3

Sunday, March 20, 2005 12:34 AM by TrackBack
New Comments to this post are disabled