Re: Apache logging and fifo's

George Georgalis <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
On Sat, Jun 26, 2004 at 01:29:32AM +0200, Charles M. Gerungan wrote:
>Hello Charles,
>
>On Fri, 25 Jun 2004 13:02:19 -0600 UTC, Charles Cazabon wrote:
>
>CC>  CustomLog "| /usr/local/bin/setuidgid loguser /usr/local/bin/multilog t
>CC>    /web/logs/access" combined 
>
>CC> ... adjusting your options as appropriate.  See
>CC> http://fte.tegtmeyer.net/zope/logging for another approach.
>
>That's exactly the page that Google found for me. When I search the log
>archive as is described on that page I found that [1]:
>
>"If I remember right (at least for Apache 1.3.12), if you do this, and
>try to restart httpd, the multilog process doesn't get axed. Then when
>Apache restarts, it tries to start another instance of multilog. Or
>something like that."

I did a lot of experimentation with apache/multilog. I ended up using
apache logging for access and multilog for error, for a variety of
reasons, eg it was a lot more work and complex to rotate and collect
access logs on a calendar interval for usage reports.

in addition to apache multilog, I start it with svscan. In that setup
any of these work

apachectl graceful
apachectl stop # but svscan starts it right back up again
svc -h /service/apache
svc -t /service/apache
svc -d /service/apache
svc -u /service/apache

you may choose to use multilog for both, the thing to watch out for
is "kill -9 `pidof apache`" which leaves multilog processes running
(orphaned children) which in turn blocks apache logging next time it
trys to start (I think this subsequently blocks apache from serving too,
but I'm not positive) -- you can only have one multilog per multilog
directory...

err, just checked, "kill -9 `pidof apache`" is no prob, but
"svc -k /service/apache" doesn't kill apache children, so they
continue to run, but unsupervised, and blocking port 80, a
followup with "kill -9 `pidof apache`" allowed svcscan to get
things back in shape.

These scripts are how I setup, complex and no doc, you'll need a
user/group "web" and better have ssh-agent running...

http://galis.org/scripts/do_conf/apache-daemontools.sh
http://galis.org/scripts/www/addwebsite.sh
http://galis.org/scripts/www/sync2live.sh

maybe it is dangerous to have multilog for errors, in case something on
the internet kills the parent apache but not it's children, the orphaned
children might block the apache restart, hadn't thought of that....
naaah, it would never happen like that.

// George


-- 
George Georgalis, Architect and administrator, Linux services. IXOYE
http://galis.org/george/  cell:646-331-2027  mailto:[email protected]
Key fingerprint = 5415 2738 61CF 6AE1 E9A7  9EF0 0186 503B 9831 1631
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.