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 -d $ORACLE_BASE/product/1.1.2/apxlistener
unzip -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:

# 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
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
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:
  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.

2 thoughts on “Fully freeware APEX environment V: Configure GlassFish

  1. In Glassfish 3.1.1 there are two configurations a default-config and a server-config. Should both of these be configured the same way or only the default-config? I.e. do both of these need users added?

    • Dan,

      I’m not a glassfish specialist. I added the config for Glassfish to be complete. I do think that the default-config is meant here..

      I only added users once.



Leave a Reply