Reputation: 3207
I have an ubuntu server 11.10 with apache 2.2.20, php 5.3.6 and an installation of Joomla cms. I have used an extra hard disk as my web server storage and mounted it into /data/www/ (I hope it's not where my problem us!).
I've set permission of all files and folders in my web root to 755 and user groups for them is set to [default ubuntu user(in my case radio)]:www-data.
In past days I had serious problems with joomla not showing new uploaded images and other files and also I can't install any extensions. After hours of searching I found out that uploaded files don't have appropriate permission (they are -rw-------) and Joomla application cannot read, copy or move them after upload.
I’m wondering how can I set a default permission so all files that I upload use it?
PS: I’ve tested umask but it did nothing. I think it has nothing to do with my problem.
Upvotes: 0
Views: 4241
Reputation: 3207
Thanks for your answer.
After hours of research and trying, I managed to solve my problem by disabling FTP (I've used vsftpd) and adding umask to apache configuration, not to php files. Now everything is working fine and all chmods are ok (755).
BTW: I don't know why it was uploading files with minimum access.
Upvotes: 0
Reputation: 618
I actually am having the same issues. Im using a plesk shared hosting. Ive done about 20 hours of research and have come up with a few answers as to what needs to be done. First off anything handled by apache is automatically given to the apache user group. Which is fine...the issue is that apache handles php as a module and therefore cannot be changed once an action is performed through apache using php. The fix that worked best for me is changing php and apache to perform using fast cgi and then changing the default permissions assigned by apache once an upload is made.
the second rout you can take is to chown everything and then do installs using ftp. The primary issue ive ran into using this method is that because joomla uses apache when executing commands through php....is that any new files added using ftp as the installer will give permissions through it effectively not allowing apahe/php to make any changes to it unless the files are given 777 permissions which is a security issues.
It kind of works like this....as an example. You install a component via ftp. Because the ftp username is now assigned as the owner. Apache is not considered apart of the user group or the owner. therefore if you want to make changes using joomla...it has to be assigned 777 permissions. I found this out because I figured I would just chown everything to my ftp and when i went back into joomla and went to system info....it said everything was now unwritable.
Hope this helps you...youll just have to look around to see what works best.
Upvotes: 1