Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file permissions between ftp and php with joomla

Status
Not open for further replies.

linpi

Programmer
Mar 10, 2009
4
0
0
DE
I have a linux server with apache and use it as a web server with often the CMS Joomla (php) for me and some friends. With joomla it possible to upload & install components & modules to exdend joomla. The problem is that every installed component with joomla (over php) has the user & group of apache ( on debian). That means the user over ftp has no permissions the change anything from these files. If I change the owner & group of these files/directories to the ftp user, apache has no permissions anymore.... etc. I can not make both happy. The problem is mainly for my friends who don't have root access and can not make a chown of files & directories.

All my home pages are in VirtualHost. I use Apache version 2.2.3 and mod_php5 5.2 (Debian etch)
 
add all your friends to the group apache. Users can belomg to more than one group. In this case their second group will be apache.

 
I forgot to mention that you will also have to give group both read and write permissions if you want them to be able to upload to that directory.
 
actually I already put the apache group in my friend's ftp group and put the permissions to 775. of course I could do it the opposite way I you say. I doesn't resolve that the file's owner belong to apache.
Maybe I could also do GID 2775 and additionally add the ftp group to the apache group...
I have seen provider where the owner & group stays always the owner & group of the ftp user even after installing a module over the browser (over php)
 
the sticky? the sticky bit is for /tmp (1777) and will not work for I need. every file keeps is own user&group in a common folder, that's all.
 
It's not trivial, but you could run php as fastcgi and use suexec.
You specify your suexec user in your vhost containers and all php scripts should run as that user if you set up correctly and if that user is the same as your FTP user, you should resolve any permission problems.

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
Wow, thank you a lot. As you say, it's not trivial but it is the right way. I found some tutorials how to set fastCGI/fcgid with debian. I just have to be extremely careful to no crash my apache server (too often and too long)....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top