Background: I'm running a CentOS VM with Apache installed. The web root is "/var/www/html". There is a subdirectory ("/var/www/html/mp3") which has two mp3's in it. Both mp3's have exactly the same permissions (644). The "/mp3" directory has 755 permissions. I have a database which holds certain information on the songs, and the goal is ultimately to be able to enter search terms and have a php script which returns songs that have those keywords in them, and allow you to play them. I am using the default "httpd.conf" configuration.
Issue: I can only see one of the songs. When /mp3 is accessed you get a directory which has only "MasterOfPuppets.mp3"; it does not show "One.mp3". When you access "/mp3/MasterOfPuppets.mp3" it will allow you to play the song; when you access /mp3/One.mp3 it shows 403: Access Forbidden. I'm almost confident that this is a permissions issue, but given that the permissions are exactly the same for both files I have absolutely no idea how this could happen.
Does anybody have any idea whatsoever as to what could be causing this problem? I've been banging my head against the wall for the past 3 hours. Google has failed me.
[root@dugan mp3]# ls -lrtZ *mp3 -rw-r--r--. root root unconfined_u:object_r:home_root_t:s0 One.mp3 -rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 MasterOfPuppets.mp3
It was a SELinux problem. I found documentation here: Here
in the "/mp3" folder I entered "chcon -t httpd_sys_content_t One.mp3" and did another another "ls -lrtZ *mp3", which got me this:
-rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 One.mp3 -rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 MasterOfPuppets.mp3
Problem solved, I can now access One.mp3. SELinux is best Linux. Thanks for the help all.