Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Sep 24, 2011 10:29 am 
Offline
Newbie

Joined: Mon Jun 06, 2011 10:51 am
Posts: 3
What's the best way to set up lighttpd and FastCGI to run PHP scripts as the file's owner on Debian 6? I need to run separate WordPress blogs that are are able to write to their respective directories. I've already created the users, their web roots, and simple vhosts. Now what?

Thanks in advance.


Top
   
 Post subject:
PostPosted: Sat Sep 24, 2011 10:54 am 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
By their owner, are you referring to files that are owned by different users on your Linode?

If so, there are two possibilities. One is to set the group ownership of the files to lighttpd's group, and set the user ownership of the files to whichever user that you want to own that site. For example, if lighttpd is assigned to group www-data, and you have a user called user1, the files for user1's site would still be owned by user1, so he can still access and modify his files directly, but the group ownership would be www-data. You would then allow the www-data group to have read and execute permissions on the files, and you would also allow write permission to www-data for the upload directory (if any) if you want to allow people connecting to the site to upload stuff. This will, of course, allow your users to add malicious php files to their web site directories, so you have to be careful.

The other way to do this is to set the user ownership to lighttpd's user, but to change the group instead. You can either have one group per user, and assign ownership of each site to their respective groups, or you can create a single group, for example wpusers, and add all your users to the wpusers group. Then you can change the group ownership of any wordpress directory to wpusers and assign the necessary read, write, and execute permissions that way. This method not only allows your users to upload malicious php files, they can mess with each other's sites if you use this method, so this method is less secure than setting the ownership on a per-user basis.

_________________
Kris the Piki Geeker


Top
   
 Post subject:
PostPosted: Sat Sep 24, 2011 1:50 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
My usual approach is to start a separate set of PHP handlers for each user... basically, copy what you did to get it going the first time, but change the username and (socket or port) on each copy.

You'll probably want to decrease the number of children spawned by each instance, as well -- your RAM usage will be dictated by the total number of children across every instance.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group