PDA

View Full Version : Upload script & permissions with the 'apache' user



S2S-Robert
11-24-2003, 09:56 AM
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.

DirectAdmin Support
11-24-2003, 10:25 AM
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

redunix
05-28-2010, 06:04 AM
There is no other solution for this yet? Using suphp uploaded files true the web end up with apache:apache.

daveyw
05-28-2010, 06:29 AM
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.

DirectAdmin Support
05-28-2010, 12:37 PM
Hello,

My last response in this thread was 7 years ago.
Always check the Knowledge Base (http://help.directadmin.com) for usage questions like this.

http://help.directadmin.com/item.php?id=197

John