#1  
Old 14th May 2008, 19:03
Baggus Baggus is offline
Junior Member
 
Join Date: May 2008
Posts: 8
Thanks: 1
Thanked 2 Times in 2 Posts
Question Changing the Apache user.

Hi,

I have a server running Ubuntu LTS 8.04 and i would like to change the user apache(+php) runs as.

Basically, the below script should return "ftpuser".
Code:
<?php
$cmd = "whoami";
$output = shell_exec($cmd);
echo "<pre>$output</pre>";
?>
And so far, i have been completely failing at doing this.

I have tried altering the /etc/apache2/envvars but this doesnt change anything, even after rebooting server or restarting apache.

<background info>
I have to do this so i can delete files apache creates through php ShellExec from an FTP client. (and php needs to be able to delete files that where uploaded through ftp with ShellExec('rm '.$filename);
</background info>

Any help would be greatly appreciated
Reply With Quote
Sponsored Links
  #2  
Old 15th May 2008, 08:40
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
 
Default

Why dont you use the group feature instead and use sguid on the directory to ensure that the files created inherit the directories group.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Statistic not working mzo Installation/Configuration 49 20th April 2011 12:19
Anything I can do against illegal login-requests? schmidtedv Installation/Configuration 17 7th November 2008 09:25
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 20:58
Ruby / FastCGI Problem Chad Server Operation 1 8th March 2008 20:38
log files cruz Technical 3 15th May 2007 14:35


All times are GMT +2. The time now is 00:49.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.