Getting Subversion and Subclipse running on Windows XP 

This is a collection of notes from the web, placed here so that I don't lose them.


Based on: http://www.baccoubonneville.com/blogs/index.php/eclipse/2005/10/15/p111 

Installation of Subversion on Windows
First, I want to install Subversion on Windows (don't blame me :-). Here is a quick manual of use of Subversion installation on Windows:

svnadmin create c:/svn_repository

Using Subversion with Apache (But you don't need to do this)

  1. Subversion can be used with Apache 2.0. You should download and install it. As I had an EasyPHP with an Apache 1.3 for test purpose that was listening on port 80, I changed this port to port 81. My Apache 2.0 will listen to port 80.
  2. Copy the mod_dav_svn.so and mod_authz_svn.so from C:\Program Files\Subversion\bin to C:\Program Files\Apache Group\Apache2\modules.
  3. Add the following lines in httpd.conf (note that this is only basic authentication. You should use HTTPS):

    # For Subversion modules
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_svn_module modules/mod_dav_svn.so

     

    # For Subversion repository
    <Location /repos>
    DAV svn
    SVNPath "C:\svnrepo"
    AuthType Basic
    AuthName "Subversion repository"
    AuthUserFile "c:\svnrepo\conf\passwd"
    Require valid-user
    </Location>

  4. Create users in Apache by typing in "c:\Apache Group\Apache 2\htpasswd.exe" -cm "c:\svnrepo\conf\passwd" username. Retype the same command without -c to add next users.
  5. Optionally, you can download TortoiseSVN, a subversion client for Windows (it's like TortoiseCVS).
  6. Download and install Subclipse, the Eclipse plug-in for Subversion. Before installating Subclipse, you should first check that Subclipse is not already installed using the following menu: Help | About Eclipse SDK | Plugins. Subclipse is installed with some other plug-ins (when install PHPEclipse for example).
  7. You can use a single browser to view the repository. Type http://127.0.0.1/repos.

Comments:

You need Apache if you want to be able to access to your SVN repository throw WebDAV protocol. To, a simple web browser ou webdav client or file browser (like nautilus or windows explorer) can be enough to work with svn. And it's usefull if you want to re-use security rules of your apache config. But you can use svn+ssh:// protocole over the internet without any problem.  You can use Subclipse with svnserve and without Apache. Instead of using a http: scheme in the repository URL, you use svn:, or svn+ssh: over an unsecure network.

Q: Ok, but if I want to use Subclipse with svnserve using svn: over the Internet, I certainly have to configure Subversion to use port 80 or 443 I guess (other ports will be blocked by some firewalls on the other side). Is that correct?

A: In general, firewalls block incomming request and not outcomming ones. So if you want to use svn protocol instead of http over the internet, you just need to configure your server firewall to accepte incomming requests on the svn default port (3690).

Use of Subversion in Eclipse

1. Install the subclipse plugin in your Eclipse.
2. Open the SVN Repository Exploring Perspective (Window | Open Perspective | Other)
3. Right click and choose New | Repository Location... 

If not using Apache, type file:///svn_repository (if your repository is at c:\svn_repository).  Note that file://c:/svn_repository does NOT work, and will give these errors:

Couldn't open a repository
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file://c:/svn_repository'

while entering file://c:\svn_repository will give you the gnomic:

Error validating location: "org.tigris.subversion.javahl.ClientException:
Bad URL passed to RA layer
svn: Unable to open an ra_local session to URL
svn: Local URL 'file://c:%5Csvn_repository contains only a hostname
no path
"

If using Apache, in URL, type http://127.0.0.1/repos. Enter your login and password.

On D: drive try file:///D:/svn_repository/php_repo , if you created your repository in d:\svn_repository\php_repo using Tortoise.  Note that in Windows explorer, you won't be able to find the repository easily in Tortoise unless you change into the repo directory itself.

4.  Expand the repository, and the trunk, right-click and then add your base directory for your project (in my case c:\roger_big\ql14, which contained code, html files, access databases).  It will all run very quickly.

5.  I also added CDT, from http://download.eclipse.org/tools/cdt/releases/callisto. This is because I was working with C/C++.


From an email:

Today (2010-01-10) I installed Subclipse on Windows 7. Some more steps were needed:

- SVNService.exe / .zip
- - download path has changed
- - is a .zip now, the .exe is part of SVNService.zip
- - unpack the content (not the folder) of SVNService folder of SVNService.zip to the subversion bin folder

- Run SVNService as Administrator
- - ... otherwise ""
- - In Windows 7 open a dos-window (cmd.exe)
- - give this dos-window the Administator right by
- - - dos-window Icon > right click > Eigenschaften/Properties? > Erweitert/Extended? > AlsAdministratorAusfuehren/RunAsAdministrator? |X|
- - - or link a dosAdmin-Icon on your desktop and give it those properties.

- in this dosAdmin window start SVNService.exe as described by your posting.



Constructive feedback is welcomed to Roger Pearse.

Written 15th July 2006.  Updated 25th January 2010.

This page has been accessed by  ****** people since 15th July 2006.

Return to Roger Pearse's Pages