Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Error while trying to connect to SVN repository

Tags:

repository

svn

When I am trying to connect to my SVN repository on some remote server I am getting an error.

Unable to Connect to a repository URL 'svn://path/to/my/repository/'. Can't connect to host. No connection could be made because the target machine actively refused it.

How can I fix it?

like image 301
Love Gupta Avatar asked Dec 13 '22 01:12

Love Gupta


2 Answers

There are several methods Subversion uses to talk to the Subversion server:

  • Using httpd
  • Using svnserve
  • Direct file access.

So, the first thing we need to know is how are you talking to your Subversion repository? Did you set it up? If you did, are you running svnserve in order to act as a server? Or, did you configure your Apache httpd web server to act as the Subversion repository server? If you didn't set it up, who did?

Let's go through the basics:

File Access

You created the Subversion repository in /usr/share/svn/repository using the svnadmin create command. You didn't do anything else. In that case, you would access your repository as:

$ svn co file:///usr/share/svn/repository

Note that the URL protocol is file:// and not svn://.

SVNSERVE Access

Let's say that your repository sits on machine alpha, and there's only a single repository on alpha

The format for the URL is:

$ svn co svn://alpha

Note that the protocol is svn:// and the first thing after the protocol is the machine name. The svnserve is a simple, easy to setup, and fast server for Subversion repositories. I use it even if I could use file:// just because I don't have to keep giving the full path name each time.

If you setup your own Subversion repository, you can use the svnserve to run it. It uses port 3690 by default, and only a single svnserve instance can run on a machine using that port (you can change the port, but it's messy and I don't want to go into now).

To use the svnserve server, you need to do a few very minor things:

  • Setup the svnserve.conf File: Under your repository is a directory called conf. In this directory is a file called svnserve.conf. You need to find the line that begins with passed and remove the pound signs (aka sharps or octothorps) in front of the line: It's around line #20.

Just change:

### password-db = passwd

to:

password-db = passwd
  • **Setup the passwd file:** In the same directory as thesvnserve.conffile is another file calledpasswd. Edit this file, to include an account for you. There's two examples in the file forharryandsally`. Create one for you. This will be your user name (no spaces) and your password. When you checkout or commit files in Subversion, you'll use this.

http Access

You can setup an Apache httpd web server (the most popular web server on the Internet) to also be used as a Subversion server. It's a complex process, and I'm not going into here. However, if someone has set it up for you, the URL would be split into several parts:

  • The http:// protocol declaration
  • The name of the server
  • The virtual directory used for the repository (there can be multiple repositories)
  • The directory you're checking out.

Let's say the machine is named alpha, and you want to checkout from the foo project's repository:

$ svn co http://alpha/foo/trunk

I highly suggest you edit your question and include some more details. For example, where does your Subversion repository reside? Is it on your current system? Did you setup your Subversion repository, or did an administrator do it for you? Show us the exact command and error message you're getting too.

Otherwise, your question will probably be closed. See the Stackoverflow FAQ for more information.

like image 194
David W. Avatar answered Jan 18 '23 13:01

David W.


Actually my service of SVN was not running. So due this the server was not responding.

like image 41
Love Gupta Avatar answered Jan 18 '23 15:01

Love Gupta