I have a Debian Squeeze Machine with PureFTP installed.
PureFTP has a subtool called Upload-Script. This tool can be configured to be called after an upload was done via FTP. However, I can't find a way to get this script-thing running...
I want PureFTP to execute a PHP-Script after each upload.
I have configured PureFTP as follows:
- To enable the UploadScript-Functionality I have a file in /etc/pure-ftpd/conf called CallUploadScript with content "yes".
- In /etc/default/pure-ftpd-common I've made the following settings:
- UPLOADUID and UPLOADGID I'v tried setting it to the UID's/GID's of root and the ftpuser - neither of both worked.
- Set the path to the UPLOADSCRIPT to be called after each upload.
When I restart the ftp-server with /etc/init.d/pure-ftpd restart - the output is as follows:
Restarting ftp server: Running: /usr/sbin/pure-ftpd -l puredb:/etc/pure-ftpd/pureftpd.pdb -l pam -E -8 UTF-8 -O clf:/var/log/pure-ftpd/transfer.log -P *IP-REMOVED-FOR-PRIVACY* -A -Y 2 -o -u 1000 -p *PORT-RANGE-REMOVED-FOR-PRIVACY* -c 60 -d -X -B
Restarting ftp upload handler: pure-uploadscript.
So the PureFTP is compiled with the whole upload-script-stuff...
Here a few steps/things I've already tried:
I thought that maybe it's because of PHP that it doesn't work. So I defined a Shell-Script to make a test-output to a file in /tmp-folder. But nothing happened after an upload - the script wasn't executed.
Originally, the script to be called resided in /opt/uploadscript/script.php
So I thought, maybe if I put the script within the same webfolder where the ftpuser is uploading something, it might work (maybe because of some chroot-restrictions). So I put the uploadscript-folder into /var/www/vhost/domain.com/httpdocs/ which is the home-directory of the ftp-user. But still - nothing happenend after an upload.To ensure that it is not a bug in my php-script, I replaced the original php-script by a testscript which just outputs a testfile created with touch() with the current date as filename. A shell-script doing the same didn't work either. Both scripts called from command line directly work perfectly.
Do you have any suggestions, what else I could try or am I even missing something essential?