LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 11-11-2009, 10:17 AM   #1
ericinslo
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
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!
 
Old 11-12-2009, 09:29 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
 
Old 11-13-2009, 03:18 PM   #3
ericinslo
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by evo2 View Post
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

Last edited by ericinslo; 11-13-2009 at 03:19 PM. Reason: Grammar
 
  


Reply

Tags
apache, logrotate, permissions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exim won't start, logfile permissions error duzap Linux - Software 1 11-20-2008 01:03 PM
Shell scripting: Print output to logfile, error to logfile & screen stefanlasiewski Programming 18 05-22-2008 12:47 PM
Apache file permissions problem. {Apache/2.2.6 Fedora 8} hacker supreme Linux - Server 5 01-31-2008 03:26 PM
Apache piped logs - split-logfile - zero size files alex_fittyfives Linux - Enterprise 0 08-26-2004 07:04 AM
apache and permissions dkc_ace Linux - Software 19 01-17-2003 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration