Pythian Blog: Technical Track

Installing APEX 4.0 and 3.2 on Oracle 10gR2 on Mac OS X Leopard (Intel)

Update 24-06-2010: Peter de Vaal reported that these instructions work without changes for APEX 4.0 as well. Great news!

Few days ago, I have put together the Quick Install Guide for Oracle 10g Release 2 on Mac OS X Leopard (Intel). I did mention that it would be cool to get APEX working as well but, apparently, APEX isn't supposed to be running on Oracle 10g Release 2 Database on OS X as few people pointed our on the blogs.

Well, the release notes says that Oracle Application Express is not supported and I would imagine that it's because Oracle HTTP Server is not supported either. I'm not a frequent user of APEX but I know that APEX 3.2 is not supposed to be configured in Oracle 10g Database using Embedded PL/SQL Gateway. However, looks like few people did manage to run APEX on 10g using Embedded PL/SQL Gateway. For example, Jeff Kemp has some APEX on 10g hints that I perused.

Long story short, I was able to install APEX successfully using the native Mac OS X Oracle 10g Database and here is how... Basically, you want to follow the standard documentation and skip one 11g step but include one trick that I took from comments to the Jeff Kemp blog I mentioned.

  1. Download APEX installation archive. Unzip it (Oracle database home seems to be a good location). All scripts are then run from that unzipped apex directory.
  2. Identify or create a tablespace for APEX (or two to separate the framework and applications). I created APEX tablespace.
  3. Install APEX framework schemas in the database -- @apexins APEX APEX TEMP /i/.
  4. Reset ADMIN password -- @apxchpwd
  5. Next is the trick -- remove some security on XDB, which is not a good thing, by the way, but I can live with it on my development box that's available on localhost only: Update 2-Jul-09: If you still have troubles, see this post from Scott Spendolini. Update 7-Jul-09: If you get an error “Maximum number (%s) of ‘%s’ XML node elements exceeded”, see this comment and say a good word about Tim Hall.
    DECLARE
     configxml XMLType;
     configxml2 XMLType;
     BEGIN
     -- Get the current configuration
     configxml := DBMS_XDB.cfg_get();
     
     -- Modify the configuration
     SELECT INSERTCHILDXML(
     configxml,
     '/xdbconfig/sysconfig/protocolconfig/httpconfig',
     'allow-repository-anonymous-access',
     XMLType('<allow-repository-anonymous-access xmlns="https://xmlns.oracle.com/xdb/xdbconfig.xsd">true</allow-repository-anonymous-access>'),
     'xmlns="https://xmlns.oracle.com/xdb/xdbconfig.xsd"')
     INTO configxml2 FROM DUAL;
     -- Update the configuration to use the modified version
     DBMS_XDB.cfg_update(configxml2);
     END;
     /
  6. Now it's time to configure the Embedded PL/SQL Gateway -- @apex_epg_config.sql /Volumes/HD2/oracle/product/10.2.0/db_1. Note that it's actually the location where you unzipped APEX with images (see comment #17 from hourus. If you follow my instructions in step 1 to the letter -- it would be you Oracle database home.
  7. Enabling Oracle XML DB HTTP Server, shared servers and unlocking ANONYMOUS user :
    call dbms_xdb.setHttpPort(8080);
     alter system set shared_servers = 5;
     alter system register;
     alter user anonymous account unlock;
    Verify enabled Oracle XML DB HTTP Server by using lsnrctl status:
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=macbook)(PORT=8080))(Presentation=HTTP)(Session=RAW))
  8. (Optional) I think I ran the wrong script during the initial installation and installed only run-time environment so after hitting error "ERR-1014" I had to run @apxdvins to fix it. That actually took 13+ minutes so I must have initially installed only the run-time environment by running @apxrtins APEX APEX TEMP /i/ instead of @apexins APEX APEX TEMP /i/

Now navigate your browser https://localhost:8080/apex and viola:

Obviously, you won't host your production environment this way and I think it should be possible to hook APEX up via external Apache Server on OS X.

Comments (1)

Subscribe by email