cancel
Showing results for 
Search instead for 
Did you mean: 

WCM FTP deployment

rscheele
Champ in-the-making
Champ in-the-making
Hello,

i have some web space where i can upload files using ftp. Using Alfresco Deployment, i can define a File Server Receiver (FSR) which connects to a remote server using RMI. I don't understand RMI and i wouldn't know if my web server supports it, but the most obvious way for me would be to connect with FTP. Can i do that somehow with Alfresco Deployment? I have read through the wiki and search the forums but couldn't find anything about it.
12 REPLIES 12

pmonks
Star Contributor
Star Contributor
The FileSystem Receiver is a separate process that would be installed on your web server.  It acts as an RMI server and the main ("authoring") instance of Alfresco connects to it (as an RMI client) whenever deployment is initiated.

There's an enhancement request in JIRA to allow the over-the-wire protocol used for deployment to be pluggable (see http://issues.alfresco.com/browse/ETWOTWO-436), but I don't think FTP would be sufficient (deployment requires more than just remote file I/O APIs, which is all that FTP provides).

Cheers,
Peter

pmonks
Star Contributor
Star Contributor
That said, you could implement a custom FSR deployment runnable that acts as an FTP client and pushes deployment deltas over to an FTP server.  In this model the FSR itself doesn't have to run on your web server (it would probably run on the same server as the Alfresco authoring instance).

The interface you'd implement to do this is called "FSDeploymentRunnable".

Cheers,
Peter

pmonks
Star Contributor
Star Contributor
And just to follow up again (last time, I promise!  :winkSmiley Happy, you actually don't have to write Java code to do this.  FSRs can invoke custom shell scripts, so you could simply write a shell script that invokes an FTP client, providing it with the FTP commands (put, mkdir, delete, etc.) equivalent to the operations listed in the deployment delta's manifest.

Cheers,
Peter

rscheele
Champ in-the-making
Champ in-the-making
Thnx for your helpful words. I don't fully understand why deployment should be more than file transfer in some occassions, eg mine where i just place the web content on the www root of my web server. I only have file access, how should i setup that interface? I do not have root access to that server (virtualised web server)

pmonks
Star Contributor
Star Contributor
The Alfresco deployment functionality only sends deltas (ie. files that are new, updated or deleted since the last deployment) and in order to calculate the delta it needs to know which revision (if any) the target (whether an ASR or FSR) is currently at.  FTP (and other file transfer oriented protocols) don't support that kind of "API call", so they can't be used (at least not exclusively) for deployment.

Based on your description, I'd go with the "FSR + custom shell script" approach.  You'd install an FSR on the same server as the Alfresco authoring instance and configure it to call your custom shell script whenever deployment is initiated.  The shell script would read the deployment manifest (which describes the delta that's being deployed as a list of file / operation pairs) and then perform the equivalent FTP operations against the (remote) web server machine.  The net result is that the web server machine doesn't need anything more than an FTP server running on it in order to support deployment.

It would also be fantastic if you could submit the shell script back to the community once you've implemented it (since it should be pretty reusable).  Probably the best place to put it is the "wcm-deployment" forge project (http://forge.alfresco.com/projects/wcm-deployment/) - I can set you up with commit privileges for that project if you'd like.

Cheers,
Peter

boneill
Star Contributor
Star Contributor
Does anyone know if the custom shell script for FTP deployment using an FSR ever get written.  I currently have a requirement for the same functionality (FTP changed pages to a site hosted by an ISP).    Or, is there a new way to do this since this post.

tommorris
Champ in-the-making
Champ in-the-making
Something that I've tried with some success is using the FSR to deploy to a local space,
and then trigger (the post-deploy trigger action is defined in a context.xml) a batch file to push the files to the remote web-server.
I'd recommend using RSync (on top of Cygwin on a Windows server) to push just the deltas, across to a listening RSync daemon.
You can execute RSync over SSL too. (Incidentally, if you're using SSL, you could use SFTP too).

pmonks
Star Contributor
Star Contributor
One of the nice things about rsync is that it uses block-level deltas, so when used on top of the directory tree deltas that Alfresco calculates you get a really specific set of deltas (only the files that are new / modified / deleted are replicated, and for updated files only those blocks that have changed are replicated).

The only thing I'm not sure about is how rsync handles deletes - if the manifest calculated by Alfresco includes a delete, does rsync correctly replicate it?

Cheers,
Peter

tommorris
Champ in-the-making
Champ in-the-making
Yes, it does handle deletes.
And you're right about the sub-file diffs.