I have a problem that I have been looking for a solution for for a long time and I still haven't found.
I use Apache with the userdir module and somehow isolate each site/application in its respective $HOME.
However, I have two types of platforms that are escaping this "isolation", which are sites made with Wordpress and Laravel.
For Wordpress I need to give Apache (www-data) write permission for the "wp-content" folder, and for Laravel I need to give write permission for the "vendor" and "storage" folders.
This is an example:
[php:error] [pid 99340] [client 175.xxx.xxx.xxx:15954] PHP Fatal error: Uncaught ErrorException: file_put_contents(/var/www/user/public_html/storage/framework/views/3e2d446afa85e2bbfa14dffb12f4a2a7a3423ced.php): Failed to open stream: Permission denied in /var/www/user/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:190 By not granting write permission to the Apache user (www-data) I get a "500" error when accessing the site.
My intention is to not allow the Apache user to have write access to these folders, but to allow the user assigned to that $HOME to have write access.
Is there any way this can be done?
Thanks.