Bug 642588

Summary: JON241: [apache] Incorrect configuration loaded when a non-standard httpd.conf is used
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-24 01:08:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 616081, 643563    
Attachments:
Description Flags
Screenshot none

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.