Fully freeware APEX environment V: Configure GlassFish

In this post we’ll configure the GlassFish 3 server that we installed in the previous post.

Information has been aggregated from different blogs:

Apex & Apex listener download

Apex and the listener should be downloaded now.

Now we start the admin console and

mkdir -p $ORACLE_BASE/product/1.1.2/apxlistener
mkdir -p $ORACLE_BASE/product/4.0.2
unzip apex_listener.1.1.2.131.15.23.zip -d $ORACLE_BASE/product/1.1.2/apxlistener
unzip apex_4.0.2.zip -d $ORACLE_BASE/product/4.0.2

Running Glassfish as a service

A script must be created in /etc/init.d

gedit /etc/init.d/glassfish

Paste this into the new file:

#!/bin/bash
# description: Glassfish Start Stop Restart
# processname: glassfish
# chkconfig: 244 20 80
export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
export PATH=$JAVA_HOME/bin:$PATH
export GLASSFISH_HOME=/u01/app/oracle/product/3/glassfish

case $1 in
start)
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
;;
stop)
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
;;
restart)
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
;;
esac
exit 0

Now, make the script executable and add it to our chkconfig so it starts at boot.

chmod 755 /etc/init.d/glassfish
chkconfig --add glassfish
chkconfig glassfish on
/etc/init.d/glassfish start

Copy Oracle Apex Images

Apex assumes the /i/ folder on the http server to contain the apex images. We copy the files like:

$GLASSFISH_HOME/bin/asadmin start-admin
cp -r $ORACLE_BASE/product/4.0.2/apex/images $GLASSFISH_HOME/glassfish/domains/domain1/docroot/i/

Glassfish configuration

Now we open the browser at this address: http://localhost:4848/.
The server will ask us to sign in. Use the username “admin” and the password you supplied when installing Glassfish.

  1. Go to “Configuration – Security” in the tree at your left hand.
  2. Check the checkbox at “Default Principal To Role Mapping”
  3. Click the “Save” button at the top of the screen.

Now we’re going to add some users:

  1. Expand the “Configuration – Security – Realms” node in the tree
  2. Select the “file” realm
  3. Click the “Manage Users” button
  4. Click “New..”
  5. Create
    1. User: “Aminlistener”
    2. Group List: “Admin”
    3. Password: “verysecret”
    4. Click “OK”
  6. Repeat step 5 for:
    1. User: “managerlistener”
    2. Group List: “Manager”
    3. Click “OK”

Install the apax.war listener:

  1. Click the “Applications”-node in the tree
  2. Click the “Deploy” button
  3. Select “Packaged File to Be Uploaded to the Server”
  4. Click the “Browse” button and navigate to:
    /u01/app/oracle/product/1.1.2/apxlistener/apex.war
  5. On the “Deploy Applications or Modules”  specify:
    1. Type: Web Application
    2. Content Root: apex
    3. Application Name: apex
    4. Status: Enabled (checkbox: on)
    5. Description: Application Express Listener
    6. Click “OK”

Configure the Listener

  1. Open a new browser (tab/window): http://localhost:8080/apex/listenerConfigure
  2. See the section on Configuring the apex listener

That’s it.

1 thought on “Fully freeware APEX environment V: Configure GlassFish”

Leave a Comment