I have a web app in which users can see image and videos. But I'm always getting 403 Permission denied when I tried to see any image or video.
I checked the permission of the file and it's
drwxrwxrwx. 2 apache apache 4096 Jul 12 09:57 ads
drwxrwxrwx. 5 apache apache 4096 Jul 12 09:58 img
drwxrwxrwx. 3 apache apache 4096 Jul 12 09:58 programs
drwxrwxrwx. 2 apache apache 4096 Jul 12 09:58 seassons
drwxrwxrwx. 2 apache apache 4096 Jul 18 08:34 temp
drwxrwxrwx. 374 apache apache 24576 Jul 18 08:34 videos
I'm trying to open the image in those folders in a web browser when the server is httpd.
If I run the following commands everything start working but for EXISTING files... If a user upload a new file, that will get 403 again until I run again the commands.
sudo chmod -R g+r /videos
sudo chown -R apache /videos
And my httpd.config is
<Directory "/var/www">
AllowOverride All
# Allow open access:
Require all granted
Further relax access to the default document root:
Options Indexes FollowSymLinks AllowOverride All Require all granted
My OS is Centos7
The new files are created with the following permissions:
-rw-r-----. 1 tomcat tomcat 386688 Jul 18 09:14 mynewfile