What permission and ownership does the log file have?
Permission Denied on storage/logs when deployed to rhel/apache instance
I'm super stumped here after spending several hours troubleshooting.
I have a Laravel 11 app that I'm moving from a Centos 7 box to a RHEL EC2 instance. In both cases, the app is served by apache/httpd. When I hit the instance IP (which is temporarily exposed publicly), I get a Laravel error page that says:
The stream or file "/var/www/${REPO_NAME}/storage/logs/laravel-2024-07-09.log" could not be opened in append mode: Failed to open stream: Permission denied
The message generally repeats, though at the bottom of the stack I have an exception about trying to write to a session file (this is configured to use file based sessions right now, but I am going to change that).
The entire repo is owned by the apache user and group on this instance and I have done a chmod -R 755 on the entire repo (I started off doing this only to the storage directory recursively). I'm at a loss here. httpd is running as apache:apache as well.
The apache config is pretty straightforward with a single virtual host on port 80 (SSL is handled upstream by a network load balancer) with the document root pointing at the public folder in the Laravel repo.
Anyone have any suggestion for things I may be missing here?
Please or to participate in this conversation.