RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1015268 - configtest does not fail if RewriteLog directive points to non-existent directory
Summary: configtest does not fail if RewriteLog directive points to non-existent direc...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: httpd
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-03 18:52 UTC by stein
Modified: 2021-01-14 09:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-27 16:09:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description stein 2013-10-03 18:52:07 UTC
Description of problem:
'service httpd configtest' returns successfully with 'Syntax OK' if the mod_rewrite RewriteLog directive is used and points to a directory that does not exist.  However, Apache fails to start (service httpd start/restart) with this error in the configuration and logs "[error] (2)No such file or directory: mod_rewrite: could not open RewriteLog file /invalid/directory/rewrite.log"

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

How reproducible:
always

Steps to Reproduce:
1. Add a RewriteLog directive referencing an invalid directory, to an Apache configuration file:

 RewriteLog "/invalid/directory/rewrite.log"

2. Run 'service httpd configtest'.  It will not detect an error and returns 'Syntax OK'
 
3. Restart Apache, 'service httpd restart'

4. Apache fails to start and logs a "No such file or directory" error in the error_log


Actual results:
'service httpd configtest' returns 'Syntax OK'


Expected results:
'service httpd configtest' should return an error


Additional info:

Comment 1 Joe Orton 2013-10-03 20:15:59 UTC
Thanks for contacting us.

"configtest" aims to check whether the configuration file is syntactically valid, and does not guarantee the server will start up.

I am generally reluctant to try adding such validation features because it is impossible in many cases to guard against false positives.  Is there a particular problem you are trying to solve here?

Comment 2 stein 2013-10-03 21:13:39 UTC
I am using puppet to automate the management of some Apache config files.  When a config file changes, puppet is set up to restart Apache, but I also run a configtest first to make sure Apache will restart OK.

/sbin/service httpd configtest && /sbin/service httpd graceful

I expect configtest to catch any errors that would cause Apache to fail to start.

Another way of looking at this problem is whether mod_rewrite should cause Apache to fail if it encounters an invalid path in a RewriteLog directive.  Could mod_rewrite log the error, but allow Apache to continue to load?

Comment 5 Joe Orton 2014-10-27 16:09:12 UTC
Looking again: there's actually not a good place to hook in such a feature in 2.2 unfortunately. 

In 2.4 there is no RewriteLog directive any more, since we have fine-grained error log control.  But we do have a new hook which allows more sophisticated validation of directives, and ErrorLog does have a specific check for directory existence.

So probably an unsatisfactory answer, sorry, but "upgrade to RHEL 7" is probably the best answer we have here.


Note You need to log in before you can comment on or make changes to this bug.