Apache Fails to Start with "libonssys.so: cannot open shared object file: No such file or directory" After Weblogic Plugin is Configured

The Problem

Apache is installed on Oracle Linux through “yum install httpd”. After the install the Apache server starts up successfully.

Then Using Oracle WebLogic Server Proxy Plug-Ins is followed to configure Weblogic plugin for the Apache HTTP server. Even with LD_LIBRARY_PATH is specified in the /usr/sbin/apachectl as follows the Apache server fails to start:

$ export LD_LIBRARY_PATH=/etc/httpd/wls-plugin/lib:$LD_LIBRARY_PATH

where, /etc/httpd/wls-plugin/lib holds the plugin library files.

# apachectl start
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
# journalctl -xe
-- The result is failed.
Mar 22 23:21:06 [HOSTNAME] systemd[x]: Unit httpd.service entered failed state.
Mar 22 23:21:06 [HOSTNAME] systemd[x]: httpd.service failed.
Mar 22 23:21:06 [HOSTNAME] polkitd[x]: Unregistered Authentication Agent for unix-
Mar 22 23:21:43 [HOSTNAME] polkitd[x]: Registered Authentication Agent for unix-pr
Mar 22 23:21:43 [HOSTNAME] systemd[x]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
--
--
-- Unit httpd.service has begun starting up.
Mar 22 23:21:43 [HOSTNAME] httpd[x]: httpd: Syntax error on line 57 of /etc/http
Mar 22 23:21:43 [HOSTNAME] systemd[x]: httpd.service: main process exited, code=exit
Mar 22 23:21:43 [HOSTNAME] kill[x]: kill: cannot find process ""
Mar 22 23:21:43 [HOSTNAME] systemd[x]: httpd.service: control process exited, code=e
Mar 22 23:21:43 [HOSTNAME] systemd[x]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support:
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Mar 22 23:21:43 [HOSTNAME] systemd[x]: Unit httpd.service entered failed state.
Mar 22 23:21:43 [HOSTNAME] systemd[x]: httpd.service failed.
Mar 22 23:21:43 [HOSTNAME] polkitd[x]: Unregistered Authentication Agent for unix-lines 2604-2629/2629 (END)

The system log message file (/var/log/messages) has the following:

Mar 22 16:46:45 [HOSTNAME] systemd: Starting The Apache HTTP Server...
Mar 22 16:46:45 [HOSTNAME] httpd: httpd: Syntax error on line 357 of /etc/httpd/conf/httpd.conf: Cannot load //etc/httpd/wls-plugin/lib/mod_wl_24.so into server: libonssys.so: cannot open shared object file: No such file or directory
Mar 22 16:46:45 [HOSTNAME] systemd: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 22 16:46:45 [HOSTNAME] kill: kill: cannot find process ""
Mar 22 16:46:45 [HOSTNAME] systemd: httpd.service: control process exited, code=exited status=1
Mar 22 16:46:45 [HOSTNAME] systemd: Failed to start The Apache HTTP Server.
Mar 22 16:46:45 [HOSTNAME] systemd: Unit httpd.service entered failed state.
Mar 22 16:46:45 [HOSTNAME] systemd: httpd.service failed.

The Solution

According to the system message file, the Apache server fails to start due to library reference error. It is unable to locate the library referenced.

You would need root privilege to perform following steps.

1. cd to /etc/ld.so.conf.d.

# cd /etc/ld.so.conf.d

2. create a file that contains the path to the plugin library files. For example:

# echo /etc/httpd/wls-plugin/lib > wlsplugin.conf

3. run “ls -l” command to make sure the file wlsplugin.conf is created successfully

# ls -l
total 24
-rw-r--r--. 1 [user] [group] 19 May 26 2017 dyninst-x86_64.conf
-r--r--r--. 1 [user] [group] 63 Oct 24 2017 kernel-3.10.0-514.el7.x86_64.conf
-r--r--r--. 1 [user] [group] 324 Oct 24 2017 kernel-4.1.12-61.1.18.el7uek.x86_64.conf
-rw-r--r--. 1 [user] [group] 17 Sep 1 2016 libiscsi-x86_64.conf
-rw-r--r--. 1 [user] [group] 17 Sep 28 2016 mysql-x86_64.conf
-rw-r--r-- 1  [user] [group] 26 Mar 22 21:22 wlsplugin.conf

3. run ldconfig command:

# ldconfig

4. start the Apache server by running “apachectl start”. The server should now be able to start successfully.

# apachectl start