Bug 62483 - Unusable entries in error_log when event MPM is activated
Summary: Unusable entries in error_log when event MPM is activated
Status: RESOLVED DUPLICATE of bug 54221
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cgid (show other bugs)
Version: 2.4.33
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-22 06:48 UTC by Attila
Modified: 2019-07-05 10:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Attila 2018-06-22 06:48:10 UTC
Description of problem:

Since Fedora 27 the mpm_event_module is activated by default.
Outputs written by cgi-scripts to "stderr" during https-sessions are unusable and ending up in the file error_log instead of ssl_error_log. The entries made by cgi-scripts in the file error_log don't have any timestamp, User-Agent, referer et cetera. The LogFormat from httpd.conf is ignored. All I can see is the native output from the cgi-script.

Version-Release number of selected component (if applicable):

httpd-2.4.33-2

How reproducible:

Create a cgi-script which can output the word "Test" to stderr.

Steps to Reproduce:
1. Start httpd: systemctl start httpd.service
2. Send a https-request to a cgi-script which can produce an output (like the word "Test") to stderr.
3. Check the file /var/log/httpd/error_log

Actual results:

The file /var/log/httpd/error_log contains a line with the word "Test". No date, timestamp, et cetera. This is wrong and should be written to /var/log/httpd/ssl_error_log, because of ssl-request.

Expected results:

The file /var/log/httpd/ssl_error_log should contain a line with the word "Test" like this:

Wed Jun 13 16:44:20.295009 2018] [cgi:error] [pid 14844] [client ::1:59776] AH01215: Test: /var/www/cgi-bin-ssl/test.cgi

Additional info:

A possible workaround is to switch back to prefork MPM in the file /etc/httpd/conf.modules.d/00-mpm.conf

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_event_module modules/mod_mpm_event.so
Comment 1 Joe Orton 2018-06-22 13:37:11 UTC
This is a known issue with mod_cgid. Bug 60692 and bug 54221 cover similar ground.

When discussed back in bug 22030 there is a suggestion we could switch mod_cgid to also use a "CGI bucket" like approach, where both stdout&stderr are streamed back to the handling thread, which can then log errors appropriately.
Comment 2 Joe Orton 2019-07-05 10:28:52 UTC
Let's track this only at bug 60692 for the ignored ErrorLog and bug 54221 for the lack of prefixes.

*** This bug has been marked as a duplicate of bug 54221 ***