In this post we’ll configure the GlassFish 3 server that we installed in the previous post.
Information has been aggregated from different blogs:
- http://www.davidghedini.com/pg/entry/install_glassfish_3_1_on
- http://bhapca.blogspot.com/2009/05/how-to-install-glassfish-on-centos-and.html
- The APEX Listener Installation guide (pdf)
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.
- Go to “Configuration – Security” in the tree at your left hand.
- Check the checkbox at “Default Principal To Role Mapping”
- Click the “Save” button at the top of the screen.
Now we’re going to add some users:
- Expand the “Configuration – Security – Realms” node in the tree
- Select the “file” realm
- Click the “Manage Users” button
- Click “New..”
- Create
- User: “Aminlistener”
- Group List: “Admin”
- Password: “verysecret”
- Click “OK”
- Repeat step 5 for:
- User: “managerlistener”
- Group List: “Manager”
- Click “OK”
Install the apax.war listener:
- Click the “Applications”-node in the tree
- Click the “Deploy” button
- Select “Packaged File to Be Uploaded to the Server”
- Click the “Browse” button and navigate to:
/u01/app/oracle/product/1.1.2/apxlistener/apex.war - On the “Deploy Applications or Modules” specify:
- Type: Web Application
- Content Root: apex
- Application Name: apex
- Status: Enabled (checkbox: on)
- Description: Application Express Listener
- Click “OK”
Configure the Listener
- Open a new browser (tab/window): http://localhost:8080/apex/listenerConfigure
- See the section on Configuring the apex listener
That’s it.
1 thought on “Fully freeware APEX environment V: Configure GlassFish”