Upload script & permissions with the 'apache' user

S2S-Robert

Verified User
Joined
Jun 24, 2003
Messages
415
Location
The Netherlands
Some of my customers use upload scripts to let the public upload some files they'd like, but the problem is that once the files have been uploaded the user/group is set to apache.

This is probably because the apache runs under the apache user, but since the actual owner of the domain doesn't own them, the files aren't incorporated in the quota's, but more important, they aren't able to download or remove them.

Would it be possible to let apache run under the specified account which would make uploaded files automatically owned by the user themselves.
 
Hello,

The way they'd do that is to run their scripts from the cgi-bin. I'm assuming they're using php, so they'd either have to change their script to perl, or else add:

#!/usr/local/bin/php

To the very top of the php file. This will run the php script as a standalone script which will have ther user's permissions so the files will be saved as their own, and not apaches.

John
 
There is no other solution for this yet? Using suphp uploaded files true the web end up with apache:apache.
 
You should check mod_ruid, if you setup it correctly all files/folders that will be created with PHP have ownership of the user itself (username) and not 'apache'.

Then its also not required to chmod the directory to 777.
 
Back
Top