Bug 1310880

Summary: sosreport's apache plugin should gather JWS 3 apache httpd information
Product: Red Hat Enterprise Linux 7 Reporter: Robert Bost <rbost>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED UPSTREAM QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: agk, bmr, gavin, plambri, rbost, sbradley
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-10 07:31:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Robert Bost 2016-02-22 21:22:03 UTC
Description of problem: In JBoss Web Server 3, the httpd package was renamed to httpd24. Therefore, configuration and logging directories moved to /etc/httdp24 and /var/log/httpd24.

The apache plugin for sosreport use to gather logs/config for httpd no matter the product (JWS vs RHEL). With the new package name, it does not.


How reproducible: Always.


Steps to Reproduce:
1. run `sosreport -k apache.log=on`

Actual results: Does not gather logs and configuration files for JBoss Web Server's httpd24 package.


Expected results: If user has httpd24 installed and use the apache plugin, sosreport should gather the logs and configuration.


Additional info:
I think if user has both RHEL httpd and JWS httpd24 installed and they activate the apache plugin, it should gather logs and config for both products. Meaning, it should gather

/etc/httpd
/var/log/httd
/etc/httpd24
/vat/log/httpd24

Comment 2 Pavel Moravec 2016-03-09 11:16:36 UTC
Upstream plugin sounds to have it already - see:

https://github.com/sosreport/sos/blob/master/sos/plugins/apache.py

diff from sos-3.2-35.el7_2.3.noarch:

--- /usr/lib/python2.7/site-packages/sos/plugins/apache.py	2016-01-14 10:27:23.000000000 +0100
+++ apache.py	2016-03-09 12:12:04.881194747 +0100
@@ -25,9 +25,17 @@ class Apache(Plugin):
         ("log", "gathers all apache logs", "slow", False)
     ]
 
+    def setup(self):
+        # collect list of installed modules
+        self.add_cmd_output(["apachectl -M"])
+
 
 class RedHatApache(Apache, RedHatPlugin):
-    files = ('/etc/httpd/conf/httpd.conf',)
+    files = (
+        '/etc/httpd/conf/httpd.conf',
+        '/etc/httpd22/conf/httpd.conf',
+        '/etc/httpd24/conf/httpd.conf'
+    )
 
     def setup(self):
         super(RedHatApache, self).setup()
@@ -35,7 +43,14 @@ class RedHatApache(Apache, RedHatPlugin)
         self.add_copy_spec([
             "/etc/httpd/conf/httpd.conf",
             "/etc/httpd/conf.d/*.conf",
-            "/etc/httpd/conf.modules.d/*.conf"
+            "/etc/httpd/conf.modules.d/*.conf",
+            # JBoss Enterprise Web Server 2.x
+            "/etc/httpd22/conf/httpd.conf",
+            "/etc/httpd22/conf.d/*.conf",
+            # Red Hat JBoss Web Server 3.x
+            "/etc/httpd24/conf/httpd.conf",
+            "/etc/httpd24/conf.d/*.conf",
+            "/etc/httpd24/conf.modules.d/*.conf",
         ])
 
         self.add_forbidden_path("/etc/httpd/conf/password.conf")
@@ -45,8 +60,24 @@ class RedHatApache(Apache, RedHatPlugin)
         self.add_copy_spec_limit("/var/log/httpd/error_log", 5)
         self.add_copy_spec_limit("/var/log/httpd/ssl_access_log", 5)
         self.add_copy_spec_limit("/var/log/httpd/ssl_error_log", 5)
+        # JBoss Enterprise Web Server 2.x
+        self.add_copy_spec_limit("/var/log/httpd22/access_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd22/error_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd22/ssl_access_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd22/ssl_error_log", 5)
+        # Red Hat JBoss Web Server 3.x
+        self.add_copy_spec_limit("/var/log/httpd24/access_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd24/error_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd24/ssl_access_log", 5)
+        self.add_copy_spec_limit("/var/log/httpd24/ssl_error_log", 5)
         if self.get_option("log"):
-            self.add_copy_spec("/var/log/httpd/*")
+            self.add_copy_spec([
+                "/var/log/httpd/*",
+                # JBoss Enterprise Web Server 2.x
+                "/var/log/httpd22/*",
+                # Red Hat JBoss Web Server 3.x
+                "/var/log/httpd24/*"
+            ])
 
 
 class DebianApache(Apache, DebianPlugin, UbuntuPlugin):
@@ -65,4 +96,4 @@ class DebianApache(Apache, DebianPlugin,
         if self.get_option("log"):
             self.add_copy_spec("/var/log/apache2/*")
 
-# vim: et ts=4 sw=4
+# vim: set et ts=4 sw=4 :


Since we will rebase sos to upstream 3.3 (to be released soon), the apache pluing would be automatically updated in RHEL7.3. But our QE does not have additional capacity to verify this BZ.

Are you ok with the above statement and having the BZ fixed indirectly due to the rebase / without mentioning the BZ in errata (otherwise QE would have to deal with it)? Or do you prefer having the BZ in errata and verify it by yourself?

Comment 3 Bryn M. Reeves 2016-03-09 11:39:31 UTC
This was committed upstream last year:

commit 5ebd0bd9f06cffa1ff571f38df50ac107b8e0341
Author: Hisanobu Okuda <hokuda>
Date:   Wed Dec 16 23:10:50 2015 +0900

    [apache] Added collection for JBoss Web Server
    
    Signed-off-by: Hisanobu Okuda <hokuda>

See the pull request for more details & further suggestions I made to clean up the common code:

  https://github.com/sosreport/sos/pull/703

Comment 4 Robert Bost 2016-03-09 16:33:52 UTC
Per Bryn's comment, we can probably close this BZ.

Comment 5 Pavel Moravec 2016-03-10 07:31:57 UTC
Closing per #c4. In either way, it should appear in RHEL7.3 due to sos rebase.