Version 4 (modified by robert, 3 years ago)

--

FTP Batch Installation

In order to use the MediaMosa bulkupload facility your system should run a FTP Server to allow users to upload their data to your server using FTP.

A watcher-program (watcher) monitors the upload directory and invokes xml-parser, the program responsible for the actual processing of the uploaded data.

These instructions assume that you are using Debian Linux, ProFTPD and a MySQL database to store the relevant user-data.

ProFTPD

To install the required packages issue the following command (with root privileges):

apt-get install proftpd proftpd-mod-mysql

During the ProFTPd configuration, choose 'standalone' is acceptable for most installations.

Now create required group and user (with root privileges);

groupadd -g 200 ftpgroup
useradd -u 200 -s /bin/false -d __HOMEDIR__ -c "proftpd user" -g ftpgroup ftpuser
groupadd -g 60001 nas
useradd -u 60001 -g nas nas

Replace the __HOMEDIR__ with the path to the directory where you want to place the FTP-users' home-direcotries and the newly created user has write-access to this directory.

Create a new file called /etc/proftpd/mediamosa_proftpd.conf (with root) and add the following text;

ServerName                      "Batchupload MediaMosa"

DefaultRoot                     ~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
RequireValidShell               off

# Set the user and group that the server normally runs at.
User                            www-data
Group                           nas

DebugLevel 1
<IfModule mod\verb!_!sql.c>
SQLBackend                      mysql
# userid van www-data
SQLMinID                        33
SQLDefaultUID                   33
# groupid van nas
SQLDefaultGID                   60001
#SQLHomedirOnDemand             on
SQLAuthenticate                 users
SQLAuthTypes                    OpenSSL

## databasename@host database_user user_password

SQLConnectInfo     mediamosa@host user password
SQLUserInfo        mediamosa_ftp_user userid passwd uid gid homedir shell
SQLUserWhereClause "active=1"

## create a user's home directory on demand if it doesn't exist
#SQLHomedirOnDemand      on
CreateHome      on 777

SQLLog             PASS updatecount
SQLNamedQuery      updatecount UPDATE "count=count+1, accessed=now() WHERE  userid='%u'" ftpuser

SQLLog             STOR,DELE modified
SQLNamedQuery      modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
</IfModule>

Make sure you change the SQLConnectInfo with the correct MySQL user connection.

Now edit /etc/proftpd/proftpd.conf and add the following line at the end of the file;

Include /etc/proftpd/mediamosa_proftpd.conf

To make your changes to take effect, you need to restart the FTP server;

/etc/init.d/proftpd restart

XML-parser

The next step is to install xml-parser by running (with root privileges):

dpkg -i vpx-xp_1.0.3_i386.deb

and apply the following changes to /user/local/xml-parser/settings.php:

define("VPX_HOST",               "localhost");
define("VPX_URL_PREFIX",         "");
define("SAN_NAS_BASE_PATH",      "__HOMEDIR__");

Also replace __HOMEDIR__ with the path to the previously defined upload-directory.

Watcher software

Finally you need to install and run the watcher software. This software will detect any changes in the ftp-upload directory and control the the processing of the uploaded files.

As the watcher-software uses gaminlib0 you will have to install this library first. Using root-privileges run:

apt-get install gamin gaminlib0

after that you can install the watcher-software itself:

dpkg -i vpx-dw_1.0.1_i386.deb

Finally you will have to the following changes to /opt/local/etc/watcher/watcher.conf

# The user and group id of the daemon
ServerId = 33:60001

# The script that will handle created files
Handler = /var/opt/local/xml-parser/process.php

# Base directory under which user subdirectories will be added.
BaseDir = __HOMEDIR__

Attachments