[SOLVED] Strange permissions issue with files in Apache.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having issues with directory listings in Apache on a CentOS 6 (x64) box.
The scenario:
I'm logged into the server as root, and am in the /var/www/html/mydir directory.
I've downloaded a file using wget from another server, but the file does not show in a directory listing when viewed from a browser.
The file permissions look to be good, and changing them to 777 does not help, however doing a cp filename newfilename against this file creates an identical copy that IS visible in a directory listing. The file permissions and ownership look identical, and I cannot see any difference between the two files. Am I missing something here?
The file permissions look to be good, and changing them to 777 does not help, however doing a cp filename newfilename against this file creates an identical copy that IS visible in a directory listing. The file permissions and ownership look identical, and I cannot see any difference between the two files. Am I missing something here?
What happens if you try to GET the file directly, like: http://myhost/mydir/filename
BTW you should use 644 for the files in the webserver and 755 for directories
So if I try a direct on the files, I get a 403 Forbidden (as expected):
You don't have permission to access /mydir/myfile.zip on this server.
Furthermore, I tried a known non-existent file, and received a 404 as I'd expect.
Also, to your point about permissions, 644 is what I have for the files - I gave 777 as an example to show that even the most permissive mode resulted in failure. File permissions are as below:
-rw-r--r--. 1 root root 361482835 Mar 25 12:09 myfile-copy.zip
-rw-r--r--. 1 root root 361482835 Mar 25 12:37 myfile.zip
Also I did an md5sum, and the checksums came up identical.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.