Nothing to do with APEX, but I really don’t want to forget this.

As you might know, I’m a big fan of the command prompt. I’ve been using 4DOS/4NT/Take Command for years.

These products are sold by a company called JP Software. But now they also have a free-ware product, which suffices for most of my work.

To get a “Command Prompt here” after a right-click on a folder in Windows Explorer I did this:

  1. Installed TCC/LE (downloaded here)
  2. Opened my reg-editor and went to:
    HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell
  3. Created a key called “Command Prompt”
  4. Set the default string to “&Take Command LE”
  5. Created a new key within the “Command Prompt” key called “command”
  6. Set the default string to
    "C:Program FilesJPSoftTCCLE12tcc.exe" cdd "%1"
  7. Ready. Changes should take effect immediately

This information was taken from another blog and adjusted for TCC/LE

Please imagine the following:
You started out with apex. And because it was the easiest installation scheme (apart from copying the ready-made virtual machine offered by Oracle free-of-charge ;-), you used the EPG-installation scenario.
Lets suppose that by now you have gained a bit of experience and you want to use a proper webserver to publish your newly gained expertise. At this moment the question becomes: how can I do this, without needing to reinstall all of APEX or even installing a whole new database?
This blog shows a quick way to ‘upgrade’ your installation to a webserver, using Tomcat 6 webserver (and Apache 4.0 and Oracle 11G database and Oracle Linux 6).

made new folder /app/apache/
## [as root] mkdir /app/apache/
## [as root] chown oracle:oracle /app/apache/

downloaded installation file apache-tomcat-6.0.32.tar.gz from Tomcat website and unzipped
## tar -xvfGW apache-tomcat-6.0.32.tar.gz

changed the port number from 8080 to 8082, as the 8080 port is already used by the dbconsole.
## open file /app/apache/conf/server.xml with an xml editor and Change all occurences of 8080 to 8082.

made a link to the startup shell script, located in /app/apache/tomcat/bin/startup.sh

moved all of the unzipped files to the /app/apache/webapps folder (you can extract the files here immediately, saves a bit of time).

Added following lines to file /app/apache/conf/tomcat-users.xml to allow Oracle to use the Tomcat server (you will need to add brackets for each line):
## <role rolename=”Manager”/>
## <role rolename=”Admin”/>
## <user username=”manager” password=”password” roles=”Manager”/>
## <user username=”admin” password=”password” roles=”Admin”/>
##

Copied the images directory from the apex location (see your apex installation logs!!) to the webapps folder and named the folder ‘i’. Then changed the access rights so that Oracle can actually approach and use the stylesheets and images.
## cp -r /app/oracle/product/apex/apex40/images /app/apache/tomcat/webapps/i
## chown oracle:oracle /app/apache/tomcat/webapps/i

Changed the portnumber used by Apex by using script apxconf.sql (Run this script as sysdba).

##[oracle@orasrv01 apex40]$ sqlplus sys as sysdba
##
##SQL*Plus: Release 11.2.0.1.0 Production on Fri May 13 10:09:37 2011
##
##Copyright (c) 1982, 2009, Oracle. All rights reserved.
##
##Connected to:
##Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – Production
##With the Partitioning, OLAP, Data Mining and Real Application Testing options
##
##SQL> @apxconf.sql

Set http port used by xmldb to 8082.
##SQL> exec dbms_xdb.sethttpport(8082);

Test installation by starting up the Apex Administration site in your browser:
## http://orasrv01.oracle.com:8082/apex_admin

…If all went well then you should now be able to login as an admin user and create a new workspace in Apex.

Oracle provides a good alternative for using the EPG in single-developer projects. It is called the Oracle APEX Listener.

it is intended to run as some kind of plug-in in:

  • Oracle WebLogic Server.
  • Oracle GlassFish Server.
  • Oracle Containers for J2EE (OC4J).

But it also runs in a stand alone mode.

This time I’d like to discuss the latter, stand-alone mode.

Advantages

Using the listener in stand-alone mode, for me, has several advantages.

  • super fast to set up
  • easy to automate
  • possibility to start more instances (ie for each APEX instance)
  • no WebDav/FTP access required to the /i/ folder
    (this also has a drawback when enrolling your app)

Disadvantages

The main drawback is that it won’t install as a service on Windows.

Setup

Using the installation guide you’ll be up and running within minutes. Oracle did a good job in explaining this. I will not elaborate further on this.

In essence you need to start the Listener as follows:

java.exe -Dapex.home={PATH_A} -Dapex.images={PATH_B} -Dapex.port={PORTNUMBER} -jar {PATH_C}

The Listener now will try to find settings in the {PATH_A}. If it cannot find them, it will first ask for a username and password for the adminlistener and managerlistener users, after which it will start the browser with a configuration page.

Apex listener configuration page
Apex listener configuration page

Here you give the Listener the information it needs to connect to the database. It’s a kind of DAD… You only have to fill out the first tab. The rest you can leave as default. When you apply the Listener will save this information into the {PATH_A} location.

{PATH_B} points to the images directory, in my case that is d:apex4apeximages so I can edit and save CSS, images, HTML etc as I please.

{PORTNUMBER} is the portnumber the listener is listening to. In my case that is 81, but you can put it on any port you like (even 80!).

{PATH_C} points to the apex.war java program.

Once the Listener has saved the connect-information into the {PATH_A} location, we can easily switch the listener to another port without any re-configuration. Just use the same command and only replace the {PORTNUMBER} variable with the desired port-number. My batch-file will handle this.

Putting it all together

Now I’ve explained how to start the listener the next step is to do some automation.

I created a batch file that you can use to automate starting the Listener.

::@echo off

pushd D:Oracleapxlistener
setlocal

set tmp=tmp.%1%
set java=c:Program FilesJavajdk1.6.0_24binjava.exe
set apx_user = RMARTENS
set apx_workspace = APEXDEMO
set apx_listener = D:Oracleapxlistenerapex.war
set browser = "c:Program Files (x86)Mozilla Firefoxfirefox.exe"

if not exist %tmp% mkdir %tmp%

start "ApexListener %2% %1%" /MIN "%java%" "-Dapex.home=%tmp%" -Dapex.images=D:apex4apeximages -Dapex.port=%2% -jar %apx_listener%

pause

echo Listener started

start "Oracle Apex" %browser% "http://localhost:%2%/apex/f?p=4550:1:::::F4550_P1_COMPANY,F4550_P1_USERNAME:%apx_workspace%,%apx_user%"

:einde
endlocal
popd
exit

If you save this as a batch file and edit lines 7 to 11 to reflect your settings, you’ll be able to start your listener as:

apxlistener.bat apexdemo 81

Which starts the listener using the settings in the apexdemo folder on port 81.

The batch can be further extended to have different /i/ folders for each environment, but for me that was not needed.

— Good Luck ! —

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…

Since Oracle is always advising to use the XE database it seemed only logical to try and see what the possiblities are, and how they compare. For those interested, this post shows the outcome of  my quick survey.

1. Use the download provided by Oracle

a. Install VM (VirtualBox)
b. Import machine
c.  A working environment: enjoy!
Links
Pros:
– free software
– quick and easy to use with minimal effort
– setup as a training environment complete with tutorial, you can get started immediately…
Cons:
– Since it is a ready-made environment, you miss out on learning about the technical background stuff
2. Windows install
Pros:
– Windows OS is familiar to most, and most often used by customers as OS platform for developer machines.
Cons:
– Windows OS is either expensive, or illegal (though WE don’t do that of course)…
– Oracle can slow down your system, particularly on startup, due to resources needed to startup system and database, memory usage, etc.
3. Linux install (1): Ubuntu
a. Install Ubuntu
b. install packages needed to run Oracle Universal Installer
c. install Oracle Database (XE/Enterprise, depending on your needs and preferences)
d. Install Apex
e. Install Development tools as needed
Pros:
– free platform
– lots of possibilities to learn (Specifically about Linux installs – if you haven’t had a lot of experience with these yet)
Cons:
– this particular configuration will not appear on your workplace very often
4. Linux (2): Oracle Ubreakable Linux
a. install Oracle Unbreakable Linux (a RedHat derivative)
b. Install + configure Oracle database (XE/Enterprise, afhankelijk van wat je nodig denkt te hebben)
c. Install missing packages (these are requested by Oracle installer)
d. Install and configure Apex.
e. Install development tools as needed.
Pros:
This installation scenario resembles many, if not most, of the profession Oracle environments you will encounter
– free platform (though database license required when you are using Enterprise Edition and your setup is be used for production)

Cons:

– this is NOT a simple scenario.


Hi there,

Yesterday I installed Firefox 4 and Internet Explorer 9. Wow beautyfull browsers.. both of them.

However yesterday I allready found out that IE is not diaplaying the AnyChart charts in my Apex applications. So IE9 for now is a no go.. pitty.

Today I also found out that Firefox 4 has issues with Apex. for example getting into the application builder. So a no go there as well..

Luckily downgrading firefox is as easy as an install. So I did that and the problems immediately went away.

I will re-install both in a virtual machine to investigate further, but for now.. you are warned.

To be continued……

 

I’m a nerd. I know. I simply “love” the command-line.

For years I’ve been using 4NT and TakeCommand, registered the product years ago (www.jpsoft.com).

Now I made the switch to Windows 7 (64-bit). I still have to get used to it. Some Oracle issues on PL/SQL developer etc.

When I wanted to install my command-lines. click-click.. it worked. However it wouldn’t register to the registered product no more. 🙁

So I wrote the guys at JP-software an email. They returned the mail allmost immediately (what a service). The answer is that the product is no longer supprted under Windows 7. I can imagine that.

To my surprise there is a free alternative to my 4NT and TakeCommand command-lines. It’s called “TCC LE” and it’s from the guys at JPSoftware. Best of all.. it’s free.

So guys (and dolls offcourse): If you need a full powered commandline, please have a look at: http://www.jpsoft.com/download.htm

Wow, Richard and I have been strugling with APEX 4 on XE for hours before we came across this port:

http://www.emarcel.com/database/143-apexhttpccess

It would have saved us hours.. thanks Marcin!

<COPIED BLOG>

After default installation of Oracle APEX 3.0, remote users are not allowed to access Database home page (APEXconsole)

  • http://127.0.0.1:8080/apex
  • http://localhost:8080/apex
  • http://hostname.com:8080/apex (not allowed by default from remote location)

This is because the listener local access setting is being set to local only by default.

To set HTTP Access to allow remote connects:

exec dbms_xdb.setListenerLocalAccess (l_access => FALSE);

To set HTTP Access back to Local only:

exec dbms_xdb.setListenerLocalAccess (l_access => TRUE);

UPDATE:
Another way to set this up is to login to APEX dashboard as a sys user and navigate to: Home > Administration > Manage HTTP Access (Tasks’ list on the right side of the page) and change the settings:

</COPIED BLOG>

Regards,
Sergei