I have configured PyODBC with Netteza SQL within Django application on Ubuntu 14.04 machine. It works fine with default Django Server and with Gunicorn. But when I run with Apache/Nginx I get "File not found error" for library.
I have seen these error in the past when:
- Dependent libraries are not installed. Since it is working with default Django server, I am discarding this issue
- Environment variable "LD_LIBRARY_PATH" not set. I tried setting these variable in `/etc/environment`, `/etc/profile`, `/etc/init.d/apache2` and settings file of Django. I am able to read these variables from within the Django's project. Value of these variable:
'ODBCINI': '/home/mquadri/CONFIG/odbc.ini',
'NETEZZA': '/usr/local/nz',
'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/nz/bin64',
'NZ_ODBC_INI_PATH': '/home/mquadri/CONFIG',
'LD_LIBRARY_PATH': '/usr/local/nz/lib64'
The another reason that I could think of was the issue related to permission on the file which apache/nginx are not able to read. In order to verify that I have set 777 permission on `/usr/local/nz` directory. Also added `www-data` user to `root` group. But still I get the same error. Does any one has any idea what might be going wrong here?