[EMAIL PROTECTED] wrote:
> I've mentioned this problem a couple of times before but never in a
> message dedicated to it and never with a whole lot of detail. Here goes
> with the current situation:
>
> The main gist of what I'm saying will be this: Is it possible for, as I
> for some reason think I head on here, Apache to just stop logging for
> sites when it reaches a certain activity level?
>
> We host several websites, many of which require access_logs to be kept.
> Every now and then, most recently about two weeks ago, a site will just
> stop logging. In this most recent case it was after a coworker deleted and
> touched the access_log file, giving it the exact same ownership and
> permisions that it had before. The only apparent difference was that it
> had simply stopped logging.
I suspect that it was probably still logging to the original file.
`rm' doesn't *delete* files; it `unlinks' them. The file still exists,
but it doesn't appear in any directory (unless additional hard links
had been made to it).
A file is only deleted when both:
a) it no longer exists in any directory (i.e. the number of hard links
falls to zero), *and*
b) no processes have the file open.
If you `rm' a file to which a process is writing, the process will
keep writing to it. It will be deleted when the file is closed.
When system logfiles are to be rotated, the usual procedure is to
rename the file (with `mv'), and then send syslogd a SIGHUP. When it
receives a SIGHUP, syslogd closes all of its logfiles, and then
reopens them. The new files will have the names specified in
syslog.conf.
Apache behaves similarly. If you send the parent process a SIGHUP or
SIGUSR1, it will close and reopen its log files. Note that with
SIGUSR1, any active children will still be writing to the old files.
If Apache stops logging, one thing to try is
kill -USR1 `cat /var/run/httpd.pid`
(modify according to where you keep your pid file).
> I checked permissions and ownership on each of the site directories in
> question and they are exactly the same as those of sites that are logging
> just fine. I checked their virtualhost entries in httpd.conf and they are
> exactly the same except of course for the directory to which they point,
> but I pointed a working host to the logs directory of a host that didn't
> work and logging went on perfectly. I even went so far as to remove and
> recreate one of the non-logging hosts using the same scripts that we use
> to create all of our hosted sites. Still no luck.
> Desperate to eliminate possibilities, I tried pointing a non-logging
> domain to a new ip and then accessed it several times from a system
> using our nameserver. Still nothing logged. I created a brand new
> host and pointed it to that IP. Still nothing, which leads me to believe
> that httpd has not only stopped logging for these hosts, but all future
> ones (I must admit, however, that I was tired a frazzled by that point and
> could have just mis-typed something).
> When I restart httpd, no complaints are made about the contents of
> httpd.conf, the access_log and error_log files are created by apache so I
> know it's reading that part correctly. Ipfwadm -A -l shows usage of the
> site and apache is, of course, serving everything properly. IT'S JUST NOT
> LOGGING.
When you say `the access_log and error_log files are created by
apache', do you mean that it creates *all* of the log files for the
different domains, but doesn't write anything to any of them?
If so, then that's really odd. And I don't know what to suggest.
> So it's not permissions.
> It doesn't appear to be syntax in the httpd.conf.
> It's independant of the IP address assigned to a domain that's decided
> not to log.
>
> I'm totaly out of ideas. We've done everything but just reboot the server
> and hope that that fixes it, something I'd rather not do.
I can't see how rebooting the server could affect anything, although
you can't be entirely sure.
--
Glynn Clements <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]