LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache Logfile Permissions (http://www.linuxquestions.org/questions/linux-software-2/apache-logfile-permissions-768433/)

ericinslo 11-11-2009 10:17 AM

Apache Logfile Permissions
 
Not sure where to get help with this one, but maybe someone can point me in the right direction...

I have logs in Apache for my various websites. Each website has its own combined log.

On one site (and only one site), the permissions change on the log file. Not sure if it's Apache, logrotate, or some other process causing the problem. The group changes from utmp to adm and the permissions change from 664 to 640.

Here's the relevent part of my logrotate configuration:

Code:

/var/log/apache2/mydomain.com/access_log {
        monthly
        missingok
        create 0664 root utmp
        rotate 12
}

The log files are in their own directory. As you can see below, something has changed permissions and group ownership. I'm assuming that this is happening during the logrotate:

Code:

-rw-r----- 1 root adm        0 2009-11-11 06:34 access_log
-rw-r----- 1 root adm  21873306 2009-11-11 11:13 access_log.0
-rw-r----- 1 root adm  1648210 2009-11-10 10:38 access_log.1.gz
-rw-rw-r-- 1 root utmp  1826062 2009-11-08 06:33 access_log.2.gz
-rw-rw-r-- 1 root utmp  1876267 2009-11-05 18:54 access_log.3.gz
-rw-rw-r-- 1 root utmp  1691916 2009-11-03 13:28 access_log.4.gz
-rw-rw-r-- 1 root utmp 22543825 2009-11-01 14:30 access_log.5
-rw-rw-r-- 1 root utmp  4731941 2009-10-30 15:23 access_log.5.gz

I'm not sure where access_log.0 is coming from; it shouldn't appear, to my knowledge.

Has anyone else encountered this problem? Or can someone suggest where to go for assistance on this?

Thanks!

evo2 11-12-2009 09:29 PM

It looks to me like Apache is creating the logs as: "root:adm 640" and then log rotate changes them to "root:utmp 664".
I think apache creating the logs as "root:adm 640" is standard (at least on my Debian machines)

Evo2.

ericinslo 11-13-2009 03:18 PM

Quote:

Originally Posted by evo2 (Post 3755040)
It looks to me like Apache is creating the logs as: "root:adm 640" and then log rotate changes them to "root:utmp 664".
I think apache creating the logs as "root:adm 640" is standard (at least on my Debian machines)

Evo2.

That got it, evo2. Thanks!

I'm also running Debian. I edited my /etc/logrotate.d/apache2 file. There was a line reading

Code:

create 640 root adm
I changed it to

Code:

create 664 root utmp
It hasn't rotated yet, but that should do it. Much appreciated.

Regards,
Eric


All times are GMT -5. The time now is 01:57 PM.