Difference between revisions of "OS4X Enterprise - Fetch files from (S)FTP server"

From OS4X
Jump to navigation Jump to search
Line 12: Line 12:
 
In this example, the following attributes are used:
 
In this example, the following attributes are used:
 
*User running OS4X: "<code>www-data</code>", group "<code>www-data</code>".
 
*User running OS4X: "<code>www-data</code>", group "<code>www-data</code>".
*target mount point for FTP directory: <code>/mnt/ftp/server1</code>
+
*Target mount point for FTP directory: <code>/mnt/ftp/server1</code>
 +
*Target FTP server: 192.168.20.71, username "<code>os4x</code>", password "<code>os4x</code>"
  
 
== Install required packages ==
 
== Install required packages ==

Revision as of 09:34, 27 May 2014

Under construction!!!

OS4X offers an easy way to create OS4X Enterprise receive jobs from FTP server content. This solution is based on two mechanisms:

  • Mount remote server directory as a local directory
  • Configure the OS4X Directory Scanner to that mounted directory

This documentation covers all technical aspects to implement a functionality to automatically fetch new files from an (S)FTP server.

Assumption

All details explained here are based on the freely available pre-installed OS4X VMware virtualized image, which is also available for other virtualization solutions via OVA. In general, all solutions explained here can be used in any modern Linux environment. All steps explained here must be executed as user "root" unless any other documentation states to switch user context.

In this example, the following attributes are used:

  • User running OS4X: "www-data", group "www-data".
  • Target mount point for FTP directory: /mnt/ftp/server1
  • Target FTP server: 192.168.20.71, username "os4x", password "os4x"

Install required packages

You need to install the following packages for (S)FTP mounting:

apt-get -y install sshfs curlftpfs

Change user group membership

The user running OS4X (configured in "Configuration" -> "Daemon" -> "Run OS4X programs as user") must be added in the user group "fuse":

adduser www-data fuse

Change permissions of /dev/fuse

By default, the required device file "/dev/fuse" is only writable by user "root". We need to extend the permissions:

chgrp fuse /dev/fuse
chmod g+rw /dev/fuse

Create target mountpoint

The FTP target directory must be mounted somewhere into the local filesystem to be readable by OS4X. You may use any (in best case empty) directory. We need this directory name later for the configuration of the OS4X directory scanner. The owner of the target directory must be the configured user running OS4X):

mkdir -p /mnt/ftp/server1
chown www-data.www-data /mnt/ftp/server1