Article 4ZBKG Wrong perms when installing Apache2

Wrong perms when installing Apache2

by
Usalabs
from LinuxQuestions.org on (#4ZBKG)
OK, here's the big problem, I've installed headless Ubuntu server 18.04 LTS on a home server (Dell PowerEdge T710), and when I installed Apache, then PHP and all the needed modules, I noticed that apt installs Apache as root and when it configures Apache, the Apache root directories and all other sub-directories are root:root so when I upload any web files, either as HTML or PHP, they too are changed to root:root, then when I try to use a php site installer (such as SMF) which checks specific file permissions during install and does the changing via FTP, the PHP error log shows an error:-

chmod 777 attachments - Operation not permitted

So after hours of investigations, I found it's because of the user:group set to root:root of Apache's document root directory, is not allowing the FTP module to change perms, but if I manually change the user:group of the directory and it's sub-directories to www-data:www-data (using chown -R www-data:www-data /var/www/html) then it all works fine.

When apt installs and configures Apache, why doesn't is change Apache's document root directory to the proper user:group of www-data:www-data?latest?d=yIl2AUoC8zA latest?i=x3t4GioEKSA:hQGkkPjMZSo:F7zBnMy latest?i=x3t4GioEKSA:hQGkkPjMZSo:V_sGLiP latest?d=qj6IDK7rITs latest?i=x3t4GioEKSA:hQGkkPjMZSo:gIN9vFwx3t4GioEKSA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments