10
2
On an EC2 instance I have changed Apache's log location to a different directory than the default. This is so that I can hold the logs on a (non-boot, only data) EBS.
However, I can't cd
into the logs directory. It belongs to my user and has read permissions for everyone. I can't cat
the logs either (although with sudo it works and I can see that Apache is logging just fine).
$ ls -lh
total 4.0K
drw-rw-rw- 2 ubuntu ubuntu 4.0K 2011-05-15 14:52 apache
$ ls -lh apache/
ls: cannot access apache/error.log: Permission denied
ls: cannot access apache/access.log: Permission denied
total 0
-????????? ? ? ? ? ? access.log
-????????? ? ? ? ? ? error.log
$ cd apache
-bash: cd: apache: Permission denied
$ sudo ls -lh apache/
total 2.4M
-rw-r--r-- 1 ubuntu ubuntu 2.4M 2011-05-15 15:04 access.log
-rw-r--r-- 1 ubuntu ubuntu 27K 2011-05-15 15:00 error.log
This does not make any sense to me. Help?
Edit: the filesystem is ext4.
So you have to have
execute
permissions to cd into a directory? @RedGrittyBrick – AJP – 2013-07-06T09:22:16.803Yes, you need execute permission on a directory to “traverse” it—that is, to do anything with its contents. If you do not have execute permission, you can still see the directory, and you can
stat
it, but you can'tls
it or access its contents at all. – Blacklight Shining – 2013-10-21T05:43:03.757