Question: What ownership does Apache need so that it does not require execute permissions for the world on public_html (751)?
Background: When I changed the php.ini settings through cPanel, there was an error "Error: The EUID, 1005, does not own /home/my_user_name/public_html/.htaccess." I understood this because it was the .htaccess file was owned by root:root,
So, as a green SHELL user I changed the ownership of every file using chown -R my_user_name:my_user_name .[^.]*. Sweet, I could now save my php.ini through MultiPHP INI in cPanel.
That's when this pretty error appeared when trying to visit any page on my Drupal 8 site:
Forbidden You don't have permission to access / on this server. Server unable to read htaccess file, denying access to be safe
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Even after deleting, reuploading, and changing the ownership back to root:root, it didn't work.
The only thing that worked was changing public_html to 751 (instead of 750). Why does Apache need the execute permissions for the world? And which owner/group do I need to change it to fix it?
754 also didn’t work
www-datauser, at least if it is a debian-based system. If not, you can check the user with aps uxa|grep httpd. This user need to have access. Alternatively, you can use the somehow forgotten mpm-itk to be able to specify a different user for any virtual hosts.o+xmeans that everybody can enter it. You can also specify more detailed permissions with acls,man setfaclorman getfacl.suhim.su www-data -s /bin/bashis the command. Then you have a shell in the name of the apache. If you want to download any file with http, your apache need to be able to enter into its directory, and read that file. So,cd,ls,cat, and you will know, where is really the problem.