Bug 536328 (RHQ-690) - Change apache resource key from baseDir of apache install to full path to httpd.conf
Summary: Change apache resource key from baseDir of apache install to full path to htt...
Keywords:
Status: CLOSED DUPLICATE of bug 593270
Alias: RHQ-690
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 1.0.1
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Corey Welton
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On: RHQ-662 592038
Blocks: 619556
TreeView+ depends on / blocked
 
Reported: 2008-07-18 22:38 UTC by Charles Crouch
Modified: 2015-02-01 23:25 UTC (History)
3 users (show)

Fixed In Version: 1.4
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-24 12:58:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Charles Crouch 2008-07-18 22:38:00 UTC
Discussion:

http://forums.rhq-project.org/viewtopic.php?f=5&t=62

Comment 1 Charles Crouch 2008-07-24 19:09:29 UTC
Example workaround:

1) Create unique symlinks to the base of the apache install for each apache instance e.g.
ln -s /apache2 /apache2-lxdapg04
ln -s /apache2 /apache2-lxdapg05
...

These links need to be unique on the machine, but not globally unique.

2) Start apache with the -d parameter pointing to these symlinks e.g.

/apache2/bin/httpd -k start -d /apache2-lxdapg04 -f /usr/local/apache2/conf/lxdapg04.conf -DSSL
/apache2/bin/httpd -k start -d /apache2-lxdapg05 -f /usr/local/apache2/conf/lxdapg05.conf -DSSL 

Comment 2 Charles Crouch 2008-07-24 19:10:02 UTC
Dropping to minor since a workaround is available

Comment 3 Greg Hinkle 2008-07-30 02:17:05 UTC
Future release

Comment 4 Ian Springer 2009-09-28 23:12:01 UTC
Fixed in trunk (r5221) and 1.1.0.GA CP branch (r5220).

Note, since this changes the Resource key, if users upgrade from an earlier version of the Apache plugin and already have Apache servers in inventory, a second set of Apache servers (with the new resource keys) will get discovered, and they will end up with two resources per Apache server in inventory. Ideally, they should uninventory the old set of Apache server resources. However, if they want to keep those around for the sake of the metric/operation/etc. history, then it is recommended that they effectively disable avail and metric collection on the resources by setting the snmp IP and or snmp Port connection properties to invalid values and unsetting the url connection property.




Comment 5 Ian Springer 2009-09-29 03:33:15 UTC
See also: support case 282455.


Comment 6 Ian Springer 2009-09-29 22:07:19 UTC
I made a mistake when I merged the fix into the 1.1.0 CP branch - r5227 corrects that.


Comment 7 Red Hat Bugzilla 2009-11-10 21:14:50 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-690


Comment 8 Ian Springer 2010-03-26 15:29:40 UTC
To test this feature:

1) Install Apache 2.x
2) Start up two instances from this same install using something like the following:

cd /opt/apache2

cp -pR conf conf2
# NOTE: ideally, also modify the two confs to point at different docroots, logfiles, etc. to tell them apart during testing

# start first instance...
bin/httpd -k start -d conf -f conf/httpd.conf 

# start second instance
bin/httpd -k start -d conf2 -f conf2/httpd.conf 

3) Run a full discovery scan from JON Agent and verify that two Apache Servers are discovered - one for each of the two instances you started above. Make sure that the conn props for both Apache servers look correct.

Comment 9 Corey Welton 2010-03-29 14:42:53 UTC
Ian, I am not sure this is working correctly... on linux anyway, it looks like it is naming the location relative to the agent root.

On a linux box, I created a second conf directory ("conf2") and started up the second httpd server using:

/usr/sbin/httpd -k start -d conf2 -f httpd.conf 

After installing agent on box, discovery was showing me this:


/etc/httpd/conf/httpd.conf  	 /etc/httpd/conf/httpd.conf  	NEW
/root/rhq-agent/conf2/httpd.conf 	/root/rhq-agent/conf2/httpd.conf NEW

Comment 10 Ian Springer 2010-03-29 15:40:00 UTC
Git commit 237ee88dbecd6809cefea82865bbe0b1d3b5582d fixes getServerRoot() so that if server root from httpd command line is a relative path, it will be resolved relative to the httpd process's cwd, not the cwd of the Agent process.

NOTE: There was a mistake in my original test steps. Please use the following steps instead:

1) Install Apache 2.x
2) Start up two instances from this same install using something like the
following:

cd /opt/apache2

cp -pR conf conf2
# NOTE: ideally, also modify the two confs to point at different docroots,
logfiles, etc. to tell them apart during testing

# start first instance...
bin/httpd -k start -d . -f conf/httpd.conf 

# start second instance
bin/httpd -k start -d . -f conf2/httpd.conf 

3) Run a full discovery scan from JON Agent and verify that two Apache Servers
are discovered - one for each of the two instances you started above. Make sure
that the conn props for both Apache servers look correct.    


Another scenario to test is not explicitly specifying the server root via -d, i.e. modify step 2 above with:

2b) 

# start first instance...
bin/httpd -k start -f conf/httpd.conf 

# start second instance
bin/httpd -k start -f conf2/httpd.conf

Comment 11 Corey Welton 2010-04-07 12:47:30 UTC
QA Verified, the paths to httpd.conf are now appropriately indicated.

Comment 12 Lukas Krejci 2010-07-13 15:41:04 UTC
I am reopening this because of bug 612189.

Comment 13 Corey Welton 2010-09-13 19:59:35 UTC
lukas: is this still relevant, if so what needs to be done/how long will it take?

Comment 14 Lukas Krejci 2010-09-14 07:41:28 UTC
this is still relevant, depends on bug 592038, which is still open.

The code is nearly finished, we only need to iron out one corner case issue and the UI.

Comment 15 Lukas Krejci 2010-09-24 12:58:12 UTC
Closing this in favour of bug 593270 that further specializes how the apache resource key should look like.

*** This bug has been marked as a duplicate of bug 593270 ***


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