How to use svn+ssh

22 views
Skip to first unread message

gabe

unread,
Sep 23, 2009, 9:50:04 AM9/23/09
to fredistrano-discuss
i can't figure out how i should access the repository from
fredistrano. when i use tortoisesvn from my laptop, i have to use svn
+ssh://user...@domain.com/svnpath/trunk/. well, i tried using the
same thing in fredistrano, but i keep getting the "Unable to locate
deploy.php" error and the svn command error is "svn: Network
connection closed unexpectedly". i copied and pasted the command: svn
export --non-interactive --username myusername --password mypwd svn
+ssh://myuse...@mydomain.com/home/myusername/svn/mydomain.com/trunk
tmpDir 2>&1 into my SSH terminal and i get a prompt for a password,
which i believe is actual a prompt for the SSH password and not the
SVN password. fredistrano is failing because i can't deal w/ the SSH
prompt. i noticed in the fredistrano documentation that the example
uses http://ipaddress/svn/test for the SVN URL. i tried this and get
connection refused errors. my hosting provider is pretty strict and i
doubt that i can use that. does anyone know how i can use svn+ssh?
if that's not possible w/ fredistrano, does anyone know how i can get
just svn, http, or https working (or any other method that i don't
know about)?

euphrate_ylb

unread,
Sep 23, 2009, 10:23:08 AM9/23/09
to fredistrano-discuss
Hi,

Most people I know use HTTPS for connecting to their SVN server.
Depending on the project, we also use HTTP. So basically we know that
those 2 protocols are correctly supported by fredistrano. To be
honest, I have never tried svn+ssh... Are you sure that your SVN
provider doesn't support at least HTTPS?

Regards,

Yann

On Sep 23, 3:50 pm, gabe <gabriel.cha...@gmail.com> wrote:
> i can't figure out how i should access the repository from
> fredistrano.  when i use tortoisesvn from my laptop, i have to use svn
> +ssh://usern...@domain.com/svnpath/trunk/.  well, i tried using the
> same thing in fredistrano, but i keep getting the "Unable to locate
> deploy.php" error and the svn command error is "svn: Network
> connection closed unexpectedly".  i copied and pasted the command: svn
> export --non-interactive   --username myusername --password mypwd svn
> +ssh://myusern...@mydomain.com/home/myusername/svn/mydomain.com/trunk
> tmpDir 2>&1 into my SSH terminal and i get a prompt for a password,
> which i believe is actual a prompt for the SSH password and not the
> SVN password.  fredistrano is failing because i can't deal w/ the SSH
> prompt.  i noticed in the fredistrano documentation that the example
> useshttp://ipaddress/svn/testfor the SVN URL.  i tried this and get

gabe

unread,
Sep 23, 2009, 10:33:40 AM9/23/09
to fredistrano-discuss
thx for the help.

i apologize for my subversion ignorance. i'm still kinda new to it.

i had to install subversion myself on my shared host web server. is
there a resource you can point me to that tells me how to set-up
subversion for http or https access, so i can try this?

On Sep 23, 10:23 am, euphrate_ylb <yann.leble...@gmail.com> wrote:
> Hi,
>
> Most people I know use HTTPS for connecting to their SVN server.
> Depending on the project, we also use HTTP. So basically we know that
> those 2 protocols are correctly supported by fredistrano. To be
> honest, I have never tried svn+ssh... Are you sure that your SVN
> provider doesn't support at least HTTPS?
>
> Regards,
>
> Yann
>
> On Sep 23, 3:50 pm, gabe <gabriel.cha...@gmail.com> wrote:
>
>
>
> > i can't figure out how i should access the repository from
> > fredistrano.  when i use tortoisesvn from my laptop, i have to use svn
> > +ssh://usern...@domain.com/svnpath/trunk/.  well, i tried using the
> > same thing in fredistrano, but i keep getting the "Unable to locate
> > deploy.php" error and the svn command error is "svn: Network
> > connection closed unexpectedly".  i copied and pasted the command: svn
> > export --non-interactive   --username myusername --password mypwd svn
> > +ssh://myusern...@mydomain.com/home/myusername/svn/mydomain.com/trunk
> > tmpDir 2>&1 into my SSH terminal and i get a prompt for a password,
> > which i believe is actual a prompt for the SSH password and not the
> > SVN password.  fredistrano is failing because i can't deal w/ the SSH
> > prompt.  i noticed in the fredistrano documentation that the example
> > useshttp://ipaddress/svn/testforthe SVN URL.  i tried this and get

gabe

unread,
Sep 23, 2009, 10:53:18 AM9/23/09
to fredistrano-discuss
here's what i get if i run the command from SSH terminal w/ http &
https:

myuse...@mydomain.com [~]# svn export --non-interactive
https://mydomain.com/svn/mydomain.com/trunk tmpDir 2>&1
svn: SSL is not supported
myuse...@theharmonyhouse.com [~]# svn export --non-interactive
http://mydomain.com/svn/mydomain.com/trunk tmpDir 2>&1
svn: OPTIONS of 'http://mydomain.com/svn/mydomain.com/trunk': 200 OK
(http://mydomain.com)

is there a way i can set-up svn to support SSL? what does the OPTIONS
error mean for the command using http?

On Sep 23, 10:23 am, euphrate_ylb <yann.leble...@gmail.com> wrote:
> Hi,
>
> Most people I know use HTTPS for connecting to their SVN server.
> Depending on the project, we also use HTTP. So basically we know that
> those 2 protocols are correctly supported by fredistrano. To be
> honest, I have never tried svn+ssh... Are you sure that your SVN
> provider doesn't support at least HTTPS?
>
> Regards,
>
> Yann
>
> On Sep 23, 3:50 pm, gabe <gabriel.cha...@gmail.com> wrote:
>
>
>
> > i can't figure out how i should access the repository from
> > fredistrano.  when i use tortoisesvn from my laptop, i have to use svn
> > +ssh://usern...@domain.com/svnpath/trunk/.  well, i tried using the
> > same thing in fredistrano, but i keep getting the "Unable to locate
> > deploy.php" error and the svn command error is "svn: Network
> > connection closed unexpectedly".  i copied and pasted the command: svn
> > export --non-interactive   --username myusername --password mypwd svn
> > +ssh://myusern...@mydomain.com/home/myusername/svn/mydomain.com/trunk
> > tmpDir 2>&1 into my SSH terminal and i get a prompt for a password,
> > which i believe is actual a prompt for the SSH password and not the
> > SVN password.  fredistrano is failing because i can't deal w/ the SSH
> > prompt.  i noticed in the fredistrano documentation that the example
> > useshttp://ipaddress/svn/testforthe SVN URL.  i tried this and get

Andreas Heissenberger

unread,
Sep 23, 2009, 11:05:05 AM9/23/09
to fredistra...@googlegroups.com, fredistrano-discuss
If your repository is on the same server as fredistrano use file:///
path/to/repository. In all other cases you have to create a
certificate without passphrase on the server fredistrano is running
and copy the public part on your svn server. There is no need to
specify a password inside fredistrano.

Regards
Andreas

---
http://twitter.com/aHeissenberger

Frédéric Bollon

unread,
Sep 23, 2009, 11:10:08 AM9/23/09
to fredistra...@googlegroups.com
May be you can try one of these providers ?
http://www.svnhostingcomparison.com/

Depending on the privacy of your project, it may suppress the burdden of administrating a SVN server.

For your information, our SVN providers are GoogleCode for our open source projects and Dreamhost for our private ones

Regards

Fred

gabe

unread,
Sep 23, 2009, 12:20:13 PM9/23/09
to fredistrano-discuss
thx so much for the help.

ok, i ran the export command using file:/// in my SSH terminal and it
worked great. when i ran from fredistrano, however, i received the
following error:

A tmpDir
/home/myusername/bin/bin/svn: symbol lookup error: /home/myusername/
bin/bin/svn: undefined symbol: apr_hash_clear.

here's the command that executes in my SSH terminal but fails when
fredistrano tries to execute it:

~/bin/bin/svn export --non-interactive file:///home/myusername/svn/projectname/trunk
tmpDir 2>&1

(see http://groups.google.com/group/fredistrano-discuss/browse_thread/thread/f43952caabc03d67
on why my svn command is ~/bin/bin/svn. my hosting provider won't
allow the bin folder w/ the svn binaries to be in the path used by the
user that executes the web php scripts)

any suggestions?

thx,
gabe




On Sep 23, 11:05 am, Andreas Heissenberger <andr...@heissenberger.at>
wrote:
> If your repository is on the same server  as fredistrano use file:///
> path/to/repository. In all other cases you have to create a  
> certificate without passphrase on the server fredistrano is running  
> and copy the public part on your svn server. There is no need to  
> specify a password inside fredistrano.
>
> Regards
> Andreas
>
>   ---
>  http://twitter.com/aHeissenberger
>
> Am 23.09.2009 um 16:53 schrieb gabe <gabriel.cha...@gmail.com>:
>
>
>
>
>
> > here's what i get if i run the command from SSH terminal w/ http &
> > https:
>
> > myusern...@mydomain.com [~]# svn export --non-interactive
> >https://mydomain.com/svn/mydomain.com/trunktmpDir 2>&1
> > svn: SSL is not supported
> > myusern...@theharmonyhouse.com [~]# svn export --non-interactive
> >http://mydomain.com/svn/mydomain.com/trunktmpDir 2>&1
> >>> useshttp://ipaddress/svn/testfortheSVN URL.  i tried this and get

euphrate_ylb

unread,
Sep 23, 2009, 2:07:49 PM9/23/09
to fredistrano-discuss
So glad to see some action on this newsgroup... Unfortunately, it
doesn't look good for you. I am beginning to hate your host
provider ;)

Does this simple script reproduce your problem?

<?php
echo(shell_exec('~/bin/bin/svn export --non-interactive
file:///home/myusername/svn/projectname/trunk /full/path/to/tmpDir
2>&1'));
?>

euphrate_ylb

On Sep 23, 6:20 pm, gabe <gabriel.cha...@gmail.com> wrote:
> thx so much for the help.
>
> ok, i ran the export command using file:/// in my SSH terminal and it
> worked great.  when i ran from fredistrano, however, i received the
> following error:
>
> A    tmpDir
> /home/myusername/bin/bin/svn: symbol lookup error: /home/myusername/
> bin/bin/svn: undefined symbol: apr_hash_clear.
>
> here's the command that executes in my SSH terminal but fails when
> fredistrano tries to execute it:
>
> ~/bin/bin/svn export --non-interactive    file:///home/myusername/svn/projectname/trunk
> tmpDir 2>&1
>
> (seehttp://groups.google.com/group/fredistrano-discuss/browse_thread/thre...
> on why my svn command is ~/bin/bin/svn.  my hosting provider won't
> allow the bin folder w/ the svn binaries to be in the path used by the
> user that executes the web php scripts)
>
> any suggestions?
>
> thx,
> gabe
>
> On Sep 23, 11:05 am, Andreas Heissenberger <andr...@heissenberger.at>
> wrote:
>
>
>
> > If your repository is on the same server  as fredistrano use file:///
> > path/to/repository. In all other cases you have to create a  
> > certificate without passphrase on the server fredistrano is running  
> > and copy the public part on your svn server. There is no need to  
> > specify a password inside fredistrano.
>
> > Regards
> > Andreas
>
> >   ---
> >  http://twitter.com/aHeissenberger
>
> > Am 23.09.2009 um 16:53 schrieb gabe <gabriel.cha...@gmail.com>:
>
> > > here's what i get if i run the command from SSH terminal w/ http &
> > > https:
>
> > > myusern...@mydomain.com [~]# svn export --non-interactive
> > >https://mydomain.com/svn/mydomain.com/trunktmpDir2>&1
> > > svn: SSL is not supported
> > > myusern...@theharmonyhouse.com [~]# svn export --non-interactive
> > >http://mydomain.com/svn/mydomain.com/trunktmpDir2>&1
> > >>> useshttp://ipaddress/svn/testfortheSVNURL.  i tried this and get

Andreas Heissenberger

unread,
Sep 23, 2009, 2:44:55 PM9/23/09
to fredistra...@googlegroups.com, fredistrano-discuss
Do a printenv on the commandline and compare it to a printenv from php
which is called by your webserver. It looks like the user under which
the webserver is running has different bash setting.

---
http://twitter.com/aHeissenberger

gabe

unread,
Sep 23, 2009, 4:33:42 PM9/23/09
to fredistrano-discuss
i am getting TOD w/ the service provider, too!

i get the same thing w/ your script:

/home/myusername/bin/bin/svn: symbol lookup error: /home/myusername/
bin/bin/svn: undefined symbol: apr_hash_clear
Array

what does that even mean?

gabe

unread,
Sep 23, 2009, 4:35:57 PM9/23/09
to fredistrano-discuss
@Andreas: i know for sure that it does but my hosting service support
already told me that i can't change bash settings for the webserver...

On Sep 23, 2:44 pm, Andreas Heissenberger <andr...@heissenberger.at>
wrote:
> Do a printenv on the commandline and compare it to a printenv from php  
> which is called by your webserver. It looks like the user under which  
> the webserver is running has different bash setting.
>
>   ---
>  http://twitter.com/aHeissenberger
>

Andreas Heissenberger

unread,
Sep 23, 2009, 7:22:22 PM9/23/09
to fredistra...@googlegroups.com, fredistrano-discuss
But you could add the missing env settings on the commandline before
you call the svn command.

Create a bashfile with the content of printenv on your cmdline and the
svn command. Call this script from your webserver.

---
http://twitter.com/aHeissenberger

euphrate_ylb

unread,
Sep 24, 2009, 3:48:40 AM9/24/09
to fredistrano-discuss
Indeed, this is similar to what we are doing to run fredistrano on
Windows. All shell commands are prefixed to be excuted in a powerfull
cygwin environment (see commands.php : ShellAction -> executeCommand
at http://code.google.com/p/fredistrano/source/browse/trunk/app/vendors/fbollon/commands.php).

euphrate_ylb

On Sep 24, 1:22 am, Andreas Heissenberger <andr...@heissenberger.at>
wrote:
> But you could add the missing env settings on the commandline before  
> you call the svn command.
>
> Create a bashfile with the content of printenv on your cmdline and the  
> svn command. Call this script from your webserver.
>
>   ---
>  http://twitter.com/aHeissenberger
>
> >>>>>>>> know about)?- Hide quoted text -
>
> - Show quoted text -

gabe

unread,
Sep 24, 2009, 10:27:32 AM9/24/09
to fredistrano-discuss
thx so much for your help, guys! i've been struggling w/ this for 2
weeks now...

forgive my ignorance of unix commands, unix scripting, and
subversion... i think i understand what you guys are suggesting, but
to be honest, i'm sure how to go about it. i see what's happening on
line 256 of commands.php where for cygwin, bash.exe is executed w/ the
login switch. is there something i can do like that to set the path
variable in unix before it executes the svn commands? and what should
i be setting it to (should it be the same as i am using for the svn
command i.e. ~/bin/bin/)?

thx again,
gabe



On Sep 24, 3:48 am, euphrate_ylb <yann.leble...@gmail.com> wrote:
> Indeed, this is similar to what we are doing to run fredistrano on
> Windows. All shell commands are prefixed to be excuted in a powerfull
> cygwin environment (see commands.php : ShellAction -> executeCommand
> athttp://code.google.com/p/fredistrano/source/browse/trunk/app/vendors/...).

euphrate_ylb

unread,
Sep 24, 2009, 12:15:20 PM9/24/09
to fredistrano-discuss
As Andreas suggested (correct me if i am wrong), you may try something
like this:

1. Log via ssh to your host provider

2. Type something like
$ printenv > svnTest.sh
or
$ set > svnTest.sh

3. Add as a first line of svnTest.sh your preferred shell interpreter
#!/bin/bash

4. Add as a last of svnTest.sh the svn command you are struggling with
svn export --non-interactive file:///home/myusername/svn/projectname/trunk
/full/path/to/tmpDir 2>&1

5. Change execution mode of svnTest.sh
$ chmod 711 svnTest.sh

6. Execute the script with your current user
$ ./svnTest.sh

7. Adjust the script so that it works locally (forgive me for my
mistakes)

8. Try to execute the script via the web server
<?php
echo(shell_exec('~/svnTest.sh 2>&1'));
?>

Hope it helps.

euprhate_ylb
> > > - Show quoted text -- Hide quoted text -

gabe

unread,
Sep 24, 2009, 1:39:00 PM9/24/09
to fredistrano-discuss
that worked! so how do i incorporate that w/ fredistrano?

euphrate_ylb

unread,
Sep 25, 2009, 4:55:49 AM9/25/09
to fredistrano-discuss
If we want to find a simple and generic solution for fredistrano, your
SVN shell command should look like this:

PREFIX. svn export --non-interactive file:///home/myusername/svn/projectname/trunk
/full/path/to/tmpDir 2>&1 . SUFFIX

Therefore your target (and mine as well) is create a script that will
produce the same result as "svnTest.sh". At first glance, I see 2
possiblities:

1. A script that initializes your environment:

<?php
echo(shell_exec('~/initEnvironment.sh; svn export --non-interactive
file:///home/myusername/svn/projectname/trunk /full/path/to/tmpDir
2>&1'));
?>

To be accessible for the entire environment, script variables must not
only affected but also 'exported' or 'set'.

2. A script that runs internally a given command:

<?php
echo(shell_exec('~/runCommand.sh "svn export --non-interactive
file:///home/myusername/svn/projectname/trunk /full/path/to/tmpDir
2>&1"'));
?>

Very similar to svnTest but with much more generic.

Does it make sense?


euphrate_ylb

gabe

unread,
Sep 29, 2009, 3:24:47 PM9/29/09
to fredistrano-discuss
ok, so i was unable to get this to work using a script. i still
received an error. i did finally get it to work just doing the export
command as the command prefix.

config.php
$config['Subversion'] = array(
'user' => null, //default subversion login
'passwd' => null, //default subversion password
'configDirectory' => null, //default subversion configuration
directory
'parseResponse' => true, //activate the command response parsing
'commandPrefix' => 'export PATH="executable/path1:executable/path2";
' //string value command(s) to run before svn commands
);

command.php:
$command = Configure::read('Subversion.commandPrefix')."svn checkout --
non-interactive $configDirectory $revision $authentication $svnUrl
$targetDir 2>&1";

i got this to work for me!

any thoughts on my solution?

thx,
gabe
> ...
>
> read more »

euphrate_ylb

unread,
Oct 10, 2009, 8:03:37 AM10/10/09
to fredistrano-discuss
Glad you made it... So now, fredistrano is up and running in your
environment.

Concerning this issue, I'll try to find something a little bit more
generic.

euphrate_ylb
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages