Slaven Rezić > WE_Framework-0.097_03 > WE_Frontend::Publish::Rsync



Annotate this POD

Module Version: 1.16   Source  


WE_Frontend::Publish::Rsync - publish files via the rsync protocol


    use WE_Frontend::Main2;
    use WEsiteinfo qw($c);



(See also "Update" section below)

First make sure that both sides have rsync installed. Please use version 2.5.1 or better, because there are deadlock problems with older versions. Then SSH authentification should be setup. Do the following:

That is it! Now check whether the connection works. As wwwuser, type the following:

    ssh -v -l remoteuser remotehost

The first time, you will get a message whether to accept the host. Accept, and then you should be automatically logged in without prompting for a password. If not, read carefully the messages. Most likely there is a permission problem on the local or remote side. Make sure that permissions are as tight as possible for the files in .ssh, and the .ssh and home directories itself.

To check whether rsync works, do the following from the local side:

    rsync -Pv some_file remoteuser@remotehost:

Now some_file should be copied to the remote side without prompting for a password. If you have an old rsync, you have to add -e ssh to the options (but better upgrade). If you redo the operation, the copy should be done much faster, because they are no changes to be transferred. SETUP

The staging object of should be set as follows:

    # $staging->password; # not needed
    $staging->directory("subdirectory_on_remote"); # this may be empty for the home directory
    $staging->stagingext({deleteold => 0}); # set to true if old remote files should be deleted (dangerous!)


(This is not sufficiently tested)

There's no need to create a home directory for the apache user. Just create a private/public key pair:

    ssh-keygen -N "" -b 1024 -t dsa -f /tmp/id_dsa

and then

    mv /tmp/id_dsa .../webeditor/etc/id_dsa

(make sure that the etc directory is NOT web accessible)

and add to ~/.ssh/authorized_keys of the rsync/ssh user on the remove side. In the configuration the liversakey and liveuser config params has to be set:



Version 1.7 does not exclude .htaccess files anymore. Please use stagingexcept instead.


Slaven Rezic -



syntax highlighting: