Error in ohs log: File Does Not Exist: /Oracle_WT1/instances/PROD/$(APACHE2_HOME)
Last updated on JUNE 01, 2018
Applies to:Oracle Fusion Middleware - Version 126.96.36.199.0 to 188.8.131.52.0 [Release Oracle11g]
Information in this document applies to any platform.
The following error gets logged into the ohs diagnostic/logs OHS file every 20 seconds after the ohs server is started:
[OHS] [ERROR:32] [OHS-9999] [core.c] [host_id: xxx.xxx.xxx] [host_addr: xxx.xxx.xxx] [tid: 5] [user: root] [ecid: xxxx] [rid: 0] [VirtualHost: main] File does not exist: <PathToInstance>/$(APACHE2_HOME)
Most commonly this issue would happen when the DocumentRoot is commented out completely or moved into a VH definition in the httpd.conf file. Following is an explanation of what conditions to look for that will cause the issue when DocumentRoot is moved ot a VH structure.
The initial discovery of this problem was when the document root was moved to a VH with port 80 defined. However a different port was used for the global Listen directive. Port 80 was never opened with a Listen directive and since the DocumentRoot was deffined only for port 80, the result is this APACHE2_HOME error in the ohs log. Thus as the solution defines, the Listen directive defined globally must be changed to open this same VH defined port.
Further testing uncovered the following anomally resulting in this same error. With the condition just described concerning the VH, if the VH port were to be defined with a second Listen directive globally, the described error will ocurr is the second Listen directive is defined after another Listen directive.
In other words, the first Port defined in the httpd.conf will be used to identify the Document root. An example will best demonstrate this. Following is a snippet from httpd.conf showing Listen, DocumentRoot, and VH conditions leading to descibed issue.
# Hence default global DocumentRoot commneted out
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
# ServerAdmin email@example.com
# DocumentRoot "/usr/local/apache2/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "logs/dummy-host.example.com-access_log" common
<end of example>
In the code above note that DocumentRoot is defined within the VH, which uses port 80. So DocumentRoot is only known for port 80.
Hence the Listen is defined and port 80 is opened by ohs. But this case would result in the above error. The reason is when opmn process connects to ohs it will use port 7777 to find the value set for DocumentRoot and it is not known since DomumentRoot is commented out globally and port 7777 does not have any settings from the VH definition.
In this case there are 3 options:
1) Move Listen 80 above Listen 7777
2) Comment Listen 7777 out
3) Uncomment DocumentRoot in global area
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms