Index: [Article Count Order] [Thread]

Date:  Wed, 30 Jul 2008 16:56:30 -0700 (PDT)
From:  Dan Kriwitsky <webhosting (at mark) yahoo.com>
Subject:  [coba-e:13643] Re: apache suexec
To:  coba-e (at mark) bluequartz.org
Message-Id:  <281900.86327.qm (at mark) web65603.mail.ac4.yahoo.com>
In-Reply-To:  <092001c8f271$eb0a0db0$967da8c0@thomasferrari>
X-Mail-Count: 13643


> Has anyone successfully managed to run apache with suexec,
> so that the 
> settings on files uploaded and created within php are owned
> by the site 
> admin for the individual sites on the system.
> 
> Now they always are owned by
> apache:apache
> 
> It should be possible to make apache/php save files so that
> they are owned 
> by
> someadminuser:site29
> 

I have a PHP script that retrieves and updates weather info from NOAA. It saves it as a .txt file for inclusion in .shtml files. The original empty .txt file was owned by the siteadmin and remain that way when the PHP script updates them.
The beginning of the PHP says:
ob_start();

The end of the script says:

$page = ob_get_contents();
ob_end_flush();
$fp = fopen("file.txt","w");
fwrite($fp,$page);
fclose($fp);


-- 
Dan Kriwitsky