Bug 642588 - JON241: [apache] Incorrect configuration loaded when a non-standard httpd.conf is used
JON241: [apache] Incorrect configuration loaded when a non-standard httpd.con...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All All
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Corey Welton
:
Depends On:
Blocks: jon241-bugs 643563
  Show dependency treegraph
 
Reported: 2010-10-13 07:56 EDT by Lukas Krejci
Modified: 2011-05-23 21:08 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-23 21:08:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Lukas Krejci 2010-10-13 07:56:04 EDT
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 01:43:35 EDT
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 07:17:40 EST
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 07:21:44 EST
Created attachment 459087 [details]
Screenshot
Comment 4 Sunil Kondkar 2010-11-18 08:37:47 EST
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-23 21:08:01 EDT
Bookkeeping - closing bug - fixed in recent release.

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