| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-09-2008, 03:58 PM
|
#1
|
|
Member
Registered: Feb 2008
Posts: 112
Rep:
|
Apache + Php server, file folder owners and user groups
Hello friends;
I've apache 1.3 and php5 server (CentOS 4) with proftpd.
Apache runs at User: apache, Group: web
User directories like this
/home/xxx.com/public_html (User: xxx.com, Group: web - and all subfiles,subfolders)
/home/yyy.net/public_html (User: yyy.net, Group: web - and all subfiles,subfolders)
And I've proftpd server. All users have their own ftp access to only their homes.
Everything works great. But I've two questions.
1) When i upload a file with php over apache, uploaded files owner are apache, group are web. Apache's user and group. How can i change it's owner to xxx.com or yyy.net after upload? Or is there any other solution ?
Suexec: If i run apache with site's users (xxx.com user for /home/xxx.com, and yyy.net user for /home/yyy.net) all scripts will have write and delete access at their site. So that i don't need to chmod folders to 0777 for reading and writing. Site panels (plesk, cpanel vs..) are different.
2) All sites have the same group, so i can read all files. I can access xxx.com's files from yyy.net. How can i disable this?
Last edited by Seregwethrin; 03-10-2008 at 04:36 AM.
|
|
|
|
03-11-2008, 01:39 PM
|
#2
|
|
Senior Member
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,469
Rep:
|
Quote:
Originally Posted by Seregwethrin
Hello friends;
1) When i upload a file with php over apache, uploaded files owner are apache, group are web. Apache's user and group. How can i change it's owner to xxx.com or yyy.net after upload? Or is there any other solution ?
|
In php, after uploading the file, can't you just do something like
exec('chown owner.owner filename.ext');
I know php has a chmod() that you can do, I think it also has a chgrp() / chown() filesystem library call in the PHP core?
I. e. you upload the file, then change it with PHP to another group / user that is NOT Apache's "nobody" user?
|
|
|
|
03-11-2008, 02:15 PM
|
#3
|
|
Member
Registered: Feb 2008
Posts: 112
Original Poster
Rep:
|
Yes i can do it with php but i want it automatic.
For example, editing scripts like vBulletin, IPB, Joomla for that is very difficult.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:08 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|