In my ongoing quest for freeware in combination with Oracle Apex I gave Oracle Unbreakable linux another try when I heard that you _are_ able to update/upgrade it using yum, without a support identifier.

First we install Oracle Unbreakable Linux here

I opted for the 64 bit version and installed a minimal version in my VirtualBox environment.

  • 2048 Mb memory
  • 32 Gb Harddisk
  • 2 CPU’s
  • 2 Network cards
    • Adapter 1: “NAT”
    • Adapter 2: “Host Only”

When the installer asks for the computername you should make the networkcards connect automatically:

On the bottom left you can select “Configure Network”

Select each of the network cards (eth0 and eth1) and click “Edit”

The trick is in selecting the “Connect automatically” checkbox. check it for both cards.

Continue the rest of the installer normally. Choose the “Minumal” install

After the installation log in as root.

mount /dev/dvd /mnt
cd /mnt/Packages
rpm -ivh wget #(and press the tab-key)
rpm -ivh nano #(and press the tab-key)
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
nano /etc/yum.conf

We now need to enable yum by adding an extra line to the configuration file:

enabled=1

That should do the trick. Test it out by issueing

yum update

This is part two of my series regarding a fully freeware APEX setup.

Post 1 coveres the installation of Oracle XE 11 beta on CentOS 5

Shut Down Apex-EPG

Log in as system into the XE database using SQL*plus. We must close the EPG within the database, because Tomcat is going to use the same port (8080)

execute dbms_xdb.sethttpport(0);

Tomcat installation

I took this from here.

su -
cd /etc/yum.repos.d
wget 'http://www.jpackage.org/jpackage50.repo' yum update
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
service tomcat6 start

Tomcat is running!

tomcat_01

That was easy enough. We need to do some configuration.

If you get dependency errors please have a look at the original post essentially it says to try this:

rpm -Uvh http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm

and then try again.

Firewall configuration

setup
"Firewall configuration"
"Customize"
"Other ports" 8080:tcp
"Ok"
service tomcat6 restart

Downloads: APEX Listener and APEX itself

Even though XE 11g is shipped with Apex preconfigured, for this setup we do need to link to the images folder. We do this by downloading the full Apex archive. At the same time we can allready download the listener as well:

Unzip Apex:

unzip apex_4.0.2.zip
unzip apex_listener.1.1.2.131.15.23.zip -d apex_listener

We only need the images folder from the apex distribution. Nevertheless it can come in handy when the full apex installer is available.

The Tomcat htmlroot (or docroot) is located at /var/lib/tomcat6/webapps.

We copy the apex and the listener installer files into the Oracle tree and create a symbolic link in tomcats’ webapps folder:

su -
mkdir $ORACLE_BASE/product/4.0.2
cp -r apex $ORACLE_BASE/product/4.0.2/apex/
ln -s $ORACLE_BASE/product/4.0.2/apex/images /var/lib/tomcat6/webapps/i
mkdir $ORACLE_BASE/product/1.1.2
cp -r apex_listener $ORACLE_BASE/product/1.1.2/apex_listener

Tomcat configuration

Edit the /etc/tomcat6/tomcat-users.xml. We’re still root..

gedit /etc/tomcat6/tomcat-users.xml

replace the last line (having “</tomcat-users>”). Replace the username and password as desired.

  <role rolename="manager"/>
  <role rolename="admin"/>
  <role rolename="Manager"/>
  <role rolename="Admin"/>
  <user username="apex" password="verysecret" roles="manager,admin,Manager,Admin"/>
</tomcat-users>

It’s a bit silly that the roles are mentioned twice, but apparently not all implementations use the same casing.
I’m using the “apex” user here with the password “verysecret”

Save the file (Duhh 😉 )

Now we must make sure that Tomcat gets started at boot-time:

chkconfig --add tomcat6
chkconfig tomcat6 on
reboot

That should do the trick. So far for Tomcat for now.

Installing the APEX listener

First we need to unlock the “apex_public_user” and set its password. Open up the SQL*plus commandline and enter:

alter user apex_public_user account unlock;
alter user apex_public_user identified by the_secret_password;

Now open Tomcat manager: http://localhost:8080/manager/html. Go to the section: WAR file to deploy.

tomcat_manager_01

Click the browse button and select the warfile from /u01/app/oracle/product/1.1.2/apex_listener/apex.war

Click the “deploy” button.

Now you’re ready to configure the listener

These are -some of- the notes I made when installing Oracle Apex 4.0.2 in a RedHat Linux environment (scenario 4 of my previous post).

## Mount folder located in filesystem in VM

[ ~]# su - root
[root@a005 ~]# mkdir /mnt/vmshare
[root@a005 ~]# mount -t vboxsf vmshare /mnt/vmshare

## Wat is mounted?

[root@a ~]# mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda3 on /home type ext4 (rw)
/dev/sda5 on /tmp type ext4 (rw)
/dev/sda6 on /var type ext4 (rw)
/dev/sdb1 on /app type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
vmshare on /mnt/vmshare type vboxsf (rw)

## Empty /tmp directory after failed install

[root@a005 ~]# rm -r -f /tmp

## Installation Oracle

sh-4.1$ cd /mnt/vmshare
sh-4.1$ cd database
sh-4.1$ ls
doc install response rpm runInstaller sshsetup stage welcome.html
sh-4.1$ sh runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 448 MB Passed
Checking swap space: must be greater than 150 MB. Actual 1999 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-04-10_10-42-53PM. Please wait ...

## Start SQLPLUS + database

export ORACLE_HOME=/app/oracle/product/rdbms/ora11g
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
sqlplus / as sysdba
startup

## Install APEX 4.0

export APEX_HOME=/app/oracle/product/apx/apx40/
mkdir $APEX_HOME
cp -r -f /mnt/vm/Oracle/apex/apex_4.0.2/* /app/oracle/product/apx/apx40/
cd /app/oracle/product/apx/apx40/apex
sqlplus / as sysdba
startup
@apxremov
@apexins SYSAUX SYSAUX TEMP /i/
@apxchpwd
alter user APEX_040000 account unlock;
alter user APEX_PUBLIC_USER account unlock;
alter user FLOWS_FILES account unlock;
alter user APEX_PUBLIC_USER identified by password;
alter user APEX_PUBLIC_USER account unlock;
sqlplus / as sysdba
@apex_epg_config /app/oracle/product/apx/apx40

Finally Assign ACL’s using the PL/SQL procedure provided in the Oracle installation guide.
… and test your install…