When starting OHS2 (Oracle’s version of Apache HTTP) this morning I encountered the following errors in my logs:
httpd.worker: Syntax error on line 1040 of httpd.conf:
Syntax error on line 9 of plsql.conf: Cannot load /ohs/modules/mod_plsql.so into server: ohs/modules/mod_plsql.so: cannot open shared object file: No such file or directory
Now, I know that I have seen this before but I can’t remember the resolution. (If it turns out to be very lame … I’ll just delete this blog w/o posting it)
Step 1: I want to make sure that the file is actually on the server so I run:
[oracle@dev1 ~]$ find / -name mod_plsql.so -print 2>/dev/null
One file is returned:
/apps/oracle/Middleware/ohs2/ohs/modules/mod_plsql.so
So, it’s probably either permissions or path…
Checking the permissions:
[oracle@dev1 ~]$ ls -latr /apps/oracle/Middleware/ohs2/ohs/modules/
-rwxr-x— 1 oracle oinstall 427738 Apr 14 22:37 mod_plsql.so
The oracle user has the right permissions on the file … so, let’s check to see how the file is being called from the httpd.conf file (I am thinking environment variables at this point).
I want to take a look at the log file one more time to get the location of the httpd.conf file.
vi /apps/oracle/Middleware/ohs2/instances/ohs2_1/diagnostics/logs/OHS/ohs2/console~OHS~1.log
Ok, so we want to look at line 1040 on httpd.conf and then line 9 of plsql.conf.
$ vi /apps/oracle/Middleware/ohs2/instances/ohs2_1/config/OHS/ohs2/httpd.conf
Line 1040: include “moduleconf/*.conf”
$vi /apps/oracle/Middleware/ohs2/instances/ohs2_1/config/OHS/ohs2/moduleconf/plsql.conf
Line: 9: LoadModule plsql_module ${ORACLE_HOME}/ohs/modules/mod_plsql.so
Ok – so, let’s check to see if ORACLE_HOME is set correctly.
$ echo $ORACLE_HOME
/apps/oracle/Middleware
Ok … so the missing piece is that we should have $ORACLE_HOME set to /apps/oracle/Middleware/ohs2
Let’s change that and see if it breaks anything.
I have an environment file that I use to set the variables:
[oracle@dev1 ~]$ cat http.env
ORACLE_BASE=/apps/oracle/Middleware; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/ohs2; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib32:/lib:/user/local/bin; export LD_LIBRARY_PATH
ORACLE_SID=orcl; export ORACLE_SID
PATH=/usr/bin:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH; export PATH
ORACLE_INSTANCE=/apps/oracle/Middleware/ohs2/instances/ohs2_1; export ORACLE_INSTANCE
In the line above that starts with ORACLE_HOME … I added “ohs2” to the end of the path.
I re-sourced the environment file:
$ source http.env
And then restart the opmn service:
$ opmnctl stopall
$opmnctl startall
And now if I display the status I can see that OHS2 is up and running:
$opmnctl status –l
Processes in Instance: ohs2_1
———————————+——————–+———+———-+————+———-+———–+——
ias-component | process-type | pid | status | uid | memused | uptime | ports
———————————+——————–+———+———-+————+———-+———–+——
ohs2 | OHS | 27339 | Alive | 322392925 | 380172 | 0:00:10 | https:9999,https:4443,http:7777