Bug 837449 - Apache httpd VirtualHost ServerName value should be used for resource's name in inventory
Apache httpd VirtualHost ServerName value should be used for resource's name ...
Status: CLOSED NEXTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- Apache, Usability (Show other bugs)
JON 3.2.3
All All
medium Severity high
: ---
: One-off release
Assigned To: Michael Burman
Sunil Kondkar
: Triaged
Depends On: 835312
Blocks: 1127874
  Show dependency treegraph
 
Reported: 2012-07-03 18:52 EDT by Larry O'Leary
Modified: 2015-04-29 18:20 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 835312
: 1127874 (view as bug list)
Environment:
Last Closed: 2015-04-29 18:20:51 EDT
Type: Support Patch
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
screenshot (115.36 KB, image/png)
2014-08-19 07:08 EDT, Sunil Kondkar
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 150243 None None None 2012-07-03 18:53:52 EDT

  None (edit)
Description Larry O'Leary 2012-07-03 18:52:49 EDT
+++ This bug was initially created as a clone of upstream RHQ Bug #835312 +++

Description of problem:
When importing an Apache httpd virtual host which has a ServerName value which is not resolvable back to an interface on the local machine, the hostname or IP of the local machine is used instead of the ServerName value.  For an httpd instance with multiple virtual hosts with unresolvable ServerName values, this results in virtual host resources that are only identifiable by the port number in the resource name, or by manually inspecting each resource for the ServerName value recorded in the resource key.

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

How reproducible:
Very

Steps to Reproduce:
1. Add virtual host section to httpd.conf with unresolvable ServerName value:
Listen 8080
<VirtualHost *:8080>
        ServerName myunresolvablehost:8080
</VirtualHost>

2. Start httpd instance
3. Run discovery in agent to pick up "myunresolvablehost" ('discovery -f' if httpd instance is already in inventory
4. Navigate to httpd's virtual host children
5. Identify the newly added virtual host resource
  
Actual results:
Resource name is the local machine's hostname or IP address in format "hostname:8080"

Expected results:
Resource name should be referencing the value of the ServerName directive of the virtual host configuration.  For example, "myunresolvablehost:8080".
Comment 1 Larry O'Leary 2012-07-03 18:56:45 EDT
This is a usability issue that makes it difficult to identify a virtual host in the resource list as we do not retain the virtual host name as the resource name in the even the virtual host name is not resolvable. Apache does not require the server name to be resolvable as it is a "virtual" name and not a "logical" name.

The fix for this should be relatively easy with no impact.
Comment 3 Charles Crouch 2012-08-29 12:06:11 EDT
As per 8/20 triage 8/20 pushing to JON312
Comment 6 Michael Burman 2014-08-05 14:20:06 EDT
Fixed in the master. This change does not touch the resourceKey format, only resourceName.

commit 33ce700d3c3d9c657e0d5b98511c178e797e48bb
Author: burmanm <miburman@redhat.com>
Date:   Tue Aug 5 21:17:47 2014 +0300

    [BZ 837449] Change behaviour of apache plugin to select ServerName + VirtualHost combination as first priority for resourceName and fall back to server
Comment 7 John Mazzitelli 2014-08-07 14:37:03 EDT
commit to release/jon3.2.x : bb173ddb263775f7c4dd3abf91ffa2559d425ea6
Comment 8 Simeon Pinder 2014-08-14 23:19:11 EDT
Moving to ON_QA as this is available for test in JON 3.2.3 ER01 build:

http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/3.2.3.GA/8-14-14/
Comment 9 Sunil Kondkar 2014-08-19 07:07:29 EDT
Tested on Version : 3.2.0.GA Update 03 Build Number :bca1bc8:e19c43d

Added below virtual host entry to httpd.conf with unresolvable ServerName value:

Listen 8080
<VirtualHost *:8080>
        ServerName myunresolvablehost:8080
</VirtualHost>

- Started httpd instance
- After discovery navigated to httpd's virtual host children
- Observed that he newly added virtual host resource name has the format "<hostname>:8080"
  
Please refer the attached screenshot.
Comment 10 Sunil Kondkar 2014-08-19 07:08:07 EDT
Created attachment 928313 [details]
screenshot
Comment 14 Larry O'Leary 2015-04-29 18:20:51 EDT
This issue was fixed and released in JWS management plug-in for JBoss ON 3.3 per BZ-1127874. Please upgrade to JBoss ON 3.3 to receive this fix.

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