Disclaimer
The End Product
VirtualBox with Oracle Enterprise Linux 5.6
VirtualBox Basic Configuration
Creating a new VM
Setting up network
Installing OEL 5.6
Oracle Enterprise Linux Configuration
Configuring yum with Oracle public repository
Preparing for Oracle Software
The easy way
The Hard Way
Finalizing VirtualBox Setup
Installing VirtualBox Guest Additions
Adding Shared Folder
Starting Your VM Without Terminal Window
Cloning You Virtual Machine
Installing Oracle 11g XE
Pre Flight Check
Installing the software
Editing environment variables for user oracle
Installing Apache HTTP Server
Pre-requisites
Installing Apache
Configure automatic start
Configure Apache with APEX
Copy images directory
Configure Apache with APEX
Installing Java
Installing Apache Tomcat 7
Installation
Configure automatic startup
Installing and configuring APEX Listener with Apache HTTP and Apache Tomcat
Installing APEX Listener
Configure APEX Listener
Bringing it together
Upgrading to Application Express 4.1
Disclaimer
This document is no guarantee for happiness or good health, but it might save you some trouble nonetheless.
This is more like a log of observations for my own use, and I give no guarantees as to the end result (you know; whatever you do, do not blame it on me ).
The End Product
So, what am I aiming at here? Briefly it’s the architecture illustrated below:
This is nothing new, but sure to give some headaches if it is you first time.
Why did I choose Tomcat when it is not a supported configuration? Well, old habits die hard I guess. I know Tomcat, that is all...
VirtualBox with Oracle Enterprise Linux 5.6
This is an installfest for OEL 5.6 64bit with some tidbits of software. It is based on a Windows 7 64-bit host, but should be similar for Linux host as well. Written for VirtualBox 4.1.2r73507.
Oracle Linux is licensed under GNU GPL, but commercial technical support can be bought.
I used Dr. Tim Hall et al at http://oracle-base.com for the VirtualBox, Linux and Oracle database installations when I got stuck:
If I have gotten any of the steps here wrong, he probably got them right!
VirtualBox Basic Configuration
Setting default directory and host-only network
- File -> Preferences
- General, choose desired location
- Network
- Add Host Only Network
(Answer Yes to any OS-change messages) - Edit Host Only Network, change to static IP
- Click Ok to confirm
Creating a new VM
- VM-Name and OS-type
- Memory:
- Create Virtual Hard Disk, repeat the steps and choices below
- Click Create and Create again
- The new machine is now created:
Setting up network
For this particular configuration, I am going to use two network adapters: One used as a static IP for the Host Only Network, and secondary as a DHCP Bridged Network to be used with yum and such.
- Highlight the newly created VM, and click Network
- Set up Adapter 1:
- Enable Adapter 2:
Set the Name to whatever host network adapter you have available. - Click Ok, I will set up Shared Folder at a later time.
Installing OEL 5.6
- Highlight the VM and click Storage
- Highlight the empty CD, and click the disc on the far right to choose iso:
- Choose the previously downloaded OEL 5.6 ISO:
- Click Ok
- Start the VM
NB: At this point your vm might refuse to start because of some vt-x (Intel based) not being set properly. On my laptop I had to enter BIOS to change the settings and enable virtualisation technology thingy… - Press Enter to start installation in graphical mode
- Choose Skip
- Next
- English, next
- Norwegian (or whatever), next
- Choose Yes
- Check the "Review and modify partitioning layout" option
- Click Yes
- I use the following for my test installation
- Highlight /boot and click Edit, set it to fixed 150M
- Click Ok
- It should look something like this:
- Next
- Accept default, Next
- Mark eth0, and click Edit:
- Set static IP address for ipv4, and disable ipv6, click Ok:
- Set host name manually, and activate eth1 on boot:
- Set time zone
- Set root pwd
- Choose customize now
- Choose:
- GNOME Desktop Environment
- Editors
- Graphical Internet
- Text-based Internet
- Development Libraries
- Development Tools
- Server Configuration Tools
- Administration Tools
- Base
- System Tools
- X Window System
-
- Click Next, and Next after summary
The installation will now start
- This operation may take some time, depending on your system
- Voila
- Remove ISO from disc (if it’s not already removed)
- Click Reboot
Oracle Enterprise Linux Configuration
After reboot:
- Forward
- Agree, forward
- Disable firewall, click Yes on the popup dialog
- Disable SE Linux, and click Yes on the popup dialog
- Do not enable KDump
- Set date, time:
- You do not have to create user at this time, click Forward and Continue on popup dialog
- Accept defaults, click forward:
- Click Finish
- Reboot
- Voila
Configuring yum with Oracle public repository
- Log in as root
- Open terminal
- cd /etc/yum.repos.d
- wget http://public-yum.oracle.com/public-yum-el5.repo
- vi public-yum-el5.repo
- Locate [ol5_u6_base] and set enabled=0 to enabled=1
- Write quit vi
- yum list
- If a list of things appears, your yum configuration is now working.
Preparing for Oracle Software
Beware that some of the packages installed here, will be used by the Virtualbox Guest Additions too.
The easy way
- Open terminal window
- yum install oracle-validated
- And all will be well…
The Hard Way
- Mount the oel 5.6 iso by clicking the Devices .> CD/DVD Devices and browsing to the correct image
- Go to Server directory of the DVD
- Install the packages as described below:
- rpm -Uvh binutils-2.*
- rpm -Uvh compat-libstdc++-33*
- rpm -Uvh elfutils-libelf-0.*
- rpm -Uvh elfutils-libelf-devel-*
- rpm -Uvh gcc-4.*
- rpm -Uvh gcc-c++-4.*
- rpm -Uvh glibc-2.*
- rpm -Uvh glibc-common-2.*
- rpm -Uvh glibc-devel-2.*
- rpm -Uvh glibc-headers-2.*
- rpm -Uvh ksh-2*
- rpm -Uvh libaio-0.*
- rpm -Uvh libaio-devel-0.*
- rpm -Uvh libgcc-4.*
- rpm -Uvh libstdc++-4.*
- rpm -Uvh libstdc++-devel-4.*
- rpm -Uvh make-3.*
- rpm -Uvh sysstat-7.*
- rpm -Uvh unixODBC-2.*
- rpm -Uvh unixODBC-devel-2.*
- Check and update parameter settings
- fs.suid_dumpable = 1
- fs.aio-max-nr = 1048576
- fs.file-max = 6815744
- kernel.shmall = 2097152
- kernel.shmmax = 536870912
- kernel.shmmni = 4096
- kernel.sem = 250 32000 100 128
- net.ipv4.ip_local_port_range = 9000 65500
- net.core.rmem_default = 262144
- net.core.rmem_max = 4194304
- net.core.wmem_default = 262144
- net.core.wmem_max = 1048586
- Use /sbin/sysctl -a | grep <param-name> to check it
- Use vi /etc/sysctl.conf to edit
- Use /sbin/sysctl –p to apply changes
- Add the following lines to the "/etc/security/limits.conf" file.
- oracle soft nproc 2047
- oracle hard nproc 16384
- oracle soft nofile 1024
- oracle hard nofile 65536
- oracle soft stack 10240
- groupadd oinstall
- groupadd dba
- useradd -g oinstall -G dba,oinstall oracle
- passwd oracle
Choose the easy way!
Finalizing VirtualBox Setup
Installing VirtualBox Guest Additions
This is probably going to be a bit messy, so bear with me…
- Log in as root
- In VirtualBox window, click Devices -> Install Guest Additions
- Open terminal in vboxadditions directory
- Before running VBoxLinuxAdditions.run, you must add a trick to the book:
export MAKE='/usr/bin/gmake -i' - Run VBoxLinuxAdditions.run
You may experience problems with the OpenGL (Failed), if this happens, reboot and repeat.
Adding Shared Folder
- In VirtualBox Manager, highlight your VM and click Shared Folders
- Click Add Shared Folder to the right, and map your folder to a physical path as below:
- Click Ok and Ok
- Log in as root in your VM
- Reboot
- Log in as root again, and check that the folder is there:
- As a nice touch, you can add user oracle to vboxsf-group, so it will be able to read from the shared folder
- Start a terminal window as root
- usermod -g oinstall -G dba,vboxsf oracle
- exit terminal and log out
- Log in as oracle to test
Starting Your VM Without Terminal Window
Now that things are starting to get settled, maybe you won’t need the gui anymore (putty works just fine). The blog post here gave me some pointers: http://blogs.oracle.com/mock/entry/running_virtualbox_vms_as_services.
- Download VBoxVmService here: http://vboxvmservice.sourceforge.net/ to windows host
- Unzip into a directory (C:\Software\VirtualMachines\vms)
- Edit VBoxVmService.ini to something like this
[Settings]
ServiceName=VBoxVmService
VBOX_USER_HOME=C:\Users\<your windows user name>\.VirtualBox
PauseShutdown=5000
[Vm0]
VmName=oel-5.6-64-base
WorkingDir=C:\Software\VirtualMachines\vms
ShutdownMethod=acpipowerbutton
AutoStart=yes
- You can add more vms later ([Vm1], [Vm2], etc.)
- Right click cmd and choose “Run as administrator”
- cd C:\Software\VirtualMachines\vms
- VmServiceControl.exe -i
- exit
- Start Services (the Manager)
- Set VBoxVmService to Manual
- exit
- Create a new desktop file called Start My VMs.bat
- Edit file content to be:
- net start "VBoxVmService"
- Save
- Reboot
To start you vms, just right click the “Start My VMs.bat” and choose “Run as Administrator”.
Cloning You Virtual Machine
Before moving on with installing more software on your machine, this is a nice time to backup your work. I will create a clone of my machine at present state (chicken backup…).
I prefer cloning when “BIG” things happen to my vm’s, and use the snapshots for smaller changes. If I want to have a version of the vm without any Oracle software installed, I clone, if I want to try out different install options for software, I use snapshots.
- Shut down your vm
- Right click your vm in VirtualBox Manager
There are several “old” examples on how to do this on the internet, seems like the “Clone” option has not been available in the VirtualBox GUI such a long time. - Check Reinitialize MAC Addresses of all network cards, this will probably make things easier if you want to use it again on the same host
- Choose Full Clone, and click Clone
- The cloning may take some time
- The new virtual machine will appear in VirtualBox Manager when finished:
Installing Oracle 11g XE
Pre Flight Check
First off, remove Network Adapter 2 with DHCP, we will use static IP for this:
- In VirtualBox Manager highlight your vm, and click Network
- Uncheck En able Network Adapter 2
- Click Ok
- Download the appropriate software from oracle.com
- In my case: Oracle 11g XE Linux x86 64-bit
- Unzip the file, and place the rpm package in the predefined Shared folder
- Start the virtual machine
Installing the software
After booting, log in as root
- Start a terminal window, and verify the location of the package
- Install the package
rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm - If all goes well, you will see:
- Run the post-install configurations
/etc/init.d/oracle-xe configure
Change defaults if you know what you are doing, otherwise defaults are okay
(This may take some time btw)
I have experienced some problems re-installing Oracle 11g XE, but first install should work just fine. (and even if it didn’t, you can just rollback to the previous snapshot, right?) - Voila!
Editing environment variables for user oracle
- Open terminal as oracle
- List and copy contents from the generated environment file:
cat /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
Copy the content of the file - vi ./.bash_profile
Add the content copied above - Write and quit vi
:wq - Start a new terminal as oracle, and check that the database is working
sqlplus /nolog
conn / as sysdba
- While still there, enable APEX for external use
exec DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
- You can verify this with the following URL from host os:
http://<yourhostname>:8080/apex
Done.
Installing Apache HTTP Server
I like things tidy, so I will install a new Apache HTTP server at the same location as the rest of the server products (/u01), and ditch the one that came with the installation.
A side note: From here on out, there will be precious little gui. If you are not familiar with linux command line or vi, you will probably get through, but knowledge of these are preferable.
Pre-requisites
(Rant: don’t you just hate it when you see that: “pre-requisites”?!? All the hard parts are usually hidden behind the precious few bullet points following “pre-requisites”, and since they are just “pre-requisites”, the author never bothered to fully explain what you actually have to do… Like me :-))
- Remove any default installed apaches (!)
Log in as root
yum remove httpd - Changing ownership of /u01, let user oracle rule those premises
Log in as root
chown –R oracle:oinstall /u01 - Download httpd-2.2.21.tar.gz (Unix Source) from Apache
- Place the file in the shared folder (mapped as /media/sf_Shared in the virtual machine)
tar -xzf httpd-2.2.21.tar.gz - Adding user oracle to apache group
usermod -g oinstall -G dba,vboxsf,apache oracle
Installing Apache
There are a number of install options, but we are going to keep it somewhat simple. It is going to be installed at /u01/app/apache2.
- Log in as root
- cd /media/sf_Shared/httpd-2.2.21
- if you really want to ./configure --help to see all options
--prefix=<installdir>
--enable-so (load modules at runtime without recompiling apache) - ./configure --prefix=/u01/app/apache2 --enable-modules=most --enable-cache --enable-disk-cache --enable-mime-magic --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ajp --enable-speling
- make
(may take some time…) - make install
- You have to change user to root if you want to test the installation, oracle is not a privileged user (port <1024). You will most likely get a 403 access denied, but we will deal with that later.
- Change ownership of apache directories
chown -R oracle:oinstall /u01/app/apache2
Configure automatic start
Setting up Apache for automatic start on boot
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /u01/app/apache2/logs/httpd.pid
# config: /u01/app/apache2/conf/httpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/u01/app/apache2/bin/apachectl
httpd=/u01/app/apache2/bin/httpd
pid=/u01/app/apache2/logs/httpd.pid
prog=httpd
RETVAL=0
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd $pid
}
reload() {
echo -n $"Reloading $prog: "
killproc $httpd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f $pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status"
echo $"|fullstatus|graceful|help|configtest}"
exit 1
esac
exit $RETVAL
- :wq
- chmod 755 /etc/init.d/httpd
- chkconfig --add httpd
- chkconfig --list httpd
- httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
- chkconfig --level 2345 httpd on
- chkconfig --list httpd
- httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
- shutdown -r now
Configure Apache with APEX
If you want to use Oracle APEX with Apache Tomcat and APEX Listener, you must check the next chapter to avoid duplicate steps (no harm done, just unnecessary work…).
Copy images directory
- Download APEX 4. 0.2 from oracle.com (the all languages version)
- Unzip the file, and place the apex directory in the shared folder
- Log in as user oracle
- Copy the image directory to /u01/www/i
cp -rf /media/sf_Shared/apex/images /u01/www/i - Change execution rights
su - root
chown -R oracle:oinstall /u01/www
chmod -R 755 /u01/www
Configure Apache with APEX
- Log in as user oracle
- vi /u01/app/apache2/conf/httpd.conf
- Paste the following lines at the bottom of the file (yes, I am skipping the external vhosts here)
<VirtualHost *:80>
ServerAdmin dummy@dummy-host.example.com
DocumentRoot "/u01/www"
ServerName bomturlocalhost
ServerAlias bomturlocalhost
#RewriteEngine On
#RewriteLog "logs/rewrite.log"
#RewriteLogLevel 9
#LogLevel debug
ProxyRequests Off
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
<location /apex>
RewriteEngine on
# Look for requests using the GET request method
RewriteCond %{REQUEST_METHOD} GET
# Look for requests to /apex/f
RewriteCond %{REQUEST_URI} /apex/f.*
# Allow access if the app is 1000 and 2000 and 4*
# If any of the following are removed, acces will be denied
RewriteCond %{QUERY_STRING} !^p=1000.*
RewriteCond %{QUERY_STRING} !^p=2000.*
RewriteCond %{QUERY_STRING} !^p=4*
# If the above rules match, then deny access
RewriteRule /.* [F]
SetEnv force-proxy-request-1.0 1
ProxyPass http://127.0.0.1:8080/apex
ProxyPassReverse http://127.0.0.1:8080/apex
</location>
</VirtualHost>
- :wq
- Restart httpd service
su - root
service httpd restart - Test configuration by starting a browser on your local host, and pointing it to http://<your_vhost_name/apex
- If you have forgotten your password, reset it by:
- cd /u01/app/oracle/product/11.2.0/xe/apex/
- sqlplus "/ as sysdba"
- @apxchpwd
Oracle APEX is now ready to use with Apache HTTP Server, if you have no interest in using APEX Listener with the Apache Tomcat, then you can end here.
Installing Java
- Download Java 1.6.x for Linux x64
- Place the file in the Shared directory
- Log in as oracle
- mkdir /u01/app/java
- mv ./jre-6u27-linux-x64.bin /u01/app/java
- ./jre-6u27-linux-x64.bin
- rm jre-6u27-linux-x64.bin
- Add java to oracle profile
- cd /home/oracle
- vi .bash_profile
- Add the following lines before export PATH
JAVA_HOME=/u01/app/java/jre1.6.0_27
PATH=$PATH:/u01/app/java/jre1.6.0_27/bin
Installing Apache Tomcat 7
Installation
- Download Apache Tomcat 7
- Place the file in the Shared directory
- Extract tomcat
Log in as oracle
mv apache-tomcat-7.0.22.tar.gz /u01/app - “install” tomcat
cd /u01/app
tar -xzf apache-tomcat-7.0.22.tar.gz
rm apache-tomcat-7.0.22.tar.gz
mv apache-tomcat-7.0.22/ /u01/app/tomcat7
- Before starting and testing tomcat, you have to change port (default 8080, which is the same as the EPG of Oracle 11g XE)
vi /u01/app/tomcat7/conf/server.xml
/8080 (or search for 8080 any way you want :-)) - change 8080 to 8900 for the http connector port
- :wq
- cd /u01/app/tomcat7/bin/
- ./startup.sh
- Start a browser from your host, and point it to http://<vhostname>:8900
Configure automatic startup
- Log in as root
- cd /etc/init.d/
- vi tomcat
- Paste the following code
#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/u01/app/java/jre1.6.0_27
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/u01/app/tomcat7
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
- :wq
- chmod 755 tomcat
- chkconfig --add tomcat
- chkconfig --level 234 tomcat on
- chkconfig --list tomcat
tomcat 0:off 1:off 2:on 3:on 4:on 5:off 6:off
- Test it with service tomcat start/stop
shutdown -r now
Installing and configuring APEX Listener with Apache HTTP and Apache Tomcat
I am going to use Apace HTTP in front of Apache Tomcat with APEX Listener installed. I will suffer the performance penalty of the extra software component (Tomcat) for the safety of running the listener inside a proven container. I will use mod_proxy/mod_proxy_http to achieve this.
Installing APEX Listener
- Download and unzip APEX Listener in the shared folder
- Log in as user oracle
- vi /u01/app/tomcat7/conf/tomcat-users.xml
- Insert the following lines:
<role rolename="admin"/>
<role rolename="manager"/>
<role rolename="Admin"/>
<role rolename="Manager"/>
<user username="oracle" password="oracle" roles="admin,manager,Admin,Manager"/> - :wq
- Copy the war file
cp /media/sf_Shared/apex_listener.1.1.3.243.11.40/apex.war /u01/app/tomcat7/webapps/ - Restart tomcat
su - root
service tomcat restart
exit - Create a password for APEX_PUBLIC_USER
sqlplus /nolog
conn / as sysdba
alter user APEX_PUBLIC_USER identified by <somesecretpasswd>;
exit
Done with the Tomcat.
Configure APEX Listener
- Go to your host system and start a browser
- Point it to http://<yourserver>:8080/apex/listenerConfigure
- Set the credentials:
- Click Apply
- If you get this message:
- Try the following:
sqlplus /nolog
conn / as sysdba
alter user APEX_PUBLIC_USER account unlock; - If you try it now, it will not work (it will not find images and javascripts). If you are eager, create a symbolic link to the image catalog created earlier in the documents root directory of the apache:
ln -s /u01/www/i /u01/app/tomcat7/webapps/i
Bringing it together
To make it all work, Apache HTTP must be configured to route call through the APEX Listener in the Tomcat. The next steps will explain how to do this:
- Log in as user oracle
- cp /u01/app/apache2/conf/httpd.conf /u01/app/apache2/conf/httpd.conf.002
- vi /u01/app/apache2/conf/httpd.conf
- Edit the VirtualHost directive, and point it to your brand new tomcat with apex listener:
<VirtualHost *:80>
ServerAdmin dummy@dummy-host.example.com
DocumentRoot "/u01/www"
ServerName bomturlocalhost
ServerAlias bomturlocalhost
#For debugging when something goes wrong
#RewriteLog "logs/rewrite.log"
#RewriteLogLevel 9
#LogLevel debug
ProxyRequests Off
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
<location /apex>
RewriteEngine on
# Look for requests using the GET request method
RewriteCond %{REQUEST_METHOD} GET
# Look for requests to /apex/f
RewriteCond %{REQUEST_URI} /apex/f.*
# Allow access if the app is 1000 and 2000 and 4*
# If any of the following are removed, acces will be denied
RewriteCond %{QUERY_STRING} !^p=1000.*
RewriteCond %{QUERY_STRING} !^p=2000.*
RewriteCond %{QUERY_STRING} !^p=4*
# If the above rules match, then deny access
RewriteRule /.* [F]
SetEnv force-proxy-request-1.0 1
ProxyPass http://127.0.0.1:8900/apex
ProxyPassReverse http://127.0.0.1:8900/apex
</location>
</VirtualHost>
- :wq
- Restart apache
su - root
service httpd restart
exit - You must also tell the tomcat that it is running with a proxy in front
cp /u01/app/tomcat7/conf/server.xml /u01/app/tomcat7/conf/server.xml.002 - Edit default connector part of the file to be:
<Connector port="8900" protocol="HTTP/1.1"
connectionTimeout="20000"
maxHttpHeaderSize="32676"
redirectPort="8443"
proxyPort="80"
proxyName="<yourservername>"
/>
- :wq
- Restart tomcat
su - root
service tomcat restart
exit
Notice the URL now points to port 80, and goes through Apache HTTP
Upgrading to Application Express 4.1
Oracle 11g XE ships with APEX 4.0.2, I am now going to upgrade to the latest version. I will only be installing APEX 4.1 en, as I only use the one language for development.
- Download APEX_4.1_en, unzip it and place it in the shared folder
- pwd for apex directory now reads /media/sf_Shared/apex_4.1_en/apex for me
- Login as user oracle via putty
- cd /media/sf_Shared/apex_4.1_en/apex/
- sqlplus /nolog
- conn / as sysdba
- @apexins SYSAUX SYSAUX TEMP /i/
Please note that this is recommended to use other tablespaces that sysaux, but hey…
(btw, now you can take a nap, this will take some time…) - sqlplus “/ as sysdba”
- ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 10;
- Grant connect to all hosts (you can be more restrictive with this, and only use this if you need to. You can always run this bit later if you are uncertain).
DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_040100
-- the "connect" privilege if APEX_040100 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
-- Before checking the privilege, ensure that the ACL is valid
-- (for example, does not contain stale references to dropped users).
-- If it does, the following exception will be raised:
--
-- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040100'
-- ORA-06512: at "XDB.DBMS_XDBZ", line ...
--
SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;
DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040100', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_040100', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
commit
/
- exit
- rm -rf /u01/www/i
- cp -rf /media/sf_Shared/apex_4.1_en/apex/images/ /u01/www/i
- chmod -R 755 /u01/www/i
- Now for the cleaning up
sqlplus /nolog
conn / as sysdba
DROP USER APEX_040000 cascade;
EXEC DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE('power_users.xml', 'APEX_040000');
commit;
DONE :D