Configuring Apex Listener Version 2February 21, 2013 at 10:52 am | Posted in Linux, Oracle Application Express (Apex), Oracle Developement, Oracle Tools | 21 Comments
“Where is the listenerConfigure page?”
That seems to be a common question when people attempt to deploy the Apex Listener Version 2.
Version 2 of the Apex listener is very different than version one. The configuration and maintenance is no longer done through web pages, but either through the command line or through SQL Developer. In this post I’ll try to explain how to configuration via the command line is made. I’ll dedicate another post to configuring the listener through SQL Developer.
In my example I have downloaded and unzipped the apex listener into the directory /u01/cmr. You will probably choose a different path, so make sure you substitute your path whenever necessary.
Before you configure the database connection of the listener, it is good to specify the directory where the configuration files will be stored. If you don’t do that, then the config files will be stored in /tmp/apex, which is not a good place.
To specify the configuration directory for the apex listener, navigate to the directory where you unzipped the listener files (/u01/cmr) and run:
java -jar apex.war configdir /u01/cmr
Note that whenever you run the java -jar apex.war command, it changes the files inside the apex.war archive. In this case I just picked the same directory where I unzipped the files. The listener will create an apex directory here.
Now that we know where the configuration files will be, lets configure the database connection:
java -jar apex.war setup $ java -jar apex.war setup Feb 19, 2013 1:39:11 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder INFO: Using configuration folder: /u01/cmr/apex Enter the name of the database server [localhost]: Enter the database listen port : Enter 1 to specify the database service name, or 2 to specify the database SID :2 Enter the database SID [xe]:vrep 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 :3 Feb 19, 2013 1:39:50 PM oracle.dbtools.common.config.file.ConfigurationFiles update INFO: Updated configurations: apex $
After this process is complete, you will find a newly created directory inside your config dir. Note that the name of the configuration folder is mentioned on top of the program output. The listener is now ready to be either run in standalone mode or to be deployed to your web server. You can run the listener in standalone mode to test the database connection:
$ java -jar apex.war standalone --apex-images /u01/apex/images
Note that I included the argument –apex-images. This will let the listener know from which directory to pull the images. In my case I unzipped the Apex installation files into /u01. When you run the command, the last line of the screen output will tell you the URL for connecting to Apex. If everything works, deploy your file to your web server. That process hasn’t changed from version 1.
FYI: Inside the apex/ configuration directory is a file named apex.properties which contains the port number and the images directory. This file is read when the listener starts up in standalone mode.