Sunday, December 4, 2011

APEX Listener with Tomcat7

Deploying APEX Listener to tomcat7 to access APEX

This is yet another way of accessing the APEX by using oracle's apex.war (download apex listener here http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/index.html). This can be used without the use of any web server like tomcat7, glassfish , weblogic etc. However deploying this application to a web server gives us the flexibility in maintaining and managing . I will be posting the use of APEX listener by itself and you will then know that what benefit the web server brings.This is all done on Linux x86-64 platform.

Steps:

1- Please download and install tomcat7. It is described in my other post. The URL is - http://modplsql.blogspot.com/

2- Install/Upgrade and make sure that APEX is installed inside the Oracle database. It comes standard with 3.2 version in 11g. However can be upgraded to 4.1. Details on this use this URL from my other post - http://apexdplsepg.blogspot.com/2011/12/install-upgrade.html

3- deploy the apex.war that was downloaded in step1 by copying it to $CATALINA_HOME/webapps directory and restarting the tomcat or from the tomcat management console that runs by default at http://<host>:8080

4- Now copy the ojdbc6.jar to $CATALINA_HOME/lib. Please note that CATALINA_HOME is the environment variable where tomcat7 is installed. The base directory.

5- Edit the  tomcat-users.xml file that resides in $CATALINA_HOME/conf as shown below:

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="Admin"/>
<role rolename="Manager"/>
<user username="tomcat" password="tomcat7" roles="manager-gui,admin-gui,Admin,Manager"/>

This should be just above the last line  that is - </tomcat-users>

I have used same user all along - one can choose to have different users by adding the username line over again.

5- Now untar the images that was created during the APEX install - refer step4  here http://apexdplsepg.blogspot.com/2011/12/install-upgrade.html

 This is very important that this is done the way it is described - otherwise the images will not appear.
 The images need to be extarcted to $CATALINA_HOME/webapps directory and the name of the directory will be "i"- $CATALINA_HOME/webapps/i. This is the docroot directory where APEX is looking for the images as /i. Please note that this can be changed as per your need - it need not be "i" - you can have different name but it need to be done at the database level when running the image build script.

6- Now completely shutdown the tomcat7 and start again after making sure that all the processes die and there is no one listening to port 8080 (I choose default but you can change it in server.xml file in $CATALINA_HOME/conf directory) using netstat and ps -ef commands.

7- Now use following URL to set the database connection. Please note that we are not using the mod_plsql DAD here we are using the APEX as an application and it will set the username and connection details.

http://<host>:8080/apex/listenerConfigure - like


after you are done you willbe taken to the following page (this is the Developer access page and can be accessed next time as http://<host>:8080/apex)

The admin page can be accessed as http://<host>:8080/apex/apex_adm and it will be as:

Please note that the admin is the user and password is the password you set by running the apxchpwd.sql   script, which is a temporary password and when you login below it will ask you to change. It is security enabled so I choose "Apex11g4!"


8- Now you can test the user those you set in the tomcat by accessing the following URL:

     http://<host>:8080/listenAdmin   
It will ask the username adn password and you will type tomcat/tomcat7 and you will be log in. Detail are in other post - http://apexdplsepg.blogspot.com/2011/12/apex-using-tomcat-7-dplsmodplsql.html

The Admin page Details looks like:



and the developer page looks like:


Hope this helps.

2 comments:

  1. Hi,

    I've a problem on the point 7: the link http://:8080/apex/listenConfigure

    but it respondes:


    HTTP Status 503 - Requested url http://localhost:8080/apex/listenConfigure is currently unavailable.

    Thank in advance

    ReplyDelete
  2. Sorry - I fix the step 7 - it was a typo.

    Thanks for pointing it out. If you would seen the picture below and enlarge it - it would have shown the URL.

    However, the step 7 should be:

    http://:8008/apex/listenerConfigure


    Hope this Helps,

    ReplyDelete