Good point, Ale. chmod a+r works if the deploy user and www-data share the same group. I've seen issues where newly created files during deploy don't inherit the parent directory permissions though setting the setgid bit (chmod g+s /var/www/html/) on the directory helps ensure consistent group ownership for new files.
Best, Vahid From: Alessandro Vesely <[email protected]> Date: Monday, 2 March 2026 at 10:47 PM To: [email protected] <[email protected]> Subject: Re: [users@httpd] Diagnosing HTTP 401 and 403 Errors in Apache — Common Misconfigurations Thanks for the heads up. On Mon 02/Mar/2026 10:52:54 +0100 Vahid Shaik wrote: > 2. Incorrect ownership after deployment — after deploying with rsync or git > pull, file ownership changes to the deploying user instead of www-data. Files > are readable by the owner but not by the Apache worker process. Fix: chown -R > www-data:www-data /var/www/html/ after every deploy. Should be enough also to chmod -R a+r /var/www/html/ methinks. Best Ale -- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
