| | 24 | 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. |
| | 25 | |
| | 26 | Create a new file called /etc/proftpd/mediamosa_proftpd.conf (with root) and add the following text; |
| | 27 | |
| | 28 | {{{ |
| | 29 | ServerName "Batchupload MediaMosa" |
| | 30 | |
| | 31 | DefaultRoot ~ |
| | 32 | |
| | 33 | # Users require a valid shell listed in /etc/shells to login. |
| | 34 | # Use this directive to release that constrain. |
| | 35 | RequireValidShell off |
| | 36 | |
| | 37 | # Set the user and group that the server normally runs at. |
| | 38 | User www-data |
| | 39 | Group nas |
| | 40 | |
| | 41 | DebugLevel 1 |
| | 42 | <IfModule mod\verb!_!sql.c> |
| | 43 | SQLBackend mysql |
| | 44 | # userid van www-data |
| | 45 | SQLMinID 33 |
| | 46 | SQLDefaultUID 33 |
| | 47 | # groupid van nas |
| | 48 | SQLDefaultGID 60001 |
| | 49 | #SQLHomedirOnDemand on |
| | 50 | SQLAuthenticate users |
| | 51 | SQLAuthTypes OpenSSL |
| | 52 | |
| | 53 | ## databasename@host database_user user_password |
| | 54 | |
| | 55 | SQLConnectInfo mediamosa@host user password |
| | 56 | SQLUserInfo mediamosa_ftp_user userid passwd uid gid homedir shell |
| | 57 | SQLUserWhereClause "active=1" |
| | 58 | |
| | 59 | ## create a user's home directory on demand if it doesn't exist |
| | 60 | #SQLHomedirOnDemand on |
| | 61 | CreateHome on 777 |
| | 62 | |
| | 63 | SQLLog PASS updatecount |
| | 64 | SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser |
| | 65 | |
| | 66 | SQLLog STOR,DELE modified |
| | 67 | SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser |
| | 68 | </IfModule> |
| | 69 | }}} |
| | 70 | |
| | 71 | Make sure you change the SQLConnectInfo with the correct MySQL user connection. |
| | 72 | |
| | 73 | Now edit /etc/proftpd/proftpd.conf and add the following line at the end of the file; |
| | 74 | {{{ |
| | 75 | Include /etc/proftpd/mediamosa_proftpd.conf |
| | 76 | }}} |
| | 77 | |
| | 78 | To make your changes to take effect, you need to restart the FTP server; |
| | 79 | {{{ |
| | 80 | /etc/init.d/proftpd restart |
| | 81 | }}} |
| | 82 | |
| | 83 | === XML-parser === |
| | 84 | |
| | 85 | The next step is to install xml-parser by running (with root privileges): |
| | 86 | |
| | 87 | dpkg -i vpx-xp_1.0.3_i386.deb |
| | 88 | |
| | 89 | and apply the following changes to /user/local/xml-parser/settings.php: |
| | 90 | {{{ |
| | 91 | define("VPX_HOST", "localhost"); |
| | 92 | define("VPX_URL_PREFIX", ""); |
| | 93 | define("SAN_NAS_BASE_PATH", "__HOMEDIR__"); |
| | 94 | }}} |
| | 95 | Also replace __HOMEDIR__ with the path to the previously defined upload-directory. |
| | 96 | |
| | 97 | === Watcher software === |
| | 98 | |
| | 99 | Finally you need to install and run the watcher software. |
| | 100 | This software will detect any changes in the ftp-upload directory and control the the processing of the uploaded files. |
| | 101 | |
| | 102 | As the watcher-software uses gaminlib0 you will have to install this library first. |
| | 103 | Using root-privileges run: |
| | 104 | |
| | 105 | apt-get install gamin gaminlib0 |
| | 106 | |
| | 107 | after that you can install the watcher-software itself: |
| | 108 | |
| | 109 | dpkg -i vpx-dw_1.0.1_i386.deb |
| | 110 | |
| | 111 | Finally you will have to the following changes to /opt/local/etc/watcher/watcher.conf |
| | 112 | {{{ |
| | 113 | # The user and group id of the daemon |
| | 114 | ServerId = 33:60001 |
| | 115 | |
| | 116 | # The script that will handle created files |
| | 117 | Handler = /var/opt/local/xml-parser/process.php |
| | 118 | |
| | 119 | # Base directory under which user subdirectories will be added. |
| | 120 | BaseDir = __HOMEDIR__ |
| | 121 | }}} |