Gentoo Archives: gentoo-server

From: david <abbottdavid@×××××××××.net>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] Apache2 logs
Date: Mon, 08 Aug 2005 21:29:06
Message-Id: 42F7CE47.5090602@bellsouth.net
In Reply to: RE: [gentoo-server] Apache2 logs by Sean Wells
1 Sean Wells wrote:
2
3 >I have the following options turned on in mine:
4 >
5 >create
6 >compress
7 >notifempty
8 >nomail
9 >noolddir
10 >/var/log/apache2/*_log {
11 >daily
12 >rotate 7
13 >sharedscripts
14 >postrotate
15 >/etc/init.d/apache2 reload >/dev/null # this makes sure apache doesn't
16 >continue writing to the old logs
17 >endscript
18 >}
19 >
20 >Sean Wells
21 >Network Administrator
22 >Data Mosaics, Inc.
23 >2406 S. Dishman Mica Rd. Suite 6
24 >Spokane Valley, WA 99206
25 >866.904.DMSF (phone)
26 >509.928.4236 (fax)
27 >
28 >-----Original Message-----
29 >From: david [mailto:abbottdavid@×××××××××.net]
30 >Sent: Monday, August 08, 2005 1:49 PM
31 >To: gentoo-server@l.g.o
32 >Subject: Re: [gentoo-server] Apache2 logs
33 >
34 >david wrote:
35 >
36 >
37 >
38 >>Sean Wells wrote:
39 >>
40 >>
41 >>
42 >>
43 >>
44 >>>I use logrotate to loop through the logs daily...I generally only keep a
45 >>>weeks worth or so due to size. It'll automatically remove the old ones
46 >>>
47 >>>
48 >just
49 >
50 >
51 >>>fine in the end.
52 >>>
53 >>>Sean Wells
54 >>>Network Administrator
55 >>>Data Mosaics, Inc.
56 >>>2406 S. Dishman Mica Rd. Suite 6
57 >>>Spokane Valley, WA 99206
58 >>>866.904.DMSF (phone)
59 >>>509.928.4236 (fax)
60 >>>-----Original Message-----
61 >>>From: david [mailto:abbottdavid@×××××××××.net]
62 >>>Sent: Monday, August 08, 2005 1:01 PM
63 >>>To: gentoo-server@l.g.o
64 >>>Subject: [gentoo-server]
65 >>>
66 >>>What is the right way to clean apache2 logs?
67 >>>/var/log/apache2/access_log and error_log point to
68 >>>/usr/lib/apache2/logs/access_log and error_log
69 >>>I have been cd /usr/lib/apache2/logs
70 >>>rm access_log
71 >>>touch access_log
72 >>>chmod 666 access_log same for error_log
73 >>>I could leave error_log alone because its not very big, I do it to
74 >>>access_log because it is huge and webalizer complains.
75 >>>Should root own these logs or apache?
76 >>>
77 >>>
78 >>>
79 >>>
80 >>>
81 >>>
82 >>Thanks looks like what I need, This is just my server here at the house
83 >>for my stuff, do I need to edit anything?
84 >># packages can drop log rotation information into this directory
85 >>include /etc/logrotate.d
86 >>
87 >>notifempty
88 >>nomail
89 >>noolddir
90 >>
91 >>
92 >>
93 >>
94 >
95 >
96 >
97 >>Looks like I need to add this /etc/logrotate.conf after compress;
98 >>
99 >>
100 >>
101 >compress
102 >"/var/log/apache2/access_log" /var/log/apache2/error_log {
103 >rotate 5
104 >size 100k
105 >sharescripts
106 >postrotate
107 > /bin/killall -HUP apache2
108 >endscript
109 >}
110 >Is that right?
111 >
112 >
113 >
114 >>
115 >>
116 >>
117 >>
118 >
119 >
120 >
121 Works great thanks, I just commented the
122 #include /etc/logrotate.d it had mysql and syslog-ng in there so
123 now logrotate is only looking for apache logs
124 --
125 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] Apache2 logs Ow Mun Heng <Ow.Mun.Heng@×××.com>