简体   繁体   中英

webgate and cx_Oracle InterfaceError: Unable to acquire Oracle environment handle;

I am trying integrate webgate + apache24 on Oracle Linux 7. The webgate + apache24 integration works fine with static pages (for eg index.html).

Also, when i try to serve the API using with python + mod wsgi + apache (without webgate) it works fine. Apache is able to get the environment handle.

But when i enable the webgate.conf in apache httpd.conf, the cx_oracle start complaining about cx_Oracle InterfaceError: Unable to acquire Oracle environment handle;

I have set the env variable in /etc/sysconfig/httpd

export ORACLE_HOME=<path to oracle_home>
export LD_LIBRARY_PATH=<path to oracle_home>:/opt/Python-3.5.2/lib
export LD_RUN_PATH=<path to oracle_home>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/<path to oracle_home>/webgate/apache/lib/

i have also set these in /etc/profile and restarted apache still it does not work.

When i print os.environ in app.py that is loaded using mod_wsgi, I do see all the above vaiable set.

Additional information, i have modified the /etc/httpd/conf/http.conf , 'User' directive to 'localuser'

However i still continue get the same error. Not quite sure what is wrong.

With OL7 / RHEL7 the syntax for /etc/sysconfig/httpd is now like:

ORACLE_HOME=/home/oracle/app/oracle/product/12.2.0/dbhome_1

etc.

Note

  • there is no export keyword
  • I believe you can't use variables on the right hand side of the equal sign.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM