Bug 642588 - JON241: [apache] Incorrect configuration loaded when a non-standard httpd.conf is used
Summary: JON241: [apache] Incorrect configuration loaded when a non-standard httpd.con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 3.0.0
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon241-bugs 643563
TreeView+ depends on / blocked
 
Reported: 2010-10-13 11:56 UTC by Lukas Krejci
Modified: 2011-05-24 01:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-24 01:08:01 UTC
Embargoed:


Attachments (Terms of Use)
Screenshot (127.17 KB, image/png)
2010-11-09 12:21 UTC, Sunil Kondkar
no flags Details

Description Lukas Krejci 2010-10-13 11:56:04 UTC
Description of problem:

When starting httpd using a non-standard configuration file (using the -f parameter), incorrect included configuration files are loaded by the plugin if the main configuration file redefines ServerRoot.

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

How reproducible:
always

Steps to Reproduce:
1. Create a directory (DIR) somewhere and create DIR/conf, DIR/conf.d/, DIR/logs directories. 
2. Create a new httpd.conf with some configuration and put it inside DIR/conf
3. Define a ServerRoot directive in your httpd.conf and set it to DIR
4. Make sure your httpd.conf contains "Include conf.d/*.conf" directive
5. Put an additional configuration file defining a vhost in DIR/conf.d, call the file vhost.conf for example
6. Start httpd from command line like "httpd -f DIR/conf/httpd.conf -k start"
7. Let RHQ discover that apache instance

Actual results:
The vhost defined in DIR/conf.d/vhost.conf isn't discovered.

Expected results:
The vhost should be discovered.

Additional info:
This is because the plugin doesn't reload the configuration when it detects new value for the ServerRoot directive and thus the config file parser always uses the default server-root location hardcoded in the httpd binary.

Comment 1 Charles Crouch 2010-11-02 05:43:35 UTC
This appears to have gone into the release-3.0 branch so should be testable in JON2.4.1

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=e8bfc17fde0d6f5bc837d2a96f230a8109114279

Comment 2 Sunil Kondkar 2010-11-09 12:17:40 UTC
Verified on rhq-release branch 3.0.1 - build#422

Followed the steps to reproduce and started httpd using a non-standard configuration file (/NotBackedUp/conf/httpd.conf). 

Defined a ServerRoot directive in httpd.conf and set it to "/NotBackedUp".
httpd.conf contains "Include conf.d/*.conf" directive.

Placed additional configuration file defining vhost in /NotBackedUp/conf.d

The vhost defined in /NotBackedUp/conf.d/vhost.conf is discovered successfully.
Please refer attached screenshot.

Comment 3 Sunil Kondkar 2010-11-09 12:21:44 UTC
Created attachment 459087 [details]
Screenshot

Comment 4 Sunil Kondkar 2010-11-18 13:37:47 UTC
Verified this against jon-server-2.4.1-SNAPSHOT build# 24. 

Started httpd using a non-standard configuration file (/NotBackedUp/conf/httpd.conf). 

Defined a ServerRoot directive in httpd.conf and set it to "/NotBackedUp".

httpd.conf contains "Include conf.d/*.conf" directive.

Placed additional configuration file defining vhost in /NotBackedUp/conf.d

The vhost defined in /NotBackedUp/conf.d/vhost.conf is discovered successfully.

Comment 5 Corey Welton 2011-05-24 01:08:01 UTC
Bookkeeping - closing bug - fixed in recent release.


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