I've a permission problem on my dedicated webserver, but I'm not able to understand what I'm doing wrong.
- Ubuntu 14.04
- Kernel 3.19.2
- Apache 2.4.7
- PHP 5.5.9
- MySQL 5.5
(all from official repository, except for kernel. It comes from vivid repository)
I've installed apache2 and it starts with user www-data
I've set a virtualhost /home/USER1/public_html
(where ownership is USER1:USER1)
so If I install any CMS (like joomla, wordpress or phpbb) I get lots of permission problems and I'm forced to set chmod to 777 (OMG! Against common sense) in order to install one of them.
The "standard" mode for this kind of CMS is, as I understand 755 for directory 644 for files
But if I set these permissions, I cannot do anything with the cms (install anything or update it. Files will be considered unwritable). Same problem with 775
So the problem is that my webserver needs all permission to "OTHER" and not just for USER (or at least for GROUP)
In order to avoid this trouble I've added USER1 to www-data group
usermod -a -G www-data USER1
but files are still unwritable with 775 or 755. The only mode allowed still 777 (OMG it's horrible to write it 2 times in the same post :D )
What is the problem and how can I fix it?