Rob Hudson wrote:

> Here's a tricky question...
> 
> Summary: How do I get the FTP server and apache server to be able to
> modify the same files and directories?

Is this for ORCAS?  You guys are making web site maintenance way too
complex if it is.

If this is for ORCAS, you need to redesign your workflow.

If it's some non-ORCAS project, read on.

You could do one of several things.

1. Root could have a frequently running cron job (every five minutes?)
   that said:
        chown -R nobody.nogroup /var/www/docs/FILES

2. The PHP project-delete script could run a setuid root script
   to delete the project files regardless of permissions.  Is
   the project-delete script the only problem?

3. You could have the user FTP into a staging directory, then copy the
   files into Apache's document root.  The copy would run as the
   Apache user and would set the uid/gid.

   The copy could either be from cron every five minutes or it could
   be from a CGI (or PHP) script that's normally not invoked.

   Make sure it runs fast in the case where nothing has changed.
   E.g., rsync or something like...

        touch timestamp.new
        find /ftparea -newer timestamp | \
                perl -pe 'chomp;
                          ($x=$_) =~ s|/ftparea/||;
                          $_ = "cp $_ /var/www/htdocs/FILES/$x\n"' | sh
        mv timestamp.new timestamp

   (There are several security holes in this script - I wrote it the
   simple way to illustrate.)

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     [EMAIL PROTECTED]

Reply via email to