Linux file permissions

cyabro

Well-Known Member
Reaction score
420
Location
New Zealand
Hey,

I'm just busy trying to setup our PC Repair Tracker site and everything has been going well until I tried to replace the default printable logo file.
For those that use PCRT this file is logoprintable.png and it lives in the /repair/images and /store/images folders.

Since then I am unable to view this file in a browser and all I get is this error:

Forbidden

You don't have permission to access /repair/images/logoprintable.png on this server.

I've checked the file permissions and they are the same as all the other image files, in the same folder, and I can view them no problem.
I've tried uploading the file again and also putting back the original but the problem still exists.
Everything else in PCRT appears to be working as it should.

This looks like a file permissions problem as opposed to a PCRT problem so that's why I'm posting here and hopefully someone with more Linux knowledge than me, which is almost none :D, will be able to help.

What else can I try?

This is running on a Linux CentOS virtual machine hosted on Windows Azure as we get some free use being a Microsoft Cloud Partner.
 
Just a guess as I have no knowledge in regards to PCRT, But if the permissions are correct (the same as the others) maybe it's a browser issue instead. Have you tried clearing the cache and restarting the browser?
 
Yes all files say root & root and all the permissions are the same on all files: -rw-r--r--

This one is really doing my head in!

I just tried deleting the file completely and uploading again and problem is still there.
I had been just overwriting the file before.
 
Last edited:
Like I mentioned, I am ignorant of PCRT. But, how are these images being served to your browser? Are you just viewing the files directly, via samba, nfs, http? Maybe you just need to restart that service to refresh the permissions.
 
What are in the apache access and/or error logs at the moment you try to access that image.

The file permissions should be 644 (I think) but chmod 755 or even 777 as just a test and see what happens.
 
Like I mentioned, I am ignorant of PCRT. But, how are these images being served to your browser? Are you just viewing the files directly, via samba, nfs, http? Maybe you just need to restart that service to refresh the permissions.

I have restarted the server and it made no difference.

What are in the apache access and/or error logs at the moment you try to access that image.

The file permissions should be 644 (I think) but chmod 755 or even 777 as just a test and see what happens.

I have tried that, as Luke suggested it as well and it made no difference.

The apache error log shows:
(13)Permission denied: file permissions deny server access: /var/www/html/store/images/logoprintable.png

Just for kicks, try changing the ownership of the file to the "apache" user and group:

Code:
chown apache:apache /repair/images/logoprintable.png

Made no difference. :(

Edit: It's suddenly working now!
Not sure what I did to fix it but hey I'm not going to mess with it again.

Thanks for all the suggestions!
 
Last edited:
Just did some quick checking and it looks like deleting the file and then uploading the new one is the way to do it rather than just overwrite the existing file.
 
Back
Top