0

I just got access to a website that uses SVN for version control, which is new to me.

The webroot is the traditional /var/www/vhosts/www.example.com/httpdocs. When I'm inside that directory, I can run simple SVN commands like status and info. When I try to checkout a copy of the repo on my local machine I run into trouble:

It keeps telling me it can't find the repository.

me@desktop-123 /c/wamp/www/tempSite
$ svn co svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com .
The authenticity of host '111.111.111.1 (111.111.111.1)' can't be established.
RSA key fingerprint is 1d:e2:8f:5e:94:1b:94:0b:92:57:c0:ca:37:36:fb:4c.
Are you sure you want to continue connecting (yes/no)? yes
username@111.111.111.1's password:
username@111.111.111.1's password:
svn: No repository found in 'svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com'

me@desktop-123 /c/wamp/www/tempSite
$ svn co svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com/httpdocs .
username@111.111.111.1's password:
svn: No repository found in 'svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com/httpdocs'

me@desktop-123 /c/wamp/www/tempSite
$ svn co svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com/httpdocs/.svn .
username@111.111.111.1's password:
svn: No repository found in 'svn+ssh://username@111.111.111.1/var/www/vhosts/www.example.com/httpdocs/.svn'

There is an empty directory /var/www/vhosts/www.example.com/trunk, but it has not been touched for many months, whereas the child .svn directories have been updated within the last week. I don't think this is relevant, but since I'm new to this, it's confusing me.

When I run svn info I get this:

$ svn info
Path: .
URL: https://svn.example2.com/client.account/trunk
Repository Root: https://svn.example2.com/client.account
Repository UUID: 9c0d3acc-3531-50de-5176-468ba01a45ce
Revision: 1273
Node Kind: directory
Schedule: normal
Last Changed Author: mhollis
Last Changed Rev: 1273
Last Changed Date: 2014-03-20 11:14:49 -0700 (Thu, 20 Mar 2014)

Maybe I'm just too used to git, but I feel like I should be able to checkout the repo at /var/www/vhosts/www.example.com/httpdocs, no?

Is this because I'm trying to checkout someone else's repo? Do I need to try to checkout from https://svn.example2.com/client.account?

Zoe
  • 27,060
  • 21
  • 118
  • 148
doub1ejack
  • 10,627
  • 20
  • 66
  • 125

2 Answers2

0
  1. It's not Repository, but Working Copy of URL: https://svn.example2.com/client.account/trunk
  2. If it was repository, it will be not usable as "live" site
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

The webroot is the traditional /var/www/vhosts/www.example.com/httpdocs

That's your problem! You're not understanding how Subversion is setup!

I was puzzled by that Subversion path you were giving: /var/www/vhosts/www.example.com/. It looked like it contained the entire path to the repo from the root of the server. Subversion uses a virtual root for the server (depending upon how the server is running). You have no idea by looking at the URL where on the server the Subversion repo is actually located. Much like httpd hides the actual Webroot from you.

In fact, if you use Apache httpd as your server, you'll see something like this in the http.conf file:

<Location /svn>
    DAV svn
    SVNPath /opt/subversion/repo
    ....
</Location>

This is setting up /svn as the document root of your Subversion repository. The actual repo is located somewhere else on the system, and maybe not even under the rest of the Apache setup or docroot. Let's say this is a Apache httpd running on svn.vegicorp.com. In this case, the actual Subversion repository directory is under /opt/subversion/repo. However, I use the URL of http://svn.vegicorp.com/svn as my Subversion repository root.

Taking a look at the other working directory should have clued you in. The URL you want to use isn't svn+ssh://. Subversion sites rarely use this protocol because it's so damn difficult to setup. Most use http:// or https:// because they can take advantage of Apache's ability to connect to the Active Directory/LDAP server for security. Others will use svn:// for speed.

When I'm inside that [httpd webroot] directory, I can run simple SVN commands like status and info

That's because that webroot is actually a Subversion working directory. You create the entire webpage in Subversion, then do a svn co in the httpd webroot directory and you have your website.

This way, someone can work on the webpage remotely, use version control, etc. to get everything setup. Then, they can use svn update to update the webfoot to the HEAD of the branch or root.

Go into the webfoot, and do a evn info. This will give you the URL of that checkout. Then, you can checkout the webpage locally to your system by doing svn checkout and whatever that URL is.

For example:

$ svn co https://svn.example2.com/client.account/trunk webroot-trunk

This will create on your local system a directory called webroot-trunk with the complete checkout of your webpage including the entire directory structure.

You can now modify the webpages, and when finished, do a svn commit to save the changes. When you're done, you can log onto the web server, do a svn update and bring in your changes into the server.

David W.
  • 105,218
  • 39
  • 216
  • 337