Starting with 2.0.6 and above, Apex Listener is renamed to Oracle REST Data Services(ORDS), and the deployment file name is also changed from apex.war to ords.war to reflect this change.
For ORDS/Apex Listener 2.x, the Listener Configuration web page for database connection is gone. Now you have to use the command line to config database connection before you deploy ORDS/apex listener.
Below are the steps to install and configure ORDS/apex listener 2.x on Weblogic Server
download software:
1. ORDS/APEX listener 2.0.x
2. images from the right version of apex
1. create a apex directory to store configuration file and image files on both Admin server and manager server.
mkdir $MW_HOME/user_projects/application/apex
or
mkdir $MW_HOME/user_projects/application/ords (if you are using ORDS 2.0.6 +)
2. get images from the right version of apex. You can check the version of installed apex by following sql
select comp_name,version from dba_registry;
or
select * from apex_release;
If the version is not right, you may get blank web page when you access apex after installation.
3. copy the image files
Create a directory called images under the one you created at step 1, and copy the image files to this directory on both Admin server and manager server.
When you deploy ORDS on weblogic, the image files will not be copied from Admin server to managed server automatically, so you have to do this manually, otherwise you will get blank web page when you access apex after installation.
4. configure ORDS/apex listener configuration directory.
By default, the ORDS/apex listener configuration files is saved under /tmp/apex(or /tmp/ords for 2.0.6+). The command
java -jar apex.war configdir
or
java -jar ords.war configdir
will tell you that config.dir setting is not set, like below
Sep 22, 2014 12:13:03 PM oracle.dbtools.common.config.cmds.ConfigDir execute
INFO: The config.dir setting is not set
However, using /tmp/apex(or /tmp/ords) as configuration directory is not good idea. If someone clean the space for the /tmp, your configuration may be gone. Therefore it is better to set a dedicated configuation directory. The command used for this is:
java -jar apex.war configdir <MW_HOME>/user_projects/application
verify the configuration path has been set correctly.
java -jar apex.war configdir
or
java -jar ords.war configdir
5. configure the database connection.
java -jar apex.war setup
or
java -jar ords.war setup
oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: $MW_HOME/user_projects/applications/apex
Enter the name of the database server [localhost]:mydbserver.domain.com
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
Enter the database service name:mydb
Enter the database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER:
Confirm password:
Enter 1 to enter passwords for the RESTful Services database users (APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used for APEX_PUBLIC_USER or, 3 to skip this step [1]:3
oracle.dbtools.common.config.file.ConfigurationFiles update
INFO: Updated configurations: defaults, apex
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2
This command creates a directory apex under the configdir you specified above and two configuration files under apex(or ords) directory:
1. defaults.xml, which contains the database connection information
2. conf/apex.xml, which contains the apex schema information.
6. Create the Web Archive to refer the Oracle Application Express image files
java -jar apex.war static $MW_HOME/user_projects/applications/apex/images
or
java -jar ords.war static $MW_HOME/user_projects/applications/apex/images
This command will generate a i.war under the current directory. The i.war file contains only references to the image files, and it doesn’t contain the images themselves.
7. deploy apex.war(or ords), and then i.war file to weblogic server.
Under security section, please choose:
Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor
Leave everything else as defaults.
8.Configure WebLogic to Handle HTTP Basic Challenges Correctly
Add the <enforce-valid-basic-auth-credentials>
element to config.xml
within the<security-configuration>
element on Admin server . The edited file should look like the following:
...
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
</security-configuration>
...
Save the updated config.xml
file & restart Weblogic server.
9. copy configration file from admin server to manager server.
a. copy $MW_HOME/user_projects/applications/apex(or ords)/conf/* to manager server. If you didn’t do this, you will get the message stating: “Apex listener has not been configured yet” when access apex.
b. copy $MW_HOME/user_projects/applications/apex(or ords)/defaults.xml to managed server. The one generated on manager server doesn’t include database user and password information, so if you didn’t do this, you will hit “503 – Service Unavailable” messages when trying to access APEX later on
10. Restarted Managed server and verify the State and Health of apex and i
Optional Step
If you want to use OHS as front end web server,especially if you want to integrate Apex with Oracle Access Manager(OAM), then you have to install and configure Oracle HTTP Server(OHS) and Weblogic OHS plugin.
In order for the connection between Oracle HTTP Server and Oracle WebLogic Server to work correctly you must also add the following to the mod_wl_ohs.conf file for the Oracle HTTP Server:
<IfModule weblogic_module>
#Using a single weblogic server specific to the one location
#The weblogic console is used as an example:
<Location /console>
SetHandler weblogic-handler
WebLogicHost <weblogic server name>
WebLogicPort <weblogic server port>
</Location>
# Map the Apex Context root
<Location /apex(or ords)>
SetHandler weblogic-handler
WebLogicHost <weblogic server name>
WebLogicPort <weblogic server port>
</Location>
# Map the images i.war
<Location /i >
SetHandler weblogic-handler
WebLogicHost <weblogic server name>
WebLogicPort <weblogic server port>
</Location>
</IfModule>
You must now stop and then restart the Oracle HTTP Server for the changes to take
effect.
Note:
After you configured the apex, you can verify database connection using standalone mode w/o getting weblogic involved.
java -jar apex.war standalone
The first time you run the standalone command, you will be prompted for the APEX images directory and the standalone listener port. These values will be saved in the apex.properties file in you APEX Listener configuration directory structure.
If the apex.properties file exists in the APEX Listener Configuration Directory, the port values and images location defined in this file will be used.
To override the port or APEX images location value in the the apex.properties file for the configuration, use the –port or –apex-images parameters to override the desired value. For example, the following overrides the port value:
java -jar apex.war standalone –port 8090
further reading
To integrate APEX with Oracle Access Manager(OAM) 11gR2, please read this post
To configure APEX Listener/ORDS 2.0.x to serve multiple APEX instances, please read this post
reference:
http://docs.oracle.com/cd/E37099_01/doc/doc.20/e25066/toc.htm