B.4 Configuring the Oracle HTTP Server

Configuring Oracle HTTP Server requires that you copy the images directory, edit the dads.conf file, configure static files support, stop and restart Oracle HTTP Server, disable Oracle XML DB Protocol Server, and configuring Oracle HTTP server behind a reverse proxy or load balancer.

This section describes how to configure Oracle HTTP Server with mod_plsql.

B.4.1 About Copying the Images Directory

Learn about the importance of copying the images directory.

Whether you are loading a new installation or upgrading from a previous release, you must copy the images directory from the top level of the apex\images directory, for example C:\TEMP, to the location on the file system containing the Oracle home for Oracle HTTP Server.

During an upgrade, you overwrite your existing images directory. Before you begin the upgrade, to ensure that you can revert to the previous version, Oracle recommends that you create a copy of your existing images directory for Oracle Application Express, indicating the release number of the images (for example, images_3_1).

B.4.2 Copying the Images Directory

Learn how to copy images directory.

To locate the images directory on the file system, review the following files for the text alias /i/:

  • Oracle HTTP Server distributed Oracle9i Release 2—see the httpd.conf file.

  • Oracle Application Server 10g—see the marvel.conf or dads.conf files.

  • Oracle HTTP Server distributed with Oracle Database 11g or 12c —see the marvel.conf or dads.conf files.

When you locate the images directory path, rename the existing images directory to a backup location. Doing so enables you to revert to the previous release, if that becomes necessary.

Use the following command syntax to copy the apex\images directory from the Oracle Database home to a path in the Oracle HTTP Server home:

  • Oracle HTTP Server distributed with Oracle Database 12c or later:

    • Windows:

      xcopy /E /I APEX_HOME\apex\images ORACLE_HTTPSERVER_HOME\user_projects\domains\base_domain\images
      
    • UNIX and Linux:

      cp -rf $APEX_HOME/apex/images ORACLE_HTTPSERVER_HOME/user_projects/domains/base_domain
      

In the preceding syntax examples:

  • APEX_HOME is the location of where the installation Zip file was unzipped

  • ORACLE_HTTPSERVER_HOME is the existing Oracle Application Server or Oracle HTTP Server Oracle home

B.4.3 Editing the dads.conf File

Learn how to edit dads.conf file.

The dads.conf file contains the information about the Database Access Descriptor (DAD) to access Oracle Application Express.

Note:

Within the context of this document, ORACLE_HTTPSERVER_HOME is the location where Oracle HTTP Server is installed.

To edit the dads.conf file:

  1. Use a text editor and open the dads.conf.
    • Oracle Application Server 10g:

      • Windows:

        ORACLE_HTTPSERVER_HOME\Apache\modplsql\conf\dads.conf
        
      • UNIX and Linux:

        ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf/dads.conf
        
    • Oracle HTTP Server distributed with Oracle Database 11g:

      • Windows:

        ORACLE_INSTANCE\config\OHS/ohs<1>\mod_plsql
        
      • UNIX and Linux:

        ORACLE_INSTANCE/config/OHS/ohs<1>/mod_plsql
        
    • Oracle HTTP Server 12c:

      • Windows:

        ORACLE_HTTPSERVER_HOME\user_projects\domains\base_domain\config\fmwconfig\components\OHS\instances\ohs1\mod_plsql\dads.conf
        
      • UNIX and Linux:

        ORACLE_HTTPSERVER_HOME/user_projects/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1/mod_plsql/dads.conf
        

    Note:

    In the examples above, ohs1 refers to the name of the Oracle HTTP Server instance. When running the Oracle HTTP Server Configuration Wizard, the default name is ohs1. It may have been changed to a name other than ohs1.

  2. In the dads.conf file, replace ORACLE_HTTPSERVER_HOME, host, port, service_name, and apex_public_user_password with values appropriate for your environment. Note that the apex_public_user_password is the password you changed in APEX_PUBLIC_USER Account.

    Note that the path listed is only an example. The path in the dads.conf file should reference the file system path described in About Copying the Images Directory.

    Alias /i/ "ORACLE_HTTPSERVER_HOME/user_projects/domains/base_domain/images/"
    
    <Location /pls/apex>
     Order deny,allow
     AllowOverride None
     PlsqlDatabaseConnectString     host:port:service_name ServiceNameFormat
     PlsqlNLSLanguage               AMERICAN_AMERICA.AL32UTF8
     PlsqlAuthenticationMode        Basic
     SetHandler                     pls_handler
     PlsqlDocumentTablename         wwv_flow_file_objects$
     PlsqlDatabaseUsername          APEX_PUBLIC_USER
     PlsqlDefaultPage               apex
     PlsqlDatabasePassword          apex_public_user_password
     PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
     PlsqlPathAlias r
     PlsqlPathAliasProcedure wwv_flow.resolve_friendly_url
     Allow from all
    </Location>
    

    Note:

    PlsqlPathAlias and PlsqlPathAliasProcedure are required new parameters that must be added to an existing DAD. This is important when upgrading to Application Express release 5.0.

  3. Locate the line containing PlsqlNLSLanguage.

    The PlsqlNLSLanguage setting determines the language setting of the DAD. The character set portion of the PlsqlNLSLanguage value must be set to AL32UTF8, regardless of whether the database character set is AL32UTF8. For example:

    ...
    PlsqlNLSLanguage            AMERICAN_AMERICA.AL32UTF8
    ...
    
  4. Save and exit the dads.conf file.

B.4.4 Configuring Static File Support

Learn how to configure static file support in Oracle Application Express.

Oracle Application Express enables application developers to include static files with their applications. Static files can be associated with a workspace, an application, a plug-in, or an application theme. When using the Oracle HTTP Server as your web listener, static files are served using Path Aliasing functionality of the mod_plsql plug-in.

See Also:

"Editing the dads.conf File" for the required configuration parameters

B.4.5 Stopping and Restarting Oracle HTTP Server

Learn how to stop and restart Oracle HTTP Server.

This section describes how to stop and restart Oracle HTTP Server.

B.4.5.1 Stopping and Restarting Oracle HTTP Server with Oracle Database 10g and Lower

Learn how to stop and restart Oracle HTTP Server.

Note:

Within the context of this document, ORACLE_HTTPSERVER_HOME is the location where Oracle HTTP Server is installed.

To stop and restart Oracle HTTP Server:

  • Windows:

    Execute the following:

    ORACLE_HTTPSERVER_HOME\opmn\bin\opmnctl stopproc ias-component=HTTP_Server
    ORACLE_HTTPSERVER_HOME\opmn\bin\opmnctl startproc ias-component=HTTP_Server
  • UNIX and Linux

    Execute the following:

    ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl stopproc ias-component=HTTP_Server
    ORACLE_HTTPSERVER_HOME/opmn/bin/opmnctl startproc ias-component=HTTP_Server
    

Note:

If you are using Oracle HTTP Server that is included with Oracle Fusion Middleware 11.1.1, you may need to replace the ias-component name above if the name given to the component was something other than HTTP_Server when it was installed. The default name is ohs1.

B.4.5.2 Stopping and Restarting Oracle HTTP Server 12c

Learn how to stop and restart the Oracle HTTP Server distributed with Oracle Database 12c or later.

To stop and restart the Oracle HTTP Server distributed with Oracle Database 12c or later, enter commands using the following syntax, where DOMAIN_HOME is the path to the Oracle HTTP Server domain:

  • Windows:

    Execute the following:

    %DOMAIN_HOME%\bin\stopComponent.cmd componentName
    %DOMAIN_HOME%\bin\startComponent.cmd componentName
    
  • UNIX and Linux

    Execute the following:

    $DOMAIN_HOME/bin/stopComponent.sh componentName
    $DOMAIN_HOME/bin/startComponent.sh componentName
    

In a default installation, componentName is ohs1 but may have been changed when running the Oracle HTTP Server Configuration Wizard.

B.4.6 Disabling Oracle XML DB Protocol Server

Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role and run the EXEC DBMS_XDB.SETHTTPPORT(0); command.

If you were previously using the Embedded PL/SQL Gateway and now want to use Oracle HTTP server and mod_plsql, you need to disable the Oracle XML DB Protocol Server.

To disable Oracle XML DB Protocol Server:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:
    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Run the following command:
    EXEC DBMS_XDB.SETHTTPPORT(0);
    

B.4.7 About Configuring Oracle HTTP Server Behind a Reverse Proxy or Load Balancer

Learn about configuring Oracle HTTP server behind a reverse proxy or load balancer.

When Oracle Application Express is running behind a reverse proxy or load balancer, it is important to communicate the original HTTP hostname and protocol as seen by user's browser to the Application Express engine. The engine will use this information to generate valid URL in HTML responses and HTTP redirects that user's browser can successfully follow. For Oracle HTTP server and mod_plsql, use PlsqlCGIEnvironmentList directive in the dads.conf configuration file. For example:

PlsqlCGIEnvironmentList REQUEST_PROTOCOL=https
PlsqlCGIEnvironmentList HTTP_HOST=www.example.com:443