Log files/directory ownership


#1

I’m curious - is it correct that the files/directories in logs/*/http are all owned by root? The ownership changed a couple of days ago and hence Apache can’t write to error.log and access.log:

[worth]$ ls -l access.log*
-rw-r–r-- 1 root root 0 Feb 4 01:42 access.log
lrwxrwxrwx 1 root root 21 Feb 4 01:42 access.log.0 -> access.log.2013-02-03
-rw-r–r-- 1 nigelhorne pg4289228 140759 Jan 31 02:11 access.log.2013-01-30.gz
-rw-r–r-- 1 nigelhorne pg4289228 97717 Feb 1 01:30 access.log.2013-01-31.gz
-rw-r–r-- 1 nigelhorne pg4289228 139036 Feb 2 01:32 access.log.2013-02-01.gz
-rw-r–r-- 1 root root 268338 Feb 2 11:32 access.log.2013-02-02
-rw-r–r-- 1 root root 0 Feb 3 01:11 access.log.2013-02-03

I would have thought that the earlier access.log ownership was correct. This seems to co-incide with the move your did for me from one Apache server to another - perhaps someone forgot to chown afterwards? I’d like access to my access.log and error.logs please!

Thanks.

-Nigel


#2

Yours looks the same as mine… it looks like the logs are owned by root until gzip’d then there is a chown that changes ownership to the user to home the domain belongs. I don’t think this is new.


#3

OK - thanks for the response.

-Nigel


#4

It’s actually useful since it stops you from accidently deleting your current log files

-Bill


#5

It also stops me from intentionally deleting log files though.


#6

Message deleted - it didn’t make sense, sorry.


#7

Ha! Good point! I believe the current logs, yesterday, and the day before yesterday are always owned by root. After that they get gzipped and they belong to you. At least that’s how I understand it.


#8

I’ve got logs for a domain I stopped using over a year ago. Actually I think I have log folders for every domain I’ve ever hosted, and from what I’ve read I’d have to bug DH staff to delete them for me.

It doesn’t really matter but it’s a waste of space. IMO the log folders for domains you no longer host should get cleared off eventually. Don’t they need that space for pictures of kittens?