Bug 1114988 - Can not start httpd on Solaris and Windows
Summary: Can not start httpd on Solaris and Windows
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: httpd
Version: 2.1.0
Hardware: Unspecified
OS: Solaris
urgent
urgent
Target Milestone: ER04
: 2.1.0
Assignee: Mladen Turk
QA Contact: Libor Fuka
URL:
Whiteboard:
Depends On: 1118391 1118395
Blocks: 1079300
TreeView+ depends on / blocked
 
Reported: 2014-07-01 11:40 UTC by Libor Fuka
Modified: 2019-06-13 08:03 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-13 08:03:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
mod_snmp.conf (391 bytes, text/plain)
2014-07-10 14:43 UTC, Libor Fuka
no flags Details
snmpd.conf (5.73 KB, text/plain)
2014-07-10 14:44 UTC, Libor Fuka
no flags Details

Description Libor Fuka 2014-07-01 11:40:37 UTC
Description of problem:
Can not start apache httpd:

httpd.worker: Syntax error on line 216 of /opt/jboss-ews-2.1/etc/httpd/conf/httpd.conf: Syntax error on line 2 of /opt/jboss-ews-2.1/etc/httpd/conf.d/mod_snmp.conf: Cannot load /opt/jboss-ews-2.1/etc/httpd/libsnmpcommon.so into server: ld.so.1: httpd.worker: fatal: /opt/jboss-ews-2.1/etc/httpd/libsnmpcommon.so: open failed: No such file or directory

There is a bug in mod_snmp.conf
There is 
LoadModule snmpcommon_module libsnmpcommon.so
LoadModule snmpagt_module libsnmpmonagt.so

and should be
LoadModule snmpcommon_module modules/libsnmpcommon.so
LoadModule snmpagt_module modules/libsnmpmonagt.so

Comment 1 Libor Fuka 2014-07-01 11:42:35 UTC
Its the same for MS Windows

Comment 3 Mladen Turk 2014-07-01 12:53:04 UTC
Fixed.
This bug became apparent since now the mod_snmp is loaded bz default.

Comment 4 Libor Fuka 2014-07-03 08:21:25 UTC
Its not fixed completely
There is another problem for Solaris:
Syntax error on line 5 of /opt/jboss-ews-2.1/etc/httpd/conf.d/mod_snmp.conf:
Failure opening SNMPvar directory

mod_snmp.conf:
## Apache SNMP
LoadModule snmpcommon_module modules/libsnmpcommon.so
LoadModule snmpagt_module modules/libsnmpmonagt.so
SNMPConf conf
SNMPVar "/opt/jboss-ews-2.1/var/cache/mod_snmp"
## End of apache SNMP

It seems postinstall did not create var/cache directories.
There is only var/cache/mod_cluster directory

Windows is OK.

Comment 5 Libor Fuka 2014-07-03 08:37:28 UTC
postinstall creates directories in OS /var/cache not in /opt/jboss-ews-2.1/var/cache

Comment 6 Mladen Turk 2014-07-03 08:42:21 UTC
Hmm, seems like regression.
I'll fix that so it'll be part of next update together with storeconfig fixes. In the mean time you can just remove the '/opt/jboss-ews-2.1' prefix because the ending mod_snmp.conf will look like that.

Comment 7 Libor Fuka 2014-07-09 15:14:37 UTC
Its fix in ER4 Solaris zip but i found another problems with SNMP module:
Solaris:
=======
1. from httpd error_log:
SNMP: CovalentSNMP/2.3.0 (SNMP) could not be started
init_master_agent: Invalid local port (Address already in use)

Its because SNMP Solaris daemon from OS is started. I think its default configuration to have SNMP daemon started by default.
The solution is to stop OS SNMP Solaris daemon by: /etc/init.d/init.sma stop
Note: Its using port 161 for SNMP agent

2. Another Solaris problem in error_log:
SNMP: sconfig is not available

Windows:
========
1. from error_log:
SNMP: generic logger: Could not log error-info\n

We should find the solution.

Comment 8 Mladen Turk 2014-07-09 15:27:34 UTC
I think that JON folks should give us the working configuration.
The entire mod_snmp and it's load by default is because of their explicit request.

Comment 10 Jean-frederic Clere 2014-07-09 15:40:30 UTC
https://community.jboss.org/wiki/MonitoringApacheUsingSNMP

Comment 14 Libor Fuka 2014-07-10 14:42:44 UTC
I was tested mod_snmp on Solaris and Windows and it works with some known issues.
Httpd with mod_snmp started ok with proper configuration on Solaris and Windows and also snmpwalk return Apache httpd mib values.

For mod_snmp httpd monitoring is needed:
1. mod_snmp.conf in conf.d directory (configuration for conf needs to be absolute paths) - attached working example 
2. mod_snmp also needs snmpd agent configuration file which is referenced in mod_snmp.conf. So for example conf.d/snmpd/snmpd.conf - also attached working example

My suggestion is to change configuration of EWS for mod_snmp, mod_rt (these two modules are for JON monitoring) and also mod_cluster.conf.

For all platforms RHEL, Solaris, Windows:
1. Keep the mod_cluster.conf, mod_snmp.conf and mod_rt.conf in conf.d and rename them to mod_cluster.conf.sample, mod_snmp.conf.sample and mod_rt.conf.sample -> Mladen was right, its better to not started these by default, because not all customers need them but just let them sample configurations.
2. During httpd postinstall change the paths for SNMPConf and SNMPVar to absolute paths in conf.s/mod_snmp.conf.sample
3. Create new subdirectory conf.d/snmpd and place snmpd.conf.sample in this dir.
4. For Solaris and Windows - mod_jk.conf.sample and workers.properties.sample should be also placed in conf.d
5. Document it

Comment 15 Libor Fuka 2014-07-10 14:43:16 UTC
Created attachment 917118 [details]
mod_snmp.conf

Comment 16 Libor Fuka 2014-07-10 14:44:12 UTC
Created attachment 917119 [details]
snmpd.conf

Comment 17 Libor Fuka 2014-07-10 14:45:26 UTC
Mladen, Weinan do you agree ?
Is it lot of work for you to do rebuild of ER4 again or simply chaneg it on download.devel ?

Comment 18 Libor Fuka 2014-07-10 15:18:11 UTC
MS Windows known isuues: BZ 1118391 - mod_snmp MS Windows known issues
Solaris known issues: BZ 1118395 - mod_snmp Solaris known issues

Comment 19 Libor Fuka 2014-07-10 15:19:15 UTC
These two bugzillas should be documented as known issues

Comment 20 Weinan Li 2014-07-22 13:44:56 UTC
Patch applied:

[weli@dhcp-66-78-87 jboss-ews-el6]$ git diff HEAD^1 postinstall jboss-ews.spec
diff --git a/jboss-ews.spec b/jboss-ews.spec
index 9fe92f4..357c078 100644
--- a/jboss-ews.spec
+++ b/jboss-ews.spec
@@ -35,7 +35,7 @@
 %define ews_rev 0
 %define tc6version 6.0.41
 %define tc7version 7.0.54
-%define ews_release 26
+%define ews_release 27

 %define tcnativeversion 1.1.30
 %define mod_jkversion 1.2.40
@@ -62,6 +62,7 @@ Source6:        notes.txt
 Source5:        jboss-ews-patchzip.lst
 Source7:        jboss-ews-patchzip-2.lst
 %endif
+Source90        snmp.conf.sample
 %if %with signing
 Source99:       sign-unsigned-jars
 %endif
@@ -236,6 +237,7 @@ sed -i -e "s:^LoadModule proxy_balancer_module:#LoadModule proxy_balancer_module
 #mod_auth_kerb
 ln -s %{_libdir}/httpd/modules/mod_auth_kerb.so httpd/modules/
 ln -s %{_sysconfdir}/httpd/conf.d/auth_kerb.conf httpd/conf.d/
+
 %ifnarch ppc64
 #mod_rt
 cp -pr %{_libdir}/httpd/modules/mod_rt.so httpd/modules/
@@ -243,6 +245,8 @@ cp -pr %{_sysconfdir}/httpd/conf.d/mod_rt.conf httpd/conf.d/mod_rt.conf.sample
 #mod_snmp
 cp -pr %{_libdir}/httpd/modules/{snmpcommon,snmpmonagt,snmpsubagt}.so httpd/modules/
 cp -pr %{_sysconfdir}/httpd/conf.d/mod_snmp.conf httpd/conf.d/mod_snmp.conf.sample
+mkdir -p httpd/conf.d/snmpd
+cp %{SOURCE90} httpd/conf.d/snmpd/
 %endif
 # mod_cluster in tomcat 6 and 7
 pushd tomcat6/lib
@@ -525,6 +529,11 @@ install -m 644 *.zip $RPM_BUILD_ROOT/%{_javadir}/jbossas-fordev
 %endif

 %changelog
+* Tue Jul 22 2014 Weinan Li <weli> 2.1.0-27
+- BZ1114988
+- Add conf.d/snmpd/snmpd.conf.sample
+- modified mod_snmp.conf.sample
+
 * Mon Jul 21 2014 Permaine Cheung <pcheung> 2.1.0-26
 - Rename mod_rt|snmp.conf to mod_rt|snmp.conf.sample (BZ#1117659)

diff --git a/postinstall b/postinstall
index ad8ec17..3c00de3 100644
--- a/postinstall
+++ b/postinstall
@@ -43,22 +43,11 @@ if [ -f 'conf.d/mod_cluster.conf' ]; then
 fi

 #JBPAPP-9746
-if [ -f 'conf.d/mod_snmp.conf' ]; then
+if [ -f 'conf.d/mod_snmp.conf.sample' ]; then
     mkdir -p $currentDir/var/cache/mod_snmp
-    sed -i -e "s:SNMPVar /var/cache/mod_snmp:SNMPVar $currentDir/var/cache/mod_snmp:" conf.d/mod_snmp.conf
+    sed -i -e "s:SNMPVar /var/cache/mod_snmp:SNMPVar $currentDir/var/cache/mod_snmp:" conf.d/mod_snmp.conf.sample
 fi

-#for mod_nss
-#start
-#if [ ! -e $currentDir/alias/key3.db ]; then
-#     $currentDir/sbin/gencert $currentDir/alias > $currentDir/alias/install.log 2>&1
-#fi
-
-# Make sure that the database ownership is setup properly.
-#/bin/find $currentDir/alias -user root -name "*.db" -exec /bin/chgrp apache {} \;
-#/bin/find $currentDir/alias -user root -name "*.db" -exec /bin/chmod g+r {} \;
-#end of mod_nss
-
 #JBPAPP-9381
 sed -i -e "s:/var/www:jboss-ews-2.1/httpd/www:g" -e "s:/etc/httpd:jboss-ews-2.1/httpd:g" www/error/noindex.html

Comment 21 Libor Fuka 2014-07-22 13:49:33 UTC
Weinan, i think there is still missing:
+ sed -i -e "s:SNMPConf conf:SNMPConf $currentDir/conf.d/snmpd:" conf.d/mod_snmp.conf.sample

Comment 22 Libor Fuka 2014-07-22 13:51:47 UTC
+Source90        snmp.conf.sample 
should be
+Source90        snmpd.conf.sample 

sorry for that, but we have snmpd/snmpd.conf.sample in Windows and Solaris zips.

Comment 23 Weinan Li 2014-07-22 14:07:22 UTC
Thanks for checking quickly Libor!

More patches added and conf file renamed:

$ git diff HEAD^1 jboss-ews.spec postinstall
diff --git a/jboss-ews.spec b/jboss-ews.spec
index 5296808..66bc0fd 100644
--- a/jboss-ews.spec
+++ b/jboss-ews.spec
@@ -35,7 +35,7 @@
 %define ews_rev 0
 %define tc6version 6.0.41
 %define tc7version 7.0.54
-%define ews_release 27
+%define ews_release 28

 %define tcnativeversion 1.1.30
 %define mod_jkversion 1.2.40
@@ -62,7 +62,7 @@ Source6:        notes.txt
 Source5:        jboss-ews-patchzip.lst
 Source7:        jboss-ews-patchzip-2.lst
 %endif
-Source90:        snmp.conf.sample
+Source90:        snmpd.conf.sample
 %if %with signing
 Source99:       sign-unsigned-jars
 %endif
@@ -529,6 +529,9 @@ install -m 644 *.zip $RPM_BUILD_ROOT/%{_javadir}/jbossas-fordev
 %endif

 %changelog
+* Tue Jul 22 2014 Weinan Li <weli> 2.1.0-28
+- More patch for BZ1114988
+
 * Tue Jul 22 2014 Weinan Li <weli> 2.1.0-27
 - BZ1114988
 - Add conf.d/snmpd/snmpd.conf.sample
diff --git a/postinstall b/postinstall
index 3c00de3..8678d23 100644
--- a/postinstall
+++ b/postinstall
@@ -46,6 +46,7 @@ fi
 if [ -f 'conf.d/mod_snmp.conf.sample' ]; then
     mkdir -p $currentDir/var/cache/mod_snmp
     sed -i -e "s:SNMPVar /var/cache/mod_snmp:SNMPVar $currentDir/var/cache/mod_snmp:" conf.d/mod_snmp.conf.sample
+    sed -i -e "s:SNMPConf conf:SNMPConf $currentDir/conf.d/snmpd:" conf.d/mod_snmp.conf.sample
 fi

 #JBPAPP-9381

Comment 24 Libor Fuka 2014-08-04 10:12:20 UTC
verified with CR2 on MS Windows and Solaris


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