Nov 14 2007

Oracle APEX in 11g Installation

Category: 11g,APEX,SQL Developerittichai @ 8:55 pm

Today I installed Oracle 11g (11.1.0.6) on my machine. I did not realize that Oracle APEX is a part of the standard database components.

So after the 11g installation, I just follow simple steps (shown later below) for the post-installation. In order to access the APEX application, either the embedded PL/SQL gateway or Oracle HTTP server with mod_plsql is needed. For simplicity, I’ve decided to go with the former. By using the embedded PL/SQL gateway, it will run using the Oracle XML DB HTTP server which is already in Oracle database, so there is no need to install a separate HTTP server. The Oracle’s document here explains about this as well as provides the detailed information on the post-installation.

To configure the embedded PL/SQL gateway:

1. Go to the $ORACLE_HOME/apex directory.

2. Use SQL/Plus to connect as SYS to 11g database where APEX is installed.

SYS AS SYSDBA@db11r1> @apxconf

PORT
----------8080

Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
Default values are in brackets [ ].
Press Enter to accept the default value.

Enter a password for the ADMIN user              []admin_password
Enter a port for the XDB HTTP listener [      8080]
...changing HTTP Port

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Session altered.

...changing password for ADMIN

PL/SQL procedure successfully completed.

Commit complete.

3. Unlock the ANONYMOUS account.

SYS AS SYSDBA@db11r1> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

User altered.

4. Enable Oracle XML DB HTTP server

SYS AS SYSDBA@db11r1> EXEC DBMS_XDB.SETHTTPPORT(8080);

PL/SQL procedure successfully completed.

SYS AS SYSDBA@db11r1> COMMIT;

Commit complete.

5. We’re now ready to access APEX.

http://host:port/apex

http://host:port/apex/apex_admin — for admin page

Port in this case is 8080 which is the default.

Note that the format of URL is a little bit different from when using HTTP server with mod_plsql -

http://host:port/pls/apex

http://host:port/pls/apex/apex_admin — for admin page

Also the SQL Developer 1.1.3 is included under “sqldeveloper” directory of ORACLE HOME. So just double-click at sqldeveloper.exe to launch application.


Bookmark and Share

Tags: ,

22 Responses to “Oracle APEX in 11g Installation”

  1. Anonymous says:

    Hi My friend Oracle lover …

    I’m trying to make this work on the 11g and didnt find either mod-plsql or http server on this version.

    Do you know how can I get those ?

  2. IC says:

    Have you tried to enable XML DB HTTP?

    To enable Oracle XML DB HTTP server:

    1. Start SQL*Plus and connect to the database as SYS.

    SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password

    2. Run the following statements:

    EXEC DBMS_XDB.SETHTTPPORT(8080);
    COMMIT;

    Then proceed with running apxconf script.

    Let me know how it goes.

    -IC

  3. Jeff Yu says:

    Hi, I configured a 11G APEX using the enbedded PL/SQL gateway like you described here. Then I tried to log in ADMIN, www::8080/apex/apex_admin, I got a pop-up says:
    The server at XDB requires a username and password, I enetered: ADMIN and password, it failed. What can I do to fix it? Thanks.

  4. ittichai says:

    Jeff,
    I assume you did “Unlock anonymous account” already. Have you tried to verify and enable the XDB HTTP server port?

    Is the workspace-access URL (http://localhost:8080/apex) working?

    You may try to bounce database to see whether or not it helps.

  5. Jeff Yu says:

    Thanks,Ittichai.I checked most postings thru Google search. I ran apex_epg_config many times. Running of epgstat (in $ORACLE_HOME/rdbms/admin) produced: Allow repository anonymous access? => false (Anonymous access to XDB) Is this the issue? How to fix it?

    • ittichai says:

      Have you tried to restart instance?

      Can you post the result of your epgstat? The anonymous access = false is okay. Setting to TRUE just allows public access to XDB repository without authentication. It is security risk.

      This is my epgstat’s output: (you can try to compare if anything may differ).

      01:32:38 SYS AS SYSDBA@ora11win> @D:\oracle\product\11.1.0\db_1\rdbms\admin\epgstat
      +————————————–+
      | XDB protocol ports: |
      | XDB is listening for the protocol |
      | when the protocol port is non-zero. |
      +————————————–+

      HTTP Port FTP Port
      ——— ——–
      8080 0

      1 row selected.

      Elapsed: 00:00:00.15
      +—————————+
      | DAD virtual-path mappings |
      +—————————+

      Virtual Path DAD Name
      ——————————– ——————————–
      /apex/* APEX

      1 row selected.

      Elapsed: 00:00:00.17
      +—————-+
      | DAD attributes |
      +—————-+

      DAD Name DAD Param DAD Value
      ———— ———————— —————————————-
      APEX database-username ANONYMOUS
      default-page apex
      document-table-name wwv_flow_file_objects$
      request-validation-funct wwv_flow_epg_include_modules.authorize
      ion

      document-procedure wwv_flow_file_mgr.process_download
      nls-language american_america.al32utf8
      document-path docs

      7 rows selected.

      Elapsed: 00:00:00.92
      +—————————————————+
      | DAD authorization: |
      | To use static authentication of a user in a DAD, |
      | the DAD must be authorized for the user. |
      +—————————————————+

      no rows selected

      Elapsed: 00:00:00.10
      +—————————-+
      | DAD authentication schemes |
      +—————————-+

      DAD Name User Name Auth Scheme
      ——————– ——————————– ——————
      APEX ANONYMOUS Anonymous

      1 row selected.

      Elapsed: 00:00:00.03
      +——————————————————–+
      | ANONYMOUS user status: |
      | To use static or anonymous authentication in any DAD, |
      | the ANONYMOUS account must be unlocked. |
      +——————————————————–+

      Database User Status
      ————— ——————–
      ANONYMOUS OPEN

      1 row selected.

      Elapsed: 00:00:00.59
      +——————————————————————-+
      | ANONYMOUS access to XDB repository: |
      | To allow public access to XDB repository without authentication, |
      | ANONYMOUS access to the repository must be allowed. |
      +——————————————————————-+

      Allow repository anonymous access?
      ———————————-
      false

      1 row selected.

      Elapsed: 00:00:00.01

      You can just simply check access to XDB by assigning password to anonymous account (e.g., alter user anonymous identified by anonymous). Then go to http://host:8080, when prompting for username and password, enter anonymous and its password. Assuming that this anonymous account is already unlocked, it should let you in and display list of files/folders on browser.

      Ittichai

  6. Jeff Yu says:

    Thanks Itti,you are still on this. My epgstat output is pretty much like yours. When I give anonymous a password and do the APEX admin login again, I got an ORA-600 [wpemInit_3] on the Oracle alert log. The ORA-600 subcode is not even in MetaLink yes. This 11G is just downloaded without any patch(es). My old APEX is still working on 10g with a HTTP server. So I will wait for 11.2 in the future or after we apply more patch/patchset to it before I try APEX again.
    Regards, Jeff

  7. ittichai says:

    Jeff,

    Either you could to apply the 11.1.07 patch set (and then try to configure it again) or configure the existing HTTP to this database. At least to see whether or not it may work.

    Ittichai

  8. Naz says:

    Hi,

    I am having problems getting the Oracle Apex home page to appear. I have apex installed on 11g on Enterprise Linux.

    I have configured Oracle Apex to work over the PL/SQL gateway. I have ran the apexconf.sql script, set the port, unlocked the anonymous account and ran the apex_congfig sql script.

    The port number I have set is 8080 from default of 7779. I have done this multiple times and bounced the database too.

    The URL I am using to access APEX is http://localhost:8080/pls/apex and http://localhost:8080/pls/apex_admin

    I am at a loss as I have followed the documentation post installation tasks and used your instructions many times with no success.

    Your help will be greatly apprecited.

    Thanks

    • ittichai says:

      Have you tried to run the epgstat? Please post the result. See the previous comment for detail.

      For EPG configuration, you will have to use http://localhost:port/apex (no pls), and the default port is 8080. The URLs you mentioned is for when using HTTP server with mod_plsql.

  9. Merlin97 says:

    August 9, 2009 by Mad We have a winner! ,

  10. sjs30101 says:

    Just completed a fresh standard install of 11g on Windows Server 2008 Std x64. Not a hint of HTTP server but did see APEX was present.

    I followed your directions above and worked perfectly! I would have prefered using the Apache server but this will work.

    Thanks!

    • ittichai says:

      Glad to hear that it works for you. The Apache with mod_plsql is definitely the way to go for if you plan to use APEX for production at a larger scale. The instructions are there with the download files. The final note – Oracle just released a new way to connect to APEX called APEX listener. This likely will be the default option for the next release of APEX. I wrote about it here.

  11. Balazs says:

    Well, I followed the above recommendations and it didn’t succeeded (actually, with upgrading Oracle 11gr1 to APEX 3.2.1).
    It say user ANONYMOUS with password “anonymous” is expired.

    I don’t know if it is related to whether the packages are modified need recompilations.

  12. ittichai says:

    If you password of ANONYMOUS account has expired, you can try to set its password using

    ALTER USER ANONYMOUS IDENTIFIED by [password];

    and to be certain, please unlock this account if needed.

    ALTER USER ANONYMOUS ACCOUNT UNLOCK;

  13. Dwayne King says:

    Hi there,

    Thanks so much for maintaining this page. It’s nice to know others are stumbling over the same things.

    I have done as most others have here: installed 11g, ran apxconf.sql, unlocked the ANONYMOUS account. However, as another poster mentioned, I do not see any indication that the HTTP server is running. If I try to hit: http://localhost:6666/apex or the admin page I get no response at all (not a 404, not an error….nothing)

    If I run a netstat command I don’t seem to see that the machine is listening on the correct port – should I see it? Do I need to execute anything to tell it to start listening?

    One thing that I notice from the epgstat output below is that anon access seems to be “false”. I haven’t changed any defaults….should this be “true”?

    Any help much appreciated.

    SQL> @?/rdbms/admin/epgstat
    +————————————–+
    | XDB protocol ports: |
    | XDB is listening for the protocol |
    | when the protocol port is non-zero. |
    +————————————–+

    HTTP Port FTP Port
    ——— ——–
    6666 0

    1 row selected.

    +—————————+
    | DAD virtual-path mappings |
    +—————————+

    Virtual Path DAD Name
    ——————————– ——————————–
    /apex/* APEX

    1 row selected.

    +—————-+
    | DAD attributes |
    +—————-+

    DAD Name DAD Param DAD Value
    ———— ———————— —————————————-
    APEX database-username ANONYMOUS
    default-page apex
    document-table-name wwv_flow_file_objects$
    request-validation-funct wwv_flow_epg_include_modules.authorize
    ion

    document-procedure wwv_flow_file_mgr.process_download
    nls-language american_america.al32utf8
    document-path docs

    7 rows selected.

    +—————————————————+
    | DAD authorization: |
    | To use static authentication of a user in a DAD, |
    | the DAD must be authorized for the user. |
    +—————————————————+

    no rows selected

    +—————————-+
    | DAD authentication schemes |
    +—————————-+

    DAD Name User Name Auth Scheme
    ——————– ——————————– ——————
    APEX ANONYMOUS Anonymous

    1 row selected.

    +——————————————————–+
    | ANONYMOUS user status: |
    | To use static or anonymous authentication in any DAD, |
    | the ANONYMOUS account must be unlocked. |
    +——————————————————–+

    Database User Status
    ————— ——————–
    ANONYMOUS OPEN

    1 row selected.

    +——————————————————————-+
    | ANONYMOUS access to XDB repository: |
    | To allow public access to XDB repository without authentication, |
    | ANONYMOUS access to the repository must be allowed. |
    +——————————————————————-+

    Allow repository anonymous access?
    ———————————-
    false

    1 row selected.

    SQL>

    • ittichai says:

      Dwayne,

      I have my listening port displayed when checking with NETSTAT.

      C:\>netstat -an |find /i “listening” | find “8080″
      TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING

      If you don’t have it, it is likely that issue is with XDB. I assume there is no error when doing “apxconf”? Could you make sure that it is enabled using “EXEC DBMS_XDB.SETHTTPPORT(8080);”?

      The way to check is to go to http://localhost:8080/ (without apex). You will be prompted to logon using anonymous account and its password. Successful logon will display the XDB folders on browser.

      Another thing, just in case, is to check whether or not APEX is installed properly. The status should show VALID.

      @ora11win> select comp_name, version, status
      from dba_registry
      where comp_name=’Oracle Application Express’;

      COMP_NAME VERSION STATUS
      ———————————– ————— —————
      Oracle Application Express 3.2.0.00.27 VALID

  14. Dwayne King says:

    OK – I guess I just completely missed it….

    1) the port in question *is* shown by netstat, exactly as you point out.
    2) the port *does* seem to be registered when I do a “lsnrctl status”, and it shows HTTP as expected

    However, hitting the URL as you describe above (without apex) gives me nothing. No response at all. Does this help at all?

    Thanks for your reply.

  15. ittichai says:

    If you see nothing from http://localhost:8080, it seems like you may have issue with XDB rather. Did you have XDB correctly installed? The “Oracle XML Database” must be shown from dba_registry. You may need to google on how to check XDB or even reinstall it.

    BTW, does you browser use proxy?

  16. Dwayne King says:

    No browser proxy here. XML DB does indeed show up (and is VALID) in DBA_REGISTRY.

    Currently looking for a way to debug XDB not responding, since netstat says it *should* be listening

Leave a Reply