Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

migrating mod_plsql application to Oracle REST Data Services

I read on MOS Doc ID 1945619.1 that starting with the 12.1.3 Oracle HTTP Server (OHS), the mod_plsql feature has been deprecated and will not be included with the 12.2 Oracle HTTP Server.

For the future, Oracle recommends moving to Oracle REST Data Services (formerly known as Oracle APEX Listener) as an alternative to mod_plsql.

Our shop have a lot of mod_plsql applications (i.e. applications written usinjg HTP/HTF packages) in production. Since I don't know anything about Oracle REST Data Services I'm asking you if we can migrate the old applications to this new product without changing the code.

Thank you.

Kind regards, Cristian

like image 669
Cristian Veronesi Avatar asked Feb 05 '15 10:02

Cristian Veronesi


1 Answers

Doug McMahon (Oracle employee) has a great open source module for Apache. Apache PL/SQL Gateway Module (mod_owa)

https://oss.oracle.com/projects/mod_owa/dist/documentation/modowa.htm

I am using it in a production environment and I highly recommend it. It's really fast and rock solid.

You need to do some compiling but it's worth it being able to use Apache 2.4 and mod_plsql.

Steps:

  1. download httpd 2.4.? from apache.org + extract
  2. If Centos 6 or less download apr and apr-util
  3. configure with enable-so, make and make install

    ./configure --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr

  4. Download mod_owa + unzip

  5. create empty directory. Copy all files from "apache24" into new folder. Copy all files from "src" to new folder

  6. enter new folder and edit modowa.mk <-- important add $ORACLE_HOME, edit APACHE_TOP

  7. Copy mod_owa.so to apache's modules

  8. Add a modowa.conf in Apache's conf/ dir.

Example modowa.conf:

loadModule owa_module modules/mod_owa.so

<Location /pls>
    Options        None
    SetHandler     owa_handler
    OwaUserid      user/pass
    OwaNLS         AMERICAN_AMERICA.AL32UTF8
    OwaPool        100
    OwaStart       "package.procedure"
    OwaDocProc     "wwv_flow_file_mgr.process_download"
    OwaDocTable    photos_upload BLOB_CONTENT
    OwaUploadMax   50M
    OwaCharset     "utf8"
    order          deny,allow
    allow          from all
    OwaReset       LAZY
    OwaCharsize    4
    OwaFlex        package.procedure
    OwaHttp        REST 
</Location>

Before starting httpd ORACLE_HOME, NLS_LANG needs to be set (ORACLE_SID also if local). It needs access to an Oracle Home with libclntsh.so. (Oracle client will do).

I simply added oracle.conf (one line full path to oracle home/lib) under /etc/ld.so.conf.d (+ ldconfig)

Really scalable and a much cleaner setup then OHS.

like image 153
Olafur Tryggvason Avatar answered Oct 10 '22 08:10

Olafur Tryggvason