logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Problem with rotatelog
Author
Kostunrix



Joined: 29 Dec 2009
Posts: 1

PostPosted: Tue 29 Dec '09 15:48    Post subject: Problem with rotatelog Reply with quote

Hi,

I'm running Apache for some time now. I defined several virtual hosts on my machine:

Code:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    DocumentRoot "C:/HTTProot"
    ServerName *
    ErrorLog "|bin/rotatelogs -l logs/error_log_%Y%m%d.txt 86400"
    CustomLog "|bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400" common
</VirtualHost>


<VirtualHost *:80>
    DocumentRoot "C:/HTTProot/band"
    ServerName www.direction-unknown.nl
    ErrorLog "|bin/rotatelogs -l logs/band/error_log_%Y%m%d.txt 86400"
    CustomLog "|bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/HTTProot/AtelierXL"
    ServerName www.atelierxl.nl
    ErrorLog "|bin/rotatelogs -l logs/atelierxl/error_log_%Y%m%d.txt 86400"
    CustomLog "|bin/rotatelogs -l logs/atelierxl/access_log_%Y%m%d.txt 86400" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/HTTProot/mailing"
    ServerName arnhem.kostunrix.net
    ErrorLog "|bin/rotatelogs -l logs/mailing/error_log_%Y%m%d.txt 86400"
    CustomLog "|bin/rotatelogs -l logs/mailing/access_log_%Y%m%d.txt 86400" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/HTTProot/joomla"
    ServerName d66oud.kostunrix.net
#    ErrorLog "|bin/rotatelogs -l logs/d66oud/error_log_%Y%m%d.txt 86400"
#    CustomLog "|bin/rotatelogs -l logs/d66oud/access_log_%Y%m%d.txt 86400" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/HTTProot/Kostunrix"
    ServerName www.kostunrix.net
    ErrorLog "|bin/rotatelogs -l logs/kostunrix/error_log_%Y%m%d.txt 86400"
    CustomLog "|bin/rotatelogs -l logs/kostunrix/access_log_%Y%m%d.txt 86400" common
</VirtualHost>


The d66oud server is the last one I added. I commented the log lines out deliberately.
When i start the apache server, i get errors regarding the log rotate:

Code:
[Tue Dec 29 13:50:32 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Tue Dec 29 13:50:32 2009] [notice] Child 4696: Exit event signaled. Child process is ending.
[Tue Dec 29 13:50:33 2009] [notice] Child 4696: Released the start mutex
[Tue Dec 29 13:50:34 2009] [notice] Child 4696: All worker threads have exited.
[Tue Dec 29 13:50:34 2009] [notice] Child 4696: Child process is exiting
[Tue Dec 29 13:50:34 2009] [notice] Parent: Child process exited successfully.
[Tue Dec 29 14:10:05 2009] [notice] Apache/2.2.10 (Win32) configured -- resuming normal operations
[Tue Dec 29 14:10:05 2009] [notice] Server built: Oct 10 2008 12:39:04
[Tue Dec 29 14:10:05 2009] [notice] Parent: Created child process 4752
[Tue Dec 29 14:10:06 2009] [notice] Child 4752: Child process is running
[Tue Dec 29 14:10:06 2009] [notice] Child 4752: Acquired the start mutex.
[Tue Dec 29 14:10:06 2009] [notice] Child 4752: Starting 64 worker threads.
[Tue Dec 29 14:10:06 2009] [notice] Child 4752: Starting thread to listen on port 80.
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/access_log_%Y%m%d.txt 86400' failed unexpectedly
piped log program 'bin/rotatelogs -l logs/band/access_log_%Y%m%d.txt 86400' failed unexpectedly


The silly thing is: it sometimes works (and when it works I don't get any error at all, can restart server, no problems) and sometimes don't. Every time i add a new virtual host, i have these errors, or not. But I don't understand when i get them and when not.

The sillyt hing is: the server nicely writes to the log files.... but keeps telling me these errors. In 20 minutes the log file grows to about 285 KB.
I searched the web and found a very old bug report regarding this issue. The reported situation (https://issues.apache.org/bugzilla/show_bug.cgi?id=21648) looks like my problem, but is for an older version. I expect the fix is incorporated in later versions.

Has anyone a clue for me ?

Kind regards,
Maarten
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 05 Jan '10 11:02    Post subject: Reply with quote

Which version of apache do you use?
Back to top
crispi



Joined: 29 Jul 2010
Posts: 2

PostPosted: Thu 29 Jul '10 23:03    Post subject: Reply with quote

Did you ever find the answer? I'm having the same problem.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 29 Jul '10 23:05    Post subject: Reply with quote

Yepp using mod_log_rotate, but it doesn't work for the error log.
Back to top
black_harry



Joined: 22 Feb 2010
Posts: 15
Location: Germany, Stuttgart

PostPosted: Fri 30 Jul '10 8:44    Post subject: Reply with quote

I had the same problem - and found a solution:

it's no problem to use rotatelogs for several logs like access.log + error.log + xxxx.log
You only have to specify the complete path (... | c:/Apache2.2/ ...) if you use more than 1 piped program.

Example:

bad:
Code:
CustomLog "| /bin/rotatelogs.exe -l c:/Apache2.2/logs/access_%Y%m%d.log 86400" common
ErrorLog "| /bin/rotatelogs.exe -l c:/Apache2.2/logs/error_%Y%m%d.log 86400"


good:
Code:
CustomLog "| c:/Apache2.2/bin/rotatelogs.exe -l c:/Apache2.2/logs/access_%Y%m%d.log 86400" common
ErrorLog "| c:/Apache2.2/bin/rotatelogs.exe -l c:/Apache2.2/logs/error_%Y%m%d.log 86400"
Back to top
crispi



Joined: 29 Jul 2010
Posts: 2

PostPosted: Fri 30 Jul '10 21:14    Post subject: Reply with quote

Hm. Our rotate log command is

Code:
CustomLog "|C:/Apache2.2/bin/rotatelogs.exe L:/apache/logs/siteurl_custom_%Y-%m-%d.log 86400" common


And it still fails.

Is it an issue that it is running on a windows server?
Back to top
rpadmin



Joined: 03 Mar 2017
Posts: 1
Location: US, CA

PostPosted: Sat 04 Mar '17 0:28    Post subject: Reply with quote

crispi wrote:
Hm. Our rotate log command is

Code:
CustomLog "|C:/Apache2.2/bin/rotatelogs.exe L:/apache/logs/siteurl_custom_%Y-%m-%d.log 86400" common


And it still fails.

Is it an issue that it is running on a windows server?


Hello,

We just migated our old Windows 32-bit Apache reverse proxy to the new Windows 64-bit Apache 2.4 and we are seeing the same issue with rotatelog.exe.


We haave the below in the conf:

CustomLog "| D:/logs/rotatelogs.exe -l D:/logs/Apache2.4/hostname_ssl-access.log 86400" common
ErrorLog "| D:/logs/rotatelogs.exe -l D:/logs/Apache2.4/hostname_ssl-error.log 86400"

But we are getting the piped log error:

AH00106: piped log program ' D:/logs/rotatelogs.exe D:/logs/Apache2.4/hostanme_ssl-access.log 86400' failed unexpectedly

Have anyone had this same issue on Apache 2.4 64-bit?

Thanks for your help in advance!
Back to top
68dkj4i9dk4



Joined: 08 Jul 2019
Posts: 1
Location: US, Garden Grove

PostPosted: Mon 08 Jul '19 8:25    Post subject: This is liklely a bug in Apache Reply with quote

After spending a full day troubleshooting this same type of error message, I am convinced this is a bug with Apache.

I'm encountering this same issue on 2 different web servers running Apache.

Server 1
Windows 8 64-bit
Apache 2.4.12, installed as part of XAMPP package.

Server 2
Windows 10 64-bit
Apache 2.4.27, installed standalone.

I believe both machines are running 64 bit versions of Apache. I don't know how to confirm, though.

Below is the piping command I am using for the Windows 8 machine:
Code:
CustomLog "|C:/xampp/php/php.exe C:/xampp/apache/logs/send_to_elasticsearch.php" common


Below is the error entry that fills up my log
Code:
AH00106: piped log program 'C:/xampp/php/php.exe C:/xampp/apache/logs/send_to_elasticsearch.php' failed unexpectedly


I thought maybe the issue was that my PHP script wasn't properly terminating after it was done processing, so I tried to dumb it down as much as possible, but still the errors continue. I can confirm that the piping command is properly being carried out. Everything works fine, despite these odd errors that continue to fill my error logs.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Jul '19 10:40    Post subject: Re: This is liklely a bug in Apache Reply with quote

68dkj4i9dk4 wrote:


I believe both machines are running 64 bit versions of Apache. I don't know how to confirm, though.


with httpd.exe -V you can verify that.

68dkj4i9dk4 wrote:

Below is the piping command I am using for the Windows 8 machine:
Code:
CustomLog "|C:/xampp/php/php.exe C:/xampp/apache/logs/send_to_elasticsearch.php" common



It might be easier to save the logs in the correct format and process them with a cronjob / windows task.

Code:

LogFormat "{ \"time\":\"%t\", \"remoteIP\":\"%a\", \"host\":\"%V\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" json


68dkj4i9dk4 wrote:

Below is the error entry that fills up my log
Code:
AH00106: piped log program 'C:/xampp/php/php.exe C:/xampp/apache/logs/send_to_elasticsearch.php' failed unexpectedly


I thought maybe the issue was that my PHP script wasn't properly terminating after it was done processing, so I tried to dumb it down as much as possible, but still the errors continue. I can confirm that the piping command is properly being carried out. Everything works fine, despite these odd errors that continue to fill my error logs.

[/quote]

Apache expects a certain return code. I forgot which one.
Back to top


Reply to topic   Topic: Problem with rotatelog View previous topic :: View next topic
Post new topic   Forum Index -> Apache